def configure(parameters=''): """configure source with given parameters = "--with-nls --with-libusb --with-something-usefull""" if can_access_file('configure'): gnuconfig_update() prefix = get.emul32prefixDIR() if get.buildTYPE( ) == "emul32" else get.defaultprefixDIR() args = './configure \ --prefix=/{0} \ --build={1} \ --mandir=/{2} \ --infodir=/{3} \ --datadir=/{4} \ --sysconfdir=/{5} \ --localstatedir=/{6} \ --libexecdir=/{7} \ {8}{9}'.format( prefix, get.HOST(), get.manDIR(), get.infoDIR(), get.dataDIR(), get.confDIR(), get.localstateDIR(), get.libexecDIR(), "--libdir=/usr/lib32 " if get.buildTYPE() == "emul32" else "", parameters) if system(args): raise ConfigureError(_('Configure failed.')) else: raise ConfigureError( _('No configure script found. (\"{}\" file not found.)'.format( "configure")))
def configure(parameters='', installPrefix='/{}'.format(get.defaultprefixDIR()), sourceDir='.'): """configure source with given cmake parameters = "-DCMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS ... " """ if can_access_file(join_path(sourceDir, 'CMakeLists.txt')): args = 'cmake -DCMAKE_INSTALL_PREFIX={0} \ -DCMAKE_INSTALL_LIBDIR={1} \ -DCMAKE_BUILD_TYPE=RelWithDebInfo {2} {3}'.format( installPrefix, "/usr/lib32 " if get.buildTYPE() == "emul32" else "/usr/lib", parameters, sourceDir) if get.CFLAGS(): args += ' -DCMAKE_C_FLAGS="{0} {1}"'.format( get.CFLAGS(), "-m32" if get.buildTYPE() == "emul32" else "-m64") if get.CXXFLAGS(): args += ' -DCMAKE_CXX_FLAGS="{0} {1}"'.format( get.CXXFLAGS(), "-m32" if get.buildTYPE() == "emul32" else "-m64") if get.LDFLAGS(): args += ' -DCMAKE_LD_FLAGS="{0}"'.format(get.LDFLAGS()) if system(args): raise ConfigureError(_('Configure failed.')) else: raise ConfigureError( _('No configure script found. (\"{}\" file not found.)'.format( "CMakeLists.txt")))
def install(): shelltools.cd("build") autotools.rawInstall("install_root=%s" % get.installDIR()) inarytools.dodir("/etc/ld.so.conf.d") if get.buildTYPE() != "emul32": #Install locales once. autotools.rawInstall("install_root=%s localedata/install-locales" % get.installDIR()) if get.buildTYPE() == "emul32": inarytools.dosym("/lib32/ld-linux.so.2", "/lib/ld-linux.so.2") shelltools.echo( "%s/etc/ld.so.conf.d/60-glibc-32bit.conf" % get.installDIR(), ldconf32bit) inarytools.removeDir("/tmp32") # We'll take care of the cache ourselves if shelltools.isFile("%s/etc/ld.so.cache" % get.installDIR()): inarytools.remove("/etc/ld.so.cache") # Prevent overwriting of the /etc/localtime symlink if shelltools.isFile("%s/etc/localtime" % get.installDIR()): inarytools.remove("/etc/localtime") # Nscd needs this to work inarytools.dodir("/var/run/nscd") inarytools.dodir("/var/db/nscd") # remove zoneinfo files since they are coming from timezone packages # we disable timezone build with a patch, keeping these lines for easier maintenance if shelltools.isDirectory("%s/usr/share/zoneinfo" % get.installDIR()): inarytools.removeDir("/usr/share/zoneinfo") #while bootstrapping whole system zic should not be removed. timezone package does not build without it. # 2013 #for i in ["zdump","zic"]: #if shelltools.isFile("%s/usr/sbin/%s" % (get.installDIR(), i)): #inarytools.remove("/usr/sbin/%s" % i) shelltools.cd("..") #remove unused locale for l in ["ku", "hy"]: shelltools.system("rm -rf {}/usr/lib/locale/{}_*".format( get.installDIR(), l)) shelltools.system("rm -rf {}/usr/share/locale/{}*".format( get.installDIR(), l)) shelltools.system("rm -rf {}/usr/share/i18n/locales/{}_*".format( get.installDIR(), l)) #clean if shelltools.isFile("%s/usr/lib/locale/locale-archive" % get.installDIR()): inarytools.remove("/usr/lib/locale/locale-archive") inarytools.dodoc("NEWS", "README*", "LICENSES")
def build(): rustdir = get.pkgDIR() + "/rust-root/" options = "CARGO_HOME={0} RUSTUP_HOME={0} bash ./rustup-init.sh -y --no-modify-path -v".format( rustdir if get.buildTYPE() != "emul32" else rustdir + "/emul32") if get.buildTYPE() == "emul32": options += " --profile minimal --default-host=i686-unknown-linux-gnu" else: options += " --profile complete --default-host=x86_64-unknown-linux-gnu" shelltools.system(options)
def build(): inarytools.dosed("src/Makefile", "=-shared", r"= -Wl,-O1,--as-needed -shared") if get.buildTYPE() == "emul32": inarytools.dosed(".", "\/lib$", r"/lib%s\n" % "32" if get.buildTYPE() == "emul32" else "", filePattern="Makefile") autotools.make()
def setup(): #shelltools.sym("/bin/true", "%s/py-compile" % get.curDIR()) if get.buildTYPE() == "emul32": shelltools.system( "sed -i 's|use_python=auto|use_python=no|' configure.ac") shelltools.system( "sed -i 's|use_python3=auto|use_python3=no|' configure.ac") autotools.autoreconf("-fi") autotools.configure("--disable-static \ --with{}-python".format("out" if get.buildTYPE() == "emul32" else ""))
def setup(): if get.buildTYPE() == "emul32": inarytools.dosed("pango/modules.c", "(pango\.modules)", r"\1-32") # autotools.autoreconf("-fiv") autotools.configure("--disable-static \ --sysconfdir=/etc \ --disable-gtk-doc \ --%sable-introspection" % ("dis" if get.buildTYPE() == "emul32" else "en")) inarytools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
def setup(): if get.buildTYPE() == "emul32": shelltools.system( "./bootstrap.sh --with-toolset=gcc --with-icu --prefix=%s/emul32/usr" % get.installDIR()) elif get.buildTYPE() == "rebuild_python": shelltools.system( "./bootstrap.sh --with-toolset=gcc --with-icu --with-python=python3 --prefix=%s/usr" % get.installDIR()) else: shelltools.system( "./bootstrap.sh --with-toolset=gcc --with-icu --with-python=python2 --prefix=%s/usr" % get.installDIR())
def setup(): platform = "pc" if get.buildTYPE() == "efi": platform = "efi" elif get.buildTYPE() == "efi32": platform = "efi --target=i386" shelltools.system( 'CFLAGS="" CXXFLAGS="" LDFLAGS="" ./configure --prefix=/usr \ --sbindir=/sbin \ --sysconfdir=/etc \ --disable-efiemu \ --disable-nls \ --with-platform=' + platform + ' \ --disable-werror')
def setup(): if get.buildTYPE()=="emul32": shelltools.export("CC","clang -m32") shelltools.export("CXX","clang -m32") else: shelltools.export("CC","clang") shelltools.export("CXX","clang") autotools.autoreconf("-vif") autotools.configure("PYTHON=/usr/bin/python3 \ --with-libcap-ng=yes \ --enable-gssapi-krb5=no \ --enable-systemd=no \ --with-python={0} \ --disable-static".format("no --with-python3=no" if get.buildTYPE()=="emul32" else "yes"))
def install(): if get.buildTYPE() == "rebuild_python": autotools.rawInstall("DESTDIR='%s/python2'" % get.installDIR()) shelltools.move("%s/python2/usr/lib/python2.7" % get.installDIR(), "%s/usr/lib/" % get.installDIR()) shelltools.unlinkDir("%s/python2" % get.installDIR()) return autotools.rawInstall("DESTDIR=%s" % get.installDIR()) if get.buildTYPE() == "emul32" or "i686": inarytools.removeDir("/usr/share/gtk-doc") return inarytools.dodoc("AUTHORS", "ChangeLog", "NEWS", "README", "TODO")
def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) if get.buildTYPE() == "emul32": return inarytools.dodoc("COPYING", "TODO", "README")
def install(): if get.buildTYPE() == "emul32": autotools.rawInstall("DESTDIR={}".format(get.installDIR())) return autotools.install() inarytools.dodoc("AUTHORS", "ChangeLog", "NEWS", "README")
def setup(): inarytools.flags.add("-fPIC") inarytools.dosed("makeinclude.in", "^(docdir.*)$", r"\1/html") autotools.autoconf() options = "\ --enable-gl \ --enable-shared \ --enable-threads \ " if get.buildTYPE() == "emul32": shelltools.export("CFLAGS", "-m32") shelltools.export("CXXFLAGS", "-m32") options += "--prefix=/emul32 \ --libdir=/usr/lib32 \ --with-optim='%s' \ " % get.CFLAGS() elif get.ARCH() == "x86_64": options += "--with-optim='%s' \ " % get.CFLAGS() autotools.configure(options)
def install(): mesontools.ninja_install() if get.buildTYPE() == "emul32": inarytools.domove("/usr/*.so*", "/usr/lib32/") inarytools.domove("/usr/gstreamer-1.0", "/usr/lib32/") inarytools.domove("/usr/girepository-1.0", "/usr/lib32/") inarytools.domove("/usr/pkgconfig", "/usr/lib32/")
def setup(): options = "--enable-cxx" if get.buildTYPE() == "emul32": shelltools.export("ABI", "32") autotools.configure(options)
def build(): if get.buildTYPE() == "emul32": shelltools.export("CC", "gcc -m32 -mstackrealign -mfpmath=sse") shelltools.export("CXX", "g++ -m32 -mstackrealign -mfpmath=sse") shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig") mesontools.ninja_build()
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")
def setup(): options = "--disable-static" if not get.buildTYPE() == "emul32": options += " --libdir=/usr/lib" autotools.configure(options)
def setup(): shelltools.export("LANGUAGE", "C") shelltools.export("LANG", "C") shelltools.export("LC_ALL", "C") shelltools.export("CC", "gcc %s " % defaultflags) shelltools.export("CXX", "g++ %s " % defaultflags) shelltools.export("CFLAGS", defaultflags) shelltools.export("CXXFLAGS", defaultflags) shelltools.makedirs("build") shelltools.cd("build") options = "--prefix=/usr \ --libdir=/usr/lib \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --libexecdir=/usr/lib/misc \ --with-bugurl=http://gitlab.com/sulinos/main/issues \ --enable-add-ons \ --enable-kernel=3.2.0 \ --enable-static-pie \ --enable-bind-now --disable-profile \ --enable-stackguard-randomization \ --enable-lock-elision \ --enable-multi-arch \ --disable-werror" if get.buildTYPE() == "emul32": options += "\ --libdir=/usr/lib32 \ --enable-multi-arch i686-pc-linux-gnu \ " shelltools.system("../configure %s" % options)
def install(): if get.buildTYPE()=="emul32": autotools.rawInstall("PREFIX=%s/emul32/usr" % get.installDIR()) inarytools.dolib("libbz2.so.%s" % libversion, "/lib32") inarytools.dosym("libbz2.so.%s" % libversion, "/lib32/libbz2.so") inarytools.dosym("libbz2.so.%s" % libversion, "/lib32/libbz2.so.1") inarytools.dosym("libbz2.so.%s" % libversion, "/lib32/libbz2.so.1.0") return autotools.rawInstall("PREFIX=%s/usr" % get.installDIR()) # No static libs inarytools.removeDir("/usr/lib") inarytools.domove("/usr/bin/", "/") inarytools.domove("/usr/man", "/usr/share") for link in ("/bin/bunzip2", "/bin/bzcat"): inarytools.remove(link) inarytools.dosym("bzip2", link) for wrong_link in ("/bin/bzcmp", "/bin/bzegrep", "/bin/bzfgrep", "/bin/bzless"): inarytools.remove(wrong_link) inarytools.dosym("bzgrep", "/bin/bzegrep") inarytools.dosym("bzgrep", "/bin/bzfgrep") inarytools.dosym("bzdiff", "/bin/bzcmp") inarytools.dosym("bzmore", "/bin/bzless") inarytools.dolib("libbz2.so.%s" % libversion, "/lib") inarytools.dosym("libbz2.so.%s" % libversion, "/lib/libbz2.so") inarytools.dosym("libbz2.so.%s" % libversion, "/lib/libbz2.so.1") inarytools.dosym("libbz2.so.%s" % libversion, "/lib/libbz2.so.1.0") inarytools.dohtml("manual.html") inarytools.dodoc("README", "CHANGES", "bzip2.txt")
def check(): shelltools.cd("build") if get.buildTYPE() != "emul32": autotools.make("check || true") else: pass
def setup(): #inarytools.dosed("configure.ac", '(AS_AC_EXPAND\(EXPANDED_LOCALSTATEDIR, )"\$localstatedir"\)', r'\1 "")') #for f in ["bus/Makefile.am", "bus/Makefile.in"]: # inarytools.dosed(f, "\$\(localstatedir\)(\/run\/dbus)", "\\1") options = "PYTHON=/usr/bin/python3 \ --disable-xml-docs\ --disable-selinux \ --enable-verbose-mode \ --libexecdir=/usr/lib/dbus-1.0 \ --with-dbus-user=dbus \ --with-system-pid-file=/run/dbus/pid \ --with-system-socket=/run/dbus/system_bus_socket \ --with-console-auth-dir=/run/console/ \ --enable-inotify \ --enable-elogind \ --disable-static \ --disable-asserts \ --without-systemdsystemunitdir \ --disable-systemd \ --disable-user-session \ --enable-x11-autolaunch" if get.buildTYPE() == "emul32": os.environ.clear() os.environ.update(env) shelltools.export("CC", "gcc -m32 -mstackrealign") shelltools.export("CXX", "g++ -m32 -mstackrealign") shelltools.export("HOST", "x86_64") shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig") options += "\ --libdir=/usr/lib32 \ --disable-doxygen-docs" autotools.autogen() autotools.configure(options)
def setup(): options = "--disable-dependency-tracking \ --disable-static \ --enable-gif \ --enable-jpg \ --enable-tif \ --enable-png \ --enable-pnm \ --enable-bmp \ --enable-xcf \ --enable-xpm \ --enable-tga \ --enable-lbm \ --enable-pcx \ --disable-jpg-shared \ --disable-png-shared \ --disable-tif-shared" if get.buildTYPE() == "emul32": options += " --includedir=/usr/include \ --libdir=/usr/lib32" shelltools.export("PKG_CONFIG_PATH", "/usr/lib32/pkgconfig") shelltools.export("CFLAGS", "%s -m32" % get.CFLAGS()) shelltools.export("CXXFLAGS", "%s -m32" % get.CXXFLAGS()) shelltools.export("LDFLAGS", "%s -m32" % get.LDFLAGS()) for i in ["NEWS", "AUTHORS", "ChangeLog"]: shelltools.touch(i) #autotools.autoreconf("-vfi") autotools.configure(options)
def install(): autotools.rawInstall('-j1 DESTDIR="%s"' % get.installDIR()) if get.buildTYPE() == "_emul32": inarytools.domove("/_emul32/bin/icu-config", "/usr/bin", "icu-config-32") inarytools.removeDir("/_emul32") for f in shelltools.ls("%s/usr/lib32/pkgconfig" % get.installDIR()): inarytools.dosed( "%s/usr/lib32/pkgconfig/%s" % (get.installDIR(), f), "_emul32", "usr") for i in [ "libicudata.so", "libicui18n.so", "libicuio.so", "libicutest.so", "libicutu.so", "libicuuc.so" ]: inarytools.remove("/usr/lib32/" + i) inarytools.removeDir("/usr/lib32/icu") inarytools.removeDir("/usr/lib32/pkgconfig") return inarytools.dohtml("../*.html") inarytools.removeDir("/usr/bin") inarytools.removeDir("/usr/sbin") inarytools.removeDir("/usr/share") inarytools.removeDir("/usr/include") inarytools.removeDir("/usr/lib/icu") inarytools.removeDir("/usr/lib/pkgconfig") for i in [ "libicudata.so", "libicui18n.so", "libicuio.so", "libicutest.so", "libicutu.so", "libicuuc.so" ]: inarytools.remove("/usr/lib/" + i)
def build(): if get.buildTYPE() != "emul32": shelltools.export("RUST_TARGET", "x86_64-unknown-linux-gnu") else: shelltools.export("RUST_TARGET", "i686-unknown-linux-gnu") autotools.make()
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}")
def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) autotools.rawInstall("DESTDIR=%s" % get.installDIR(), "soinstall") if not get.buildTYPE() == "emul32": autotools.rawInstall("-C ijs DESTDIR=%s" % get.installDIR()) inarytools.dohtml("doc/*")
def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) if get.buildTYPE() == "emul32": return inarytools.dodoc("AUTHORS", "COPYING*", "ChangeLog", "NEWS", "README", "THANKS")
def install(): autotools.rawInstall("-j1 DESTDIR=%s%s" % (get.installDIR(), suffix)) #autotools.rawInstall("DESTDIR=%s" % get.installDIR()) # emul32 stop here if get.buildTYPE() == "emul32": shelltools.move("%s%s/lib32" % (get.installDIR(), suffix), "%s/lib32" % (get.installDIR())) shelltools.move("%s%s/usr/lib32" % (get.installDIR(), suffix), "%s/usr/lib32" % (get.installDIR())) for f in shelltools.ls("%s/usr/lib32/pkgconfig" % get.installDIR()): inarytools.dosed( "%s/usr/lib32/pkgconfig/%s" % (get.installDIR(), f), "emul32", "usr") return #add link inarytools.dosym("/sbin/udevadm", "/bin/udevadm") # Create vol_id and scsi_id symlinks in /sbin probably needed by multipath-tools inarytools.dosym("/lib/udev/scsi_id", "/sbin/scsi_id") # Create /sbin/systemd-udevd -> /sbin/udevd sysmlink, we need it for MUDUR, do not touch this sysmlink. # inarytools.dosym("/lib/systemd/systemd-udevd", "/sbin/systemd-udevd") # Create /etc/udev/rules.d for backward compatibility inarytools.dodir("/etc/udev/rules.d") inarytools.dodir("/run/udev") # Add man files inarytools.doman("man/*.5", "man/*.7", "man/*.8") inarytools.dodoc("README*", "NOTES")