Exemplo n.º 1
0
def setup():
    options = "--prefix=/usr \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --with-xinput=yes \
        --enable-gtk-doc \
        --enable-test-print-backend"

    #shelltools.export("CFLAGS", get.CFLAGS().replace("-fomit-frame-pointer",""))
    #gtk2 needs -DGTK_COMPILATION CPPFLAG when compiling itself
    #Avoid "Only <gtk/gtk.h> can be included directly error"
    shelltools.export("CPPFLAGS", "-DGTK_COMPILATION")

    if get.buildTYPE() == "emul32":
        options += " --libdir=/usr/lib32 \
                     --bindir=/usr/bin32 \
                     --sbindir=/usr/sbin32"

        shelltools.export("CC","%s -m32" % get.CC())
        shelltools.export("CXX","%s -m32" % get.CC())
        shelltools.export("CXXFLAGS","-m32")
        shelltools.export("LDFLAGS","-m32")
    else:
        shelltools.export("CFLAGS","")
        shelltools.export("CXXFLAGS","")
        shelltools.export("LDFLAGS","")
        
    autotools.autoconf()
    autotools.configure(options)

    inarytools.dosed("libtool"," -shared ", " -Wl,-O1,--as-needed -shared ")
Exemplo n.º 2
0
def setup():
    options = "--prefix=/usr             \
               --sysconfdir=/etc         \
               --enable-x11-backend \
               --enable-broadway-backend \
               --disable-wayland-backend \
              "

    shelltools.export("CFLAGS",
                      get.CFLAGS().replace("-fomit-frame-pointer", ""))

    if get.buildTYPE() == "emul32":
        options += " --libdir=/usr/lib32 \
                     --bindir=/usr/bin32 \
                     --sbindir=/usr/sbin32 \
                     --enable-colord=no \
                   "

        shelltools.export("CC", "%s -m32" % get.CC())
        shelltools.export("CXX", "%s -m32" % get.CC())
        shelltools.export(
            "CFLAGS",
            "%s -m32" % get.CFLAGS().replace("-fomit-frame-pointer", ""))
        shelltools.export("CXXFLAGS", "%s -m32" % get.CFLAGS())
        shelltools.export("LDFLAGS", "%s -m32" % get.LDFLAGS())
        shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")

        inarytools.dosed("configure.ac", "cups-config", "cups-config-32bit")

    autotools.autoreconf("-fiv")
    autotools.configure(options)

    inarytools.dosed("libtool", "( -shared )", r" -Wl,-O1,--as-needed\1")
Exemplo n.º 3
0
def build():
    shelltools.export("ARCH", "")
    autotools.make('EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
                    EXTRA_KLIBCLDFLAGS="-z,noexecstack" \
                    HOSTCC="%s" CC="%s" \
                    KLIBCARCH=%s \
                    KLIBCASMARCH=x86 \
                    libdir=/usr/lib \
                    SHLIBDIR=/lib \
                    mandir=/usr/share/man \
                    INSTALLDIR=/usr/lib/klibc' %
                   (get.CC(), get.CC(), klibcarch))
Exemplo n.º 4
0
def setup():
    # FIXME: shelltools.echo() appends to the end of the file by default so clear them first
    shelltools.unlink('conf-cc')
    shelltools.unlink('conf-ld')
    shelltools.unlink('conf-home')

    shelltools.echo(
        'conf-cc',
        "%s %s -malign-double -fPIC -DPIC" % (get.CC(), get.CFLAGS().replace(
            "-D_FORTIFY_SOURCE=2", "").replace("-fomit-frame-pointer", "")))
    shelltools.echo('conf-ld', "%s %s" % (get.CC(), get.LDFLAGS()))
    shelltools.echo('conf-home', "%s/usr" % get.installDIR())
Exemplo n.º 5
0
def build():
    shelltools.system("sed -i 's|lib64|lib|' config/Makefile.linux")
    shelltools.system("sed -i '/^.PHONY: .*\.pc$/d' Makefile")

    if get.buildTYPE() == "emul32":
        inarytools.dosed("config/Makefile.linux", "LD = cc", "LD = gcc -m32")
        shelltools.system("sed -i 's|lib64|lib32|' config/Makefile.linux")
        autotools.make('CC="%s -m32" CXXFLAGS="%s"' %
                       (get.CC(), get.CXXFLAGS()))
        return
    else:
        autotools.make('CC=%s CXXFLAGS="%s"' % (get.CC(), get.CXXFLAGS()))
        return
Exemplo n.º 6
0
def build():
    shelltools.export("CC", get.CC())

    autotools.make("libdir")
    autotools.make()
    autotools.make("ether-wake")
    autotools.make("i18ndir")
Exemplo n.º 7
0
def setup():
    inarytools.dosed("Configure", " $prefix/$libdir/engines ", " /%{_lib}/engines ")

    options = " --prefix=/usr \
                --libdir=lib \
                --openssldir=/etc/ssl \
                shared -Wa,--noexecstack \
                zlib enable-camellia enable-idea \
                enable-seed enable-rfc3779 enable-rc5 \
                enable-cms enable-md2 enable-mdc2 threads"

    if get.buildTYPE() == "_emul32":
        options += " --prefix=/_emul32 --libdir=lib32".format(get.installDIR())
        shelltools.export("CC", "%s -m32" % get.CC())
        shelltools.export("CXX", "%s -m32" % get.CXX())
        shelltools.system("./Configure linux-elf %s" % options)
        shelltools.export("PKG_CONFIG_PATH","/usr/lib32/pkgconfig")

    elif get.ARCH() == "i686":
         shelltools.system("./Configure linux-elf %s" % options)
         inarytools.dosed("Makefile", "^(SHARED_LDFLAGS=).*", "\\1 ${LDFLAGS}")
         inarytools.dosed("Makefile", "^(CFLAG=.*)", "\\1 ${CFLAGS}")

    else:
        options += " enable-ec_nistp_64_gcc_128"
        shelltools.system("./Configure linux-x86_64 %s" % options)
        inarytools.dosed("Makefile", "^(SHARED_LDFLAGS=).*", "\\1 ${LDFLAGS}")
        inarytools.dosed("Makefile", "^(CFLAG=.*)", "\\1 ${CFLAGS}")
Exemplo n.º 8
0
def build():
    cc_args = "-DHAS_PCRE -DHAS_MYSQL -I/usr/include/mysql -DHAS_PGSQL -I/usr/include/postgresql \
               -DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl -DHAS_LDAP -fPIC"
    cc_libs = "-pie -Wl,-z,relro -Wl,-z,now -L/usr/lib -lpcre -lcrypt -lpthread -lpam -lssl -lcrypto -lsasl2 -lmysqlclient -lpq -lm -lz -lldap -llber"

    # Default paths
    inarytools.dosed("src/global/mail_params.h", \
                    "#define DEF_README_DIR\s+\"no\"", \
                    "#define DEF_README_DIR \"/usr/share/doc/%s/readme\"" % get.srcNAME())

    inarytools.dosed("src/global/mail_params.h", \
                    "#define DEF_HTML_DIR\s+\"no\"", \
                    "#define DEF_HTML_DIR \"/usr/share/doc/%s/html\"" % get.srcNAME())

    inarytools.dosed("src/global/mail_params.h", \
                    "#define DEF_MANPAGE_DIR\s+\"/usr/local/man\"", \
                    "#define DEF_MANPAGE_DIR \"/usr/share/man\"")

    inarytools.dosed("src/util/sys_defs.h", \
                    "#define NATIVE_DAEMON_DIR \"/usr/libexec/postfix\"", \
                    "#define NATIVE_DAEMON_DIR \"/usr/lib/postfix\"")

    autotools.make('CC=%s \
                    OPT="%s" \
                    CCARGS="%s" \
                    AUXLIBS="%s" makefiles' % (get.CC(), get.CFLAGS(), cc_args, cc_libs))

    autotools.make()
Exemplo n.º 9
0
def builddiet():
    autotools.make("clean")
    shelltools.export(
        "CC", "diet %s %s %s %s -DHAVE_STDINT_H -Os -static" %
        (get.CC(), get.CFLAGS(), get.CXXFLAGS(), get.LDFLAGS()))
    autotools.make("mdadm.static")
    autotools.make("mdassemble.static")

    inarytools.insinto("/sbin", "mdadm.static")
    inarytools.insinto("/sbin", "mdassemble.static")
Exemplo n.º 10
0
def install():
    shelltools.export("ARCH", "")
    autotools.rawInstall('EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
                          EXTRA_KLIBCLDFLAGS="-z,noexecstack" \
                          HOSTCC="%s" CC="%s" \
                          KLIBCARCH=%s \
                          KLIBCASMARCH=x86 \
                          libdir=/usr/lib \
                          SHLIBDIR=/lib \
                          mandir=/usr/share/man \
                          INSTALLROOT="%s" \
                          INSTALLDIR=/usr/lib/klibc' %
                         (get.CC(), get.CC(), klibcarch, get.installDIR()))

    asmSrcDir = "linux/arch/x86/include/asm"
    asmTargetDir = "/usr/lib/klibc/include/asm"

    # FIXME: we probably don't need old kernel workarounds anymore
    # just a workaround for installer bug with 2.6.24, will make it sane later
    #inarytools.remove(asmTargetDir)
    #inarytools.dosym("asm-x86", asmTargetDir)

    # yet another new kernel compatibility workaround for 2.6.28 and above
    #for f in shelltools.ls(asmSrcDir):
    #    inarytools.insinto(asmTargetDir, "%s/%s" % (asmSrcDir, f))

    fixperms("%s/usr/lib/klibc/include" % get.installDIR())

    for f in ["gunzip", "zcat"]:
        inarytools.remove("/usr/lib/klibc/bin/%s" % f)
        inarytools.dosym("gzip", "/usr/lib/klibc/bin/%s" % f)

    inarytools.dodoc("README", "usr/klibc/LICENSE", "usr/klibc/CAVEATS")

    for f in docs:
        inarytools.newdoc(f, docs[f])

    inarytools.insinto("/usr/lib/klibc/include/linux", "linux/include/linux/*")
    inarytools.insinto("/usr/lib/klibc/include/asm", "linux/include/asm/*")
    inarytools.insinto("/usr/lib/klibc/include/asm-generic",
                       "linux/include/asm-generic/*")
Exemplo n.º 11
0
def builddiet():
    inarytools.flags.add("-fno-lto")
    shelltools.export("LIBS", "-lpthread -luuid")
    dietCC = "diet %s %s %s -Os -static" % (get.CC(), get.CFLAGS(),
                                            get.LDFLAGS())
    #dietCC = "%s %s %s -Os -static" % (get.CC(), get.CFLAGS(), get.LDFLAGS())
    shelltools.export("CC", dietCC)

    autotools.make("distclean")

    autotools.autoreconf("-fi")
    autotools.configure('--with-thin-check=    \
                         --with-thin-dump=     \
                         --with-thin-repair=   \
                         --with-thin-restore=  \
                         --with-cache-check=   \
                         --with-cache-dump=    \
                         --with-cache-repair=  \
                         --with-cache-restore= \
                         ac_cv_lib_dl_dlopen=no \
                         --with-staticdir="/sbin" \
                         --enable-debug \
                         --with-optimisation=\"%s -Os\" \
                         --enable-static_link \
                         --with-lvm1=internal \
                         --disable-readline \
                         --disable-nls \
                         --disable-selinux \
                         --with-confdir=/etc \
                         --enable-applib     \
                         --enable-cmdlib     \
                         --enable-pkgconfig  \
                         --enable-udev_rules \
                         --with-systemdsystemunitdir=no \
                         --enable-udev_sync' % get.CFLAGS())

    #inarytools.dosed("lib/misc/configure.h","rpl_malloc","malloc")
    #inarytools.dosed("lib/misc/configure.h","rpl_realloc","realloc")

    autotools.make("-j1 -C include")
    autotools.make("-j1 -C lib LIB_SHARED= VERSIONED_SHLIB=")
    autotools.make("-j1 -C libdm LIB_SHARED= VERSIONED_SHLIB=")
    autotools.make("-j1 -C tools install_dmsetup_dynamic")
    autotools.make("-j1 -C udev  install")
    autotools.make("-j1 -C libdaemon LIB_SHARED= VERSIONED_SHLIB=")
    autotools.make(
        "-j1 -C tools dmsetup.static lvm.static DIETLIBC_LIBS=\"-lcompat\"")

    inarytools.insinto("/usr/lib/dietlibc/lib-i386",
                       "libdm/ioctl/libdevmapper.a")
    inarytools.insinto("/sbin/", "tools/lvm.static")
    inarytools.insinto("/sbin/", "tools/dmsetup.static")
Exemplo n.º 12
0
def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    # Simple wrapper for gcc
    host_gcc = "/usr/bin/%s-dietlibc-gcc" % get.HOST()
    shelltools.echo("%s%s" % (get.installDIR(), host_gcc), """\
#!/bin/bash
exec /usr/bin/diet %s "$@"
""" % get.CC())

    shelltools.chmod("%s%s" % (get.installDIR(), host_gcc), 0o755)
    inarytools.dosym(host_gcc, "/usr/bin/dietlibc-gcc")

    inarytools.dodoc("AUTHOR", "BUGS", "CAVEAT", "CHANGES", "FAQ", "README*", "THANKS", "TODO")
Exemplo n.º 13
0
def setup():
    # use system zlib
    shelltools.unlinkDir("cpan/Compress-Raw-Zlib/zlib-src")
    inarytools.dosed("MANIFEST", "zlib-src", deleteLine=True)
    inarytools.dosed("cpan/Compress-Raw-Zlib/config.in", "(BUILD_ZLIB\s+=\s)True", r"\1False")
    inarytools.dosed("cpan/Compress-Raw-Zlib/config.in", "(INCLUDE\s+=\s)\.\/zlib-src", r"\1/usr/include")
    inarytools.dosed("cpan/Compress-Raw-Zlib/config.in", "(LIB\s+=\s)\.\/zlib-src", r"\1/usr/lib")

    shelltools.export("LC_ALL", "C")

    #fix one of tests
    #shelltools.system('sed -i "s#version vutil.c .*#version vutil.c f1c7e4778fcf78c04141f562b80183b91cbbf6c9#" t/porting/customized.dat')

    shelltools.system('sh Configure -des \
                      -Darchname=%s-linux \
                      -Dcccdlflags=-fPIC \
                      -Dusedevel \
                      -Dccdlflags="-rdynamic -Wl,--enable-new-dtags" \
                      -Dcc=%s \
                      -Dprefix=/usr \
                      -Dvendorprefix=/usr \
                      -Dsiteprefix=/usr \
                      -Ulocincpth=  \
                      -Doptimize="%s" \
                      -Duselargefiles \
                      -Dusethreads \
                      -Duseithreads \
                      -Dd_semctl_semun \
                      -Dscriptdir=/usr/bin \
                      -Dman1dir=/usr/share/man/man1 \
                      -Dman3dir=/usr/share/man/man3 \
                      -Dinstallman1dir=%s/usr/share/man/man1 \
                      -Dinstallman3dir=%s/usr/share/man/man3 \
                      -Dlibperl=libperl.so.%s \
                      -Duseshrplib \
                      -Dman1ext=1 \
                      -Dman3ext=3pm \
                      -Dcf_by="Sulin" \
                      -Ud_csh \
                      -Di_ndbm \
                      -Di_gdbm \
                      -Di_db \
                      -Ubincompat5005 \
                      -Uversiononly \
                      -Dpager="/usr/bin/less -isr" \
                      -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto \
                      -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto \
                      -Ud_endservent_r_proto -Ud_setservent_r_proto \
                      -Dlibpth="/lib /usr/lib" \
                      ' %(get.ARCH(), get.CC(), get.CFLAGS(), get.installDIR(), get.installDIR(), get.srcVERSION()))
Exemplo n.º 14
0
def install():
    inarytools.dobin("colorgcc.pl", "/usr/bin/colorgcc")
    inarytools.insinto("/etc", "colorgccrc.txt")
    inarytools.move("%s/etc/colorgccrc.txt" % get.installDIR(),
                    "%s/etc/colorgccrc" % get.installDIR())

    inarytools.dodir("/usr/share/colorgcc")
    inarytools.dosym("../../bin/colorgcc", "/usr/share/colorgcc/colorgcc")

    for c in [
            "gcc", "cc", "g++", "c++", "gfortran", "gcj",
            get.CC(),
            get.CXX()
    ]:
        inarytools.dosym("colorgcc", "/usr/share/colorgcc/%s" % c)
Exemplo n.º 15
0
def setup():
    autotools.autoconf("-f")
    options = "--with-data-packaging=library \
               --disable-samples \
               --disable-silent-rules"

    if get.buildTYPE() == "_emul32":
        options += " --libdir=/usr/lib32 \
                     --bindir=/_emul32/bin \
                     --sbindir=/_emul32/sbin"

        shelltools.export("CC", "%s -m32" % get.CC())
        shelltools.export("CXX", "%s -m32" % get.CXX())
    autotools.configure(options)
    inarytools.dosed("config/mh-linux", "-nodefaultlibs -nostdlib")
Exemplo n.º 16
0
def setup():
    for package in shelltools.ls("."):
        if package.startswith(Skip):
            continue

        shelltools.cd(package)
        if package.startswith("xorg-cf-files"):
            inarytools.dosed("host.def", "_SULIN_CC_", get.CC())
            inarytools.dosed("host.def", "_SULIN_CXX_", get.CXX())
            inarytools.dosed("host.def", "_SULIN_AS_", get.AS())
            inarytools.dosed("host.def", "_SULIN_LD_", get.LD())
            inarytools.dosed("host.def", "_SULIN_CFLAGS_", get.CFLAGS())
            inarytools.dosed("host.def", "_SULIN_LDFLAGS_", get.LDFLAGS())

        autotools.configure("--with-config-dir=/usr/share/X11/config")
        shelltools.cd("../")
Exemplo n.º 17
0
def setup():
    options = "--prefix=/usr \
               --sysconfdir=/etc"

    if get.buildTYPE() == "_emul32":
        options += " --libdir=/usr/lib32 \
                     --bindir=/_emul32/bin \
                     --sbindir=/_emul32/sbin \
                     --disable-dtrace"

        shelltools.export("CC", "%s -m32" % get.CC())
        shelltools.export("CXX", "%s -m32" % get.CXX())
        shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")

    autotools.configure(options)

    inarytools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
Exemplo n.º 18
0
def setup():
    shelltools.export("CC", "{} -std=c11".format(get.CC()))
    inarytools.flags.add("-flto -ffat-lto-objects")
    autotools.autoreconf("-vfi")
    autotools.configure("--disable-static \
                         --enable-xlib \
                         --disable-drm \
                         --enable-xml \
                         --enable-ft \
                         --enable-ps \
                         --enable-pdf \
                         --enable-svg \
                         --enable-tee \
                         --enable-gl \
                         --enable-gobject \
                         --disable-gtk-doc")

    inarytools.dosed("libtool", "^(hardcode_libdir_flag_spec=).*", '\\1""')
    inarytools.dosed("libtool", "^(runpath_var=)LD_RUN_PATH",
                     "\\1DIE_RPATH_DIE")
    inarytools.dosed("libtool", " -shared ", " -Wl,--as-needed -shared ")
Exemplo n.º 19
0
def setup():
    autotools.autoreconf("-ivf")

    if get.buildTYPE() == "emul32":
        shelltools.export("CC", "{} -std=c11".format(get.CC()))
        options = "--with-glib=yes \
                    --with-graphite2=no \
                    --with-cairo=yes \
                    --with-icu=yes"

    else:
        options = "--with-glib=yes \
                   --with-freetype=yes \
                   --with-cairo=yes \
                   --with-icu=yes \
                   --with-gobject=yes \
                   --with-graphite2=yes"

    autotools.configure(options)

    inarytools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
Exemplo n.º 20
0
def setup():
    inarytools.flags.add("-U_FORTIFY_SOURCE")
    autotools.autoreconf("-vfi")

    options = "--enable-shared \
               --disable-static \
              "

    if get.buildTYPE() == "emul32":
        shelltools.export("CC", "%s -m32" % get.CC())
        shelltools.export("CXX", "%s -m32" % get.CXX())
        shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig")

        options += "--build=i686-pc-linux-gnu \
                    --host=i686-pc-linux-gnu \
                    --prefix=/emul32 \
                    --libdir=/usr/lib32 \
                    --disable-documentation \
                   "

    autotools.configure(options)

    inarytools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
Exemplo n.º 21
0
def build():
    autotools.make("CC=%s CFLAGS='%s -fPIC' LDFLAGS='%s'" %
                   (get.CC(), get.CFLAGS(), get.LDFLAGS()))
Exemplo n.º 22
0
def compile(parameters=''):
    if system('{0} {1} {2}'.format(get.CC(), get.CFLAGS(), parameters)):
        raise CompileError(_('Compiling failed.'))
Exemplo n.º 23
0
def build():
    autotools.make('CC="%s" CFLAGS="%s -fpie" LINK="-pie -lssl" LDFLAGS="%s"' %
                   (get.CC(), get.CFLAGS(), get.LDFLAGS()))
Exemplo n.º 24
0
from inary.actionsapi import shelltools
from inary.actionsapi import autotools
from inary.actionsapi import inarytools
from inary.actionsapi import get

WorkDir = "%s-%s" % (get.srcNAME(), get.srcVERSION())
WITHSSP = False
XTRA_FIXCFLAGS = "" if WITHSSP else "-fno-stack-protector"
CFLAGS = "%s %s %s" % (get.CFLAGS(),
                       "-fomit-frame-pointer -fno-exceptions -fno-asynchronous-unwind-tables -Os -g3 -Werror-implicit-function-declaration -Wno-unused -Wno-switch",
                       XTRA_FIXCFLAGS)
MAKE_FLAGS = "CC=\"%s\" \
              CFLAGS=\"%s\" \
              PDIET=/usr/lib/dietlibc \
              STRIP=:" % (get.CC(), CFLAGS)

MAKE_TEST_FLAGS = "CC=\"%s\" \
                   CFLAGS=\"%s -fno-builtin\" \
                   PDIET=/usr/lib/dietlibc \
                   STRIP=:" % (get.CC(), CFLAGS)

def setup():
    shelltools.cd(get.workDIR())
    for f, l in [("dietlibc-github-c3f1cf67fcc186bb859e64a085bf98aaa6182a82.patch", 1)]:
        shelltools.move(f, WorkDir)
        shelltools.cd(WorkDir)
        shelltools.system("patch --remove-empty-files --no-backup-if-mismatch -p%d -i %s" % (l, f))
        shelltools.cd("..")

    shelltools.cd(WorkDir)
Exemplo n.º 25
0
def build():
    autotools.make('CC="%s" CFLAGS="%s"' % (get.CC(), get.CFLAGS()))
Exemplo n.º 26
0
def setup():
    multilib = " -m32" if get.buildTYPE() == "emul32" else ""
    inarytools.dosed("Makefile", "sulinCC", "%s %s" % (get.CC(), multilib))
    inarytools.dosed("Makefile", "sulinCFLAGS", "%s %s" % (get.CFLAGS(), multilib))
Exemplo n.º 27
0
def build():
    shelltools.export("CC", "{} -std=c11".format(
        get.CC()))  # glib2 based sources are just compiling with c11 standart

    autotools.make()
Exemplo n.º 28
0
def build():
    autotools.make("-f unix/Makefile CC=%s CPP=%s generic_gcc" % (get.CC(), get.CXX()))
Exemplo n.º 29
0
def build():
    autotools.make(
        "CC='%s %s' CFLAGS='%s'" %
        (get.CC(), "-m32 " if get.buildTYPE() == "emul32" else "-m64",
         get.CFLAGS()))
Exemplo n.º 30
0
def build():
    inarytools.dosed("Makefile", "^CC = .*$", "CC = %s" % get.CC())
    autotools.make("all")