# Contributor: Isaac Dunham # Maintainer: Marian Buschsieweke pkgname=texlive pkgver=20190410 pkgrel=3 pkgdesc="Comprehensive TeX document production system" url="http://tug.org/texlive/" arch="all !ppc64le" license="GPL" depends="perl texmf-dist>=2018.50036 xz" depends_dev="" makedepends="freetype-dev libpng-dev poppler-dev icu-dev harfbuzz-dev cairo-dev pixman-dev zziplib-dev libpaper-dev graphite2-dev libxmu-dev fontconfig-dev libxaw-dev motif-dev" install="" triggers="$pkgname.trigger=/usr/share/texmf-dist" subpackages=" $pkgname-static $pkgname-dev $pkgname-doc xdvik:xdvi $pkgname-dvi:dvi $pkgname-full:meta:noarch $pkgname-xetex:xetex $pkgname-luatex:lua " source=" ftp://ftp.tug.org/texlive/historic/${pkgver:0:4}/texlive-$pkgver-source.tar.xz poppler-076.patch " builddir="$srcdir"/texlive-${pkgver}-source options="!check" # No unit tests provided _luatex="dvilualatex dviluatex lualollipop lualatex" _pdftex="amstex cslatex csplain eplain etex jadetex latex lollipop mex mllatex mltex pdfetex pdfcslatex pdfcsplain pdfjadetex pdflatex pdfmex pdfxmltex texsis utf8mex xmltex" _xetex="xelatex xelollipop" _dvi="afm2tfm bbox dvigif dvipng dvips epsffit extractres includeres ps2eps psbook psjoin psnup psresize psselect pstops" # Each poppler version recently broke the API, so special treatment is required _poppler_ver=0.76.0 prepare() { default_prepare local folder="texk/web2c/pdftexdir" for file in pdftoepdf pdftosrc; do cp -pv $folder/$file-poppler$_poppler_ver.cc $folder/$file.cc done } build() { if [ "$CARCH" = "ppc64le" ] || [ "$CARCH" = "s390x" ] ; then EXTRA="--disable-luajittex --disable-mfluajit" fi mkdir -p $builddir/build && cd $builddir/build ../configure -C \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --localstatedir=/var \ --enable-biber \ --enable-epsfwin \ --enable-ipc \ --enable-luatex \ --enable-mftalkwin \ --enable-regiswin \ --enable-shared \ --enable-tektronixwin \ --enable-unitermwin \ --enable-xetex \ --enable-dvipng \ --enable-dvipsk \ --enable-ps2eps \ --enable-psutils \ --disable-bibtex-x \ --disable-chktex \ --disable-cjkutils \ --disable-detex \ --disable-dialog \ --disable-dvi2tty \ --disable-dvisvgm \ --disable-largefile \ --disable-lcdf-typetools \ --disable-multiplatform \ --disable-native-texlive-build \ --disable-pdfopen \ --disable-ps2pkm \ --disable-t1utils \ --disable-tex4htk \ --disable-ttf2pk2 \ --disable-vlna \ --disable-xindy \ --with-ps=gs \ --with-banner-add="/Alpine Linux" \ --with-system-cairo \ --with-system-freetype2 \ --with-system-graphite2 \ --with-system-harfbuzz \ --with-system-icu \ --with-system-libpaper \ --with-system-libpng \ --with-system-pixman \ --with-system-poppler \ --with-system-xpdf \ --with-system-zlib \ --with-system-zziplib \ --with-x-dvi-toolkit=motif \ --without-texinfo \ $EXTRA make } package() { cd build make DESTDIR="$pkgdir" install cp -rf ../texk/tests/TeXLive \ "$pkgdir"/usr/share/texmf-dist/scripts/texlive local texcmd; for texcmd in $_pdftex; do ln -s pdftex "$pkgdir"/usr/bin/$texcmd done ln -s eptex "$pkgdir"/usr/bin/platex ln -s euptex "$pkgdir"/usr/bin/uplatex # As Alpine has packaged all TeXlive packages, there is no need for a # separate package manager. apk should be used to get and update texmf-dist rm "$pkgdir"/usr/share/texmf-dist/scripts/texlive/tlmgr.pl rm "$pkgdir"/usr/bin/tlmgr sed -i -e 's:^\(TEXMFROOT *= *\)$SELFAUTOPARENT$:\1/usr/share:g' \ "$pkgdir"/usr/share/texmf-dist/web2c/texmf.cnf } xetex() { # Split off XeTeX because it depends on graphite/harfbuzz/icu pkgdesc="TeX typesetting engine supporting modern typography and bidirectional text" depends="$pkgname" install -d -m 0755 "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/xetex "$subpkgdir"/usr/bin/ local texcmd; for texcmd in $_xetex; do ln -s xetex "$subpkgdir"/usr/bin/$texcmd done } meta() { pkgdesc="A complete TeX distribution" depends="$pkgname $pkgname-doc $pkgname-luatex $pkgname-xetex xdvik $pkgname-dvi texmf-dist-full" mkdir -p "$subpkgdir" } dvi() { pkgdesc="Tools for dvi based workflow (e.g. dvips)" depends="$pkgname" install -d -m 0755 "$subpkgdir"/usr/bin for tool in $_dvi; do mv "${pkgdir}/usr/bin/${tool}" "${subpkgdir}/usr/bin/" done } lua() { pkgdesc="LuaTeX is an extended version of pdfTeX, scriptable in Lua" depends="bash $pkgname" # lua2dox_filter is a bash script mkdir -p "$subpkgdir" && cd "$subpkgdir" install -d -m 0755 usr/bin usr/lib \ usr/share/texmf-dist/scripts/context/stubs/unix mv "$pkgdir"/usr/bin/*lua* "$subpkgdir"/usr/bin/ mv "$pkgdir"/usr/lib/lib*lua*.so.* "$subpkgdir"/usr/lib/ mv "$pkgdir"/usr/share/texmf-dist/scripts/*lua* \ "$subpkgdir"/usr/share/texmf-dist/scripts/ mv "$pkgdir"/usr/share/texmf-dist/scripts/context/stubs/unix/luatools \ "$subpkgdir"/usr/share/texmf-dist/scripts/context/stubs/unix/luatools local texcmd; for texcmd in $_luatex do ln -s luatex "$subpkgdir"/usr/bin/$texcmd done cd - # The following directories are used strictly for Lua scripts: # for DIR in # usr/share/texmf-dist/scripts/checkcites/ \ # usr/share/texmf-dist/scripts/getmap/ \ # usr/share/texmf-dist/scripts/m-tx/ \ # usr/share/texmf-dist/scripts/musixtex/ \ # usr/share/texmf-dist/scripts/pmx/ \ # usr/share/texmf-dist/scripts/pmxchords/ \ # usr/share/texmf-dist/scripts/ptex2pdf/ ; # do # mv "$pkgdir"/"$DIR" "$subpkgdir"/usr/share/texmf-dist/scripts/ # done } xdvi() { # currently, xdvi needs a number of files and scripts from texlive; # we split it off so that it doesn't drag in X and Motif. depends="texlive" pkgdesc="Xdvi from texlive, using the texlive libraries" provides="xdvi" mkdir -p "$subpkgdir" && cd "$subpkgdir" install -d -m 0755 usr/bin usr/share/texmf-dist/ mv "$pkgdir"/usr/bin/xdvi "$pkgdir"/usr/bin/xdvi-* usr/bin/ mv "$pkgdir"/usr/share/texmf-dist/xdvi usr/share/texmf-dist/ } sha512sums="7759d8e668e53c0c73e48907096da9d8fb6384dd9c3342ddfb05e17d077054c5351d35256cf4e63a6da502de2f09f521979bede7209cdd5bd8ae80eba0efed2e texlive-20190410-source.tar.xz 46d7423bd3de21cf94a041bbffb93bdd071e1eb78a36e047909c943aeaf4bfa2832d3c2c353cc208daad501eb7d08f850dd0873a2f5135a3d0938e141f2e4baf poppler-076.patch"