def addLanguageDef(parameter): """Create language.*.def files""" parameter = parameter.split() para_dict = {} for option in parameter: pair = option.split("=") if len( pair ) == 2: # That's just a caution, the pair should have two items, not more not less para_dict[pair[0]] = pair[1] if "lefthyphenmin" in para_dict and not para_dict["lefthyphenmin"]: para_dict["lefthyphenmin"] = "2" if "righthyphenmin" in para_dict and not para_dict["righthyphenmin"]: para_dict["righthyphenmin"] = "3" language_def = open( '{0}/language.{1}.def'.format(get.curDIR(), get.srcNAME()), 'a') language_def.write( "\\addlanguage{%s}{%s}{}{%s}{%s}\n" % (para_dict["name"], para_dict["file"], para_dict["lefthyphenmin"], para_dict["righthyphenmin"])) language_def.close() if "synonyms" in para_dict: language_def = open( '{0}/language.{1}.def'.format(get.curDIR(), get.srcNAME()), 'a') language_def.write( "\\addlanguage{%s}{%s}{}{%s}{%s}\n" % (para_dict["synonyms"], para_dict["file"], para_dict["lefthyphenmin"], para_dict["righthyphenmin"])) language_def.close()
def install(): shelltools.system("make -C unix DESTDIR=%s install" % get.installDIR()) # Collect private headers, 3rd party apps like Tile depends on this inarytools.dodir("/usr/include/tk-private/generic") inarytools.dodir("/usr/include/tk-private/unix") shelltools.copy("unix/*.h", "%s/usr/include/tk-private/unix" % get.installDIR()) shelltools.copy("generic/*.h", "%s/usr/include/tk-private/generic" % get.installDIR()) # Remove duplicated headers inarytools.remove("/usr/include/tk-private/generic/tk.h") inarytools.remove("/usr/include/tk-private/generic/tkDecls.h") inarytools.remove("/usr/include/tk-private/generic/tkPlatDecls.h") # Remove tmp path from tclConfig.sh inarytools.dosed("%s/usr/lib/tkConfig.sh" % get.installDIR(), "%s/unix" % get.curDIR(), "/usr/lib/") inarytools.dosed("%s/usr/lib/tkConfig.sh" % get.installDIR(), get.curDIR(), "/usr/include/tk-private") inarytools.dosym("wish8.6", "/usr/bin/wish") inarytools.dodoc("ChangeLog", "changes", "license.terms", "README.md")
def installDocFiles(): """Installing docs""" if "documentation" in get.srcNAME(): if os.path.isdir("{}/texmf-doc".format(get.curDIR())): copytree("texmf-doc", "{}/usr/share/texmf-doc".format(get.installDIR())) else: for removedir in ["texmf", "texmf-dist"]: if os.path.isdir("{0}/{1}/doc/".format(get.curDIR(), removedir)): shutil.rmtree("{0}/{1}/doc".format(get.curDIR(), removedir))
def setup(): shelltools.unlink("py-compile" ) shelltools.sym("/bin/true", "%s/py-compile" % get.curDIR()) autotools.configure("PYTHON=/usr/bin/python2 \ --prefix=/usr \ --enable-thread \ --enable-numpy") shelltools.touch("%s/style.css" % get.curDIR()) inarytools.dosed("docs/Makefile", "CSS_FILES = .*", "CSS_FILES = %s/style.css" % get.curDIR()) inarytools.dosed("libtool"," -shared ", " -Wl,--as-needed -shared ")
def buildFormatFiles(): """Build format files""" if os.path.isdir("{}/texmf/fmtutil/".format(get.curDIR())): for formatfile in ls("{}/texmf/fmtutil/format*.cnf".format( get.curDIR())): makedirs("{}/texmf-var/web2c/".format(get.curDIR())) ctx.ui.info(_('Building format file {}').format(formatfile)) export( "TEXMFHOME", "{0}/texmf:/{0}texmf-dist:{0}/texmf-var".format(get.curDIR())) export("VARTEXFONTS", "fonts") system( "env -u TEXINPUTS fmtutil --cnffile {} --fmtdir texmf-var/web2c --all" .format(formatfile))
def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) inarytools.remove("/usr/bin/perl") # Conflicts with perl-Module-Build # inarytools.remove("/usr/bin/config_data") inarytools.dosym("/usr/bin/perl%s" % get.srcVERSION(), "/usr/bin/perl") # Perl5 library # NEEDS MODIFICATION FOR NEW VERSION inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so") inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5") inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5.26") inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5.26.1") # Docs inarytools.dodir("/usr/share/doc/%s/html" % get.srcNAME()) shelltools.system('LD_LIBRARY_PATH=%s ./perl installhtml \ --podroot="." \ --podpath="lib:ext:pod:vms" \ --recurse \ --htmldir="%s/usr/share/doc/%s/html"' % (get.curDIR(), get.installDIR(), get.srcNAME())) perlmodules.removePodfiles() perlmodules.removePacklist() inarytools.dodoc("Changes*", "Artistic", "Copying", "README", "AUTHORS")
def install(): kerneltools.install() # add objtool for external module building and enabled VALIDATION_STACK option inarytools.insinto( "/usr/src/linux-headers-%s-sulinos/tools/objtool" % get.srcVERSION(), "%s/tools/objtool/objtool" % get.curDIR()) # Install kernel headers needed for out-of-tree module compilation kerneltools.installHeaders() kerneltools.installLibcHeaders() # Generate some module lists to use within mkinitramfs shelltools.system("./generate-module-list %s/lib/modules/%s" % (get.installDIR(), kerneltools.__getSuffix())) #mkinitcpio default config inarytools.dodir("/etc/mkinitcpio.d") shelltools.touch("linux.preset") shelltools.echo( "linux.preset", "# mkinitcpio preset file for the 'linux' package\n" + 'ALL_config="/etc/mkinitcpio.conf"\n' + 'ALL_kver="/boot/kernel-%s"\n\n' % get.srcVERSION() + "PRESETS=('default' 'fallback') \n\n" + '#default_config="/etc/mkinitcpio.conf"\n' + 'default_image="/boot/initramfs-%s.img"\n' % get.srcVERSION() + '#default_options=""\n\n' + '#fallback_config="/etc/mkinitcpio.conf"\n' + 'fallback_image="/boot/initramfs-%s-fallback.img"\n' % get.srcVERSION() + 'fallback_options="-S autodetect"\n') inarytools.insinto("/etc/mkinitcpio.d", "linux.preset")
def installTexmfFiles(): """Installing texmf, texmf-dist, tlpkg, texmf-var""" for installdoc in ["texmf", "texmf-dist", "tlpkg", "texmf-var"]: if os.path.isdir("{0}/{1}".format(get.curDIR(), installdoc)): if not installdoc == "texmf-var": shutil.copytree( installdoc, "{0}/usr/share/{1}".format(get.installDIR(), installdoc)) else: copytree(installdoc, "{}/var/lib/texmf".format(get.installDIR()))
def install(): shelltools.cd("unix") if get.buildTYPE() == "emul32": autotools.rawInstall("DESTDIR=%s" % get.installDIR()) return autotools.rawInstall("DESTDIR=%s" % get.installDIR()) # Collect private headers, 3rd party apps like Tile depends on this shelltools.cd("..") inarytools.dodir("/usr/include/tcl-private/generic") inarytools.dodir("/usr/include/tcl-private/unix") shelltools.copy("unix/*.h", "%s/usr/include/tcl-private/unix" % get.installDIR()) shelltools.copy("generic/*.h", "%s/usr/include/tcl-private/generic" % get.installDIR()) # Remove duplicated headers inarytools.remove("/usr/include/tcl-private/generic/tcl.h") inarytools.remove("/usr/include/tcl-private/generic/tclDecls.h") inarytools.remove("/usr/include/tcl-private/generic/tclPlatDecls.h") # Expect package needs these symlinks inarytools.dosym("../unix/tclUnixPort.h", "/usr/include/tcl-private/generic/tclUnixPort.h") inarytools.dosym("../unix/tclUnixThrd.h", "/usr/include/tcl-private/generic/tclUnixThrd.h") # Remove tmp path from tclConfig.sh inarytools.dosed("%s/usr/lib/tclConfig.sh" % get.installDIR(), "%s/unix" % get.curDIR(), "/usr/lib/") inarytools.dosed("%s/usr/lib/tclConfig.sh" % get.installDIR(), "%s" % get.curDIR(), "/usr/include/tcl-private") # Some apps need compat headers inarytools.dodir("/usr/include/tcl-private/compat") shelltools.copy("compat/*.h", "%s/usr/include/tcl-private/compat" % get.installDIR()) inarytools.dosym("tclsh8.6", "/usr/bin/tclsh") inarytools.dodoc("ChangeLog", "changes", "license.terms", "README.md")
def addLanguageDat(parameter): """Create language.*.dat files""" parameter = parameter.split() para_dict = {} for option in parameter: pair = option.split("=") if len( pair ) == 2: # That's just a caution, the pair should have two items, not more not less para_dict[pair[0]] = pair[1] language_dat = open( '{0}/language.{1}.dat'.format(get.curDIR(), get.srcNAME()), 'a') language_dat.write('{0[name]}\t{0[file]}\n"'.format(para_dict)) language_dat.close() if "synonyms" in para_dict: language_dat = open( '{0}/language.{1}.dat'.format(get.curDIR(), get.srcNAME()), 'a') language_dat.write("={}\n".format(para_dict["synonyms"])) language_dat.close()
def addFormat(parameters): """Add format files""" if not os.path.isdir("{}/texmf/fmtutil/".format(get.curDIR())): makedirs("{}/texmf/fmtutil/".format(get.curDIR())) if not os.path.isfile("{0}/texmf/fmtutil/format.{1}.cnf".format( get.curDIR(), get.srcNAME())): cnf_file = open( "{0}/texmf/fmtutil/format.{1}.cnf".format(get.curDIR(), get.srcNAME()), "w") cnf_file.write( "# Generated for {} by actionsapi/texlivemodules.py\n".format( get.srcNAME())) cnf_file.close() # TODO: Use regex for code simplification parameters = " ".join( parameters.split()) # Removing white-space characters parameters = shlex.split( parameters) # Split parameters until the value "option" para_dict = {} for option in parameters: pair = option.strip() # Remove whitespaces before "options" value pair = pair.split( "=", 1 ) # The value "options" may have multiple "=", thus split just one time if len(pair) == 2: # The list may contain values that are not pair para_dict[pair[0]] = pair[1] if pair[0] == "patterns" and pair[1] == '': para_dict[ "patterns"] = '-' # Specified in the texlive-module.eclass elif not pair[0] == 'patterns': para_dict["patterns"] = '-' cnf_file = open( '{0}/texmf/fmtutil/format.{1}.cnf'.format(get.curDIR(), get.srcNAME()), 'a') cnf_file.write( '{0[name]}\t{0[engine]}\t{0[patterns]}\t{0[options]}\n'.format( para_dict)) cnf_file.close()
def generateConfigFiles(): """Generate config files""" for tlpobjfile in ls("{}/tlpkg/tlpobj/*".format(get.curDIR())): jobsfile = open(tlpobjfile) for line in jobsfile.readlines(): splitline = line.split(" ", 2) if splitline[0] == "execute": command = splitline[1] parameter = splitline[2].strip() if command == "addMap": echo("{0}/{1}.cfg".format(get.curDIR, get.srcNAME()), "Map {}".format(parameter)) ctx.ui.info( _('Map {0} is added to {1}/{2}.cfg').format( parameter, get.curDIR(), get.srcNAME())) elif command == "addMixedMap": echo("{0}/{1}.cfg".format(get.curDIR(), get.srcNAME()), "MixedMap {}".format(parameter)) ctx.ui.info( _('MixedMap {0} is added to {1}/{2}.cfg').format( parameter, get.curDIR(), get.srcNAME())) elif command == "addDvipsMap": echo( "{0}/{1}-config.ps".format(get.curDIR(), get.srcNAME()), "p +{}".format(parameter)) ctx.ui.info( _('p +{0} is added to {1}/{2}-config.ps').format( parameter, get.curDIR(), get.srcNAME())) elif command == "addDvipdfmMap": echo("{0}/{1}-config".format(get.curDIR(), get.srcNAME()), "f {}".format(parameter)) ctx.ui.info( _('f {0} is added to {1}/{2}-config').format( parameter, get.curDIR(), get.srcNAME())) elif command == "AddHyphen": addLanguageDat(parameter) addLanguageDef(parameter) elif command == "AddFormat": addFormat(parameter) elif command == "BuildFormat": ctx.ui.info( _('Language file {} already generated.').format( parameter)) elif command == "BuildLanguageDat": ctx.ui.info( _('No rule to proccess {}. Please file a bug.').format( command)) jobsfile.close()
def setup(): autotools.configure("PYTHON=/usr/bin/python3 \ --enable-gpl \ --enable-gpl3 \ --enable-gtk2 \ --enable-gtk3 \ --qt-libdir=/usr/lib/ \ --qt-includedir=/usr/include/qt5 \ --avformat-swscale") # Enable bindings shelltools.echo("%s/src/swig/config.mak" % get.curDIR(), "SUBDIRS = perl python")
def installConfigFiles(): """Installing config files""" if can_access_file("{0}/{1}.cfg".format(get.curDIR(), get.srcNAME())): insinto("/etc/texmf/updmap.d", "{0}/{1}.cfg".format(get.curDIR(), get.srcNAME())) if can_access_file("{0}/{1}.config.ps".format(get.curDIR(), get.srcNAME())): insinto("/etc/texmf/dvips.d", "{0}/{1}.config.ps".format(get.curDIR(), get.srcNAME())) if can_access_file("{0}/{1}.config".format(get.curDIR(), get.srcNAME())): insinto("/etc/texmf/dvipdfm/config", "{0}/{1}.config".format(get.curDIR(), get.srcNAME())) if can_access_file("{0}/language/{1}.def.config".format( get.curDIR(), get.srcNAME())): insinto("/etc/texmf/language.def.d", "{0}/language.{1}.def".format(get.curDIR(), get.srcNAME())) if can_access_file("{0}/language.{1}.dat".format(get.curDIR(), get.srcNAME())): insinto("/etc/texmf/language.dat.d", "{0}/language.{1}.dat".format(get.curDIR(), get.srcNAME()))
def build(): shelltools.export("GOPATH", "%s" % get.workDIR()) shelltools.cd("%s" % get.workDIR()) shelltools.move("containerd-*", "containerd") shelltools.cd("containerd") shelltools.move("vendor", "src") shelltools.makedirs("src/github.com/containerd") shelltools.system("ln -rsf %s/containerd* src/github.com/containerd" % get.workDIR()) shelltools.cd("src/github.com/containerd/containerd") shelltools.system("LDFLAGS= GOPATH=%s make GIT_COMMIT=209a7fc" % get.curDIR())
def createSymlinksFormat2Engines(): """Create symlinks from format to engines""" for formatfile in ls("{}/texmf/fmtutil/format*.cnf".format(get.curDIR())): symfile = open(formatfile) for line in symfile.readlines(): if not line.startswith("#"): symbin = line.split(None) if "cont-" in symbin[0] or "metafun" in symbin[ 0] or "mptopdf" in symbin[0]: ctx.ui.info( _('Symlink \"{}\" skipped (special case)').format( symbin[0])) elif "mf" in symbin[0]: ctx.ui.info( _('Symlink \"{0[0]}\" -> \"{0[1]}\" skipped (texlive-core takes care of it.' ).format(symbin)) else: if symbin[0] == symbin[1]: ctx.ui.info( _('Symlink \"{0[0]}\" -> \"{0[1]}\" skipped.'). format(symbin)) elif can_access_file("{0}/usr/bin/{1}".format( get.installDIR(), symbin[0])): ctx.ui.info( _('Symlink \"{}\" skipped (file exists.)').format( symbin[0])) else: ctx.ui.info( _('Making symlink from {0[0]} to {0[1]}').format( symbin)) dodir("/usr/bin") sym( symbin[1], "{0}/usr/bin/{1}".format(get.installDIR(), symbin[0])) symfile.close()
def check(): shelltools.export("LD_LIBRARY_PATH", "%s/src/liblzma/.libs" % get.curDIR()) autotools.make("check")
def install(): if get.buildTYPE()=="libcheaders": kerneltools.installLibcHeaders() return kerneltools.install(distro="sulinos") kerneltools.installModuleHeaders(distro="sulinos") # add objtool for external module building and enabled VALIDATION_STACK option inarytools.insinto("/usr/src/linux-headers-%s-sulinos/tools/objtool" % get.srcVERSION(), "%s/tools/objtool/objtool" % get.curDIR()) # Generate some module lists to use within mkinitramfs shelltools.system("./generate-module-list %s/lib/modules/%s-sulinos" % (get.installDIR(), kerneltools.__getSuffix()))
def build(): shelltools.export("LD_LIBRARY_PATH", "%s/lib:%s" % (get.curDIR(), get.ENV("LD_LIBRARY_PATH"))) qt.make()