actions.py 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file https://www.gnu.org/licenses/gpl-3.0.txt
  6. from pisi.actionsapi import get
  7. from pisi.actionsapi import libtools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import shelltools
  11. from pisi.actionsapi import texlivemodules
  12. import os
  13. WorkDir = "."
  14. buildDir = 'texlive-20240312-source/build'
  15. def setup():
  16. shelltools.makedirs(buildDir)
  17. shelltools.cd(buildDir)
  18. shelltools.sym("../configure", "configure")
  19. autotools.configure("--with-x \
  20. --enable-ipc \
  21. --prefix=/usr \
  22. --disable-xindy \
  23. --enable-shared \
  24. --disable-luatex \
  25. --disable-static \
  26. --with-system-gd \
  27. --sysconfdir=/etc \
  28. --bindir=/usr/bin \
  29. --disable-psutils \
  30. --disable-t1utils \
  31. --disable-dvisvgm \
  32. --with-system-zlib \
  33. --with-system-t1lib \
  34. --datadir=/usr/share \
  35. --with-system-libpng \
  36. --with-system-ncurses \
  37. --without-system-xpdf \
  38. --with-system-zziplib \
  39. --with-system-harfbuzz \
  40. --mandir=/usr/share/man \
  41. --disable-multiplatform \
  42. --with-system-graphite2 \
  43. --with-system-freetype2 \
  44. --datarootdir=/usr/share \
  45. --with-banner-add=/PisiLinux \
  46. --disable-native-texlive-build ")
  47. def build():
  48. shelltools.cd(buildDir)
  49. autotools.make()
  50. def install():
  51. shelltools.cd(buildDir)
  52. autotools.rawInstall("prefix=/usr DESTDIR=%s" % get.installDIR())
  53. shelltools.system("pwd")
  54. #install biber
  55. pisitools.dobin("../../biber-2.20/bin/biber")
  56. #pisitools.dodir("/usr/share/tlpkg/TeXLive")
  57. #shelltools.move("%s/source/utils/biber/TeXLive/*.pm" % get.workDIR(), "%s/usr/share/tlpkg/TeXLive" % get.installDIR())
  58. # remove aleph from fmtutil.cnf
  59. pisitools.dosed("%s/usr/share/texmf-dist/web2c/fmtutil.cnf" % get.installDIR(), "^.*aleph.*$")
  60. pisitools.insinto("/etc/texmf/texconfig", "%s/usr/share/texmf-dist/texconfig/tcfmgr.map" % get.installDIR(), sym=True)
  61. # fix symlinks, some are incorrect
  62. # makefile patching is another way, but there ar/dvipdfmx.cfge lot of scripts
  63. # pathing each makefile makes it much harder, for now this is a "simpler" solution
  64. for binary in shelltools.ls(get.installDIR() + "/usr/bin"):
  65. real_path = shelltools.realPath(get.installDIR() + "/usr/bin/" + binary)
  66. if "texmf" in real_path and not os.path.exists(real_path): # modify only if it is broken
  67. base_path = real_path.replace(get.installDIR() + "/usr", "")
  68. new_path = "/usr/share" + base_path
  69. shelltools.unlink(get.installDIR() + "/usr/bin/" + binary)
  70. pisitools.dosym(new_path, "/usr/bin/" + binary)
  71. bibtexextra_scripts=["bbl2bib", "bib2gls", "bibdoiadd", "bibexport", "bibmradd", "biburl2doi", "bibzbladd", "convertgls2bib", "listbib", "ltx2crossrefxml", "multibibliography", "urlbst"]
  72. core_scripts=["a2ping", "a5toa4", "adhocfilelist", "afm2afm", "allcm", "allec", "allneeded", "arara", "arlatex", "autoinst", "bundledoc", "checkcites", "checklistings", "chklref", "chkweb", "cjk-gs-integrate", "cluttex", "cllualatex", "clxelatex", "context", "contextjit", "ctanbib", "ctanify", "ctanupload", "ctan-o-mat", "de-macro", "depythontex", "deweb", "dosepsbin", "dtxgen", "dvi2fax", "dviasm", "dviinfox", "dvired", "e2pall", "epstopdf", "findhyph", "fmtutil", "fmtutil-sys", "fmtutil-user", "fontinst", "fragmaster", "ht", "htcontext", "htlatex", "htmex", "httex", "httexi", "htxelatex", "htxetex", "installfont-tl", "jfmutil", "ketcindy", "kpsepath", "kpsetool", "kpsewhere", "kpsexpand", "latex-git-log", "latex-papersize", "latex2man", "latex2nemeth", "latexdef", "latexdiff", "latexdiff-vc", "latexfileversion", "latexindent", "latexmk", "latexpand", "latexrevise", "listings-ext.sh", "ltxfileinfo", "ltximg", "luaotfload-tool", "luatools", "lwarpmk", "make4ht", "match_parens", "mf2pt1", "mk4ht", "mkjobtexmf", "mkt1font", "mktexfmt", "mktexlsr", "mktexmf", "mktexpk", "mktextfm", "mptopdf", "mtxrun", "mtxrunjit", "ot2kpx", "pamphletangler", "pdfatfi", "pdfbook2", "pdfcrop", "pdfjam", "pdflatexpicscale", "pdftex-quiet", "pdfxup", "pfarrei", "pkfix", "pkfix-helper", "ps2eps", "ps2frag", "pslatex", "purifyeps", "pythontex", "repstopdf", "rpdfcrop", "rungs", "simpdftex", "srcredact", "sty2dtx", "tex4ebook", "texconfig", "texconfig-dialog", "texconfig-sys", "texcount", "texdef", "texdiff", "texdirflatten", "texdoc", "texdoctk", "texexec", "texfot", "texhash", "texindy", "texlinks", "texliveonfly", "texloganalyser", "texmfstart", "texosquery", "texosquery-jre5", "texosquery-jre8", "texplate", "thumbpdf", "tlcockpit", "tlshell", "typeoutfileinfo", "updmap", "updmap-sys", "updmap-user", "vpl2ovp", "vpl2vpl", "xhlatex", "xindex", "xindy"]
  73. games_scripts=["rubikrotation"]
  74. humanities_scripts=["diadia"]
  75. langcyrillic_scripts=["rubibtex", "rumakeindex"]
  76. langkorean_scripts=["jamo-normalize komkindex ttf2kotexfont"]
  77. langcjk_scripts=["convbkmk", "ptex2pdf", "kanji-fontmap-creator", "kanji-config-updmap", "kanji-config-updmap-sys", "kanji-config-updmap-user"]
  78. langextra_scripts=["ebong"]
  79. langgreek_scripts=["mkgrkindex"]
  80. latexextra_scripts=["authorindex", "exceltex", "l3build", "makedtx", "makeglossaries", "makeglossaries-lite", "pdfannotextractor", "perltex", "ps4pdf", "splitindex", "svn-multi", "vpe", "webquiz", "wordcount", "yplan"]
  81. music_scripts=["lily-glyph-commands", "lily-image-commands", "lily-rebuild-pdfs", "m-tx", "musixtex", "musixflx", "pmxchords"]
  82. pictures_scripts=["cachepic", "epspdf", "epspdftk", "fig4latex", "getmapdl", "mathspic", "mathspic", "mkpic", "pn2pdf"]
  83. pstricks_scripts=["pedigree", "pst2pdf"]
  84. science_scripts=["pygmentex", "ulqda"]
  85. # remove unneeded files and symlinks
  86. dirs = []
  87. for g in [bibtexextra_scripts, core_scripts, games_scripts, humanities_scripts, \
  88. langcjk_scripts, langcyrillic_scripts, langextra_scripts, \
  89. langgreek_scripts, latexextra_scripts, music_scripts, \
  90. pictures_scripts, pstricks_scripts, science_scripts, \
  91. ["tlmgr"]]:
  92. for s in g:
  93. if shelltools.isLink("%s/usr/bin/%s" % (get.installDIR(), s)):
  94. realpath = shelltools.realPath("%s/usr/bin/%s" % (get.installDIR(), s))
  95. dirname = shelltools.dirName(realpath)
  96. if not dirname in dirs: dirs.append(dirname)
  97. if not dirname == "%s/usr/bin" % get.installDIR():
  98. if shelltools.isFile(realpath): shelltools.unlink(realpath)
  99. pisitools.remove("/usr/bin/%s" % s)
  100. # remove empty dirs
  101. while dirs:
  102. tmpdirs = dirs[:]
  103. for d in tmpdirs:
  104. if not shelltools.ls(d):
  105. shelltools.unlinkDir(d)
  106. dirname = shelltools.dirName(d)
  107. if not dirname in dirs: dirs.append(dirname)
  108. dirs.remove(d)
  109. pdftexsymlinks=["amstex", "cslatex", "csplain", "eplain", "etex", "jadetex", "latex", "mex", "mllatex", "mltex"
  110. ,"pdfetex", "pdfcslatex", "pdfcsplain", "pdfjadetex", "pdflatex", "pdfmex", "pdfxmltex", "texsis", "utf8mex", "xmltex"]
  111. for symlink in pdftexsymlinks:
  112. pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)
  113. luatexsymlinks=["dvilualatex", "dviluatex", "lualatex"]
  114. for symlink in luatexsymlinks:
  115. pisitools.dosym("pdftex", "/usr/bin/%s" % symlink)
  116. pisitools.dosym("eptex", "/usr/bin/platex")
  117. pisitools.dosym("euptex", "/usr/bin/uplatex")
  118. pisitools.dosym("xetex", "/usr/bin/xelatex")
  119. pisitools.removeDir("/usr/share/texmf-dist")