1 # Description: TeX distribution for UNIX compatible systems, including luatex and xindy support
2 # URL: https://www.tug.org/tetex/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: clisp ghostscript graphite2 harfbuzz icu libgd libmpfr xorg-libxaw xorg-libxi zziplib
5
6 name=texlive
7 version=20220321
8 release=1
9 source=(ftp://tug.org/historic/systems/texlive/${version:0:4}/$name-$version-texmf.tar.xz
10 ftp://tug.org/historic/systems/texlive/${version:0:4}/$name-$version-source.tar.xz
11 https://download.savannah.gnu.org/releases/texi2html/texi2html-5.0.tar.bz2
12 tabu.sty.diff)
13
14 unpack_source() {
15 for file in ${source[@]}; do
16 case ${file##*/} in
17 $name-$version-source.tar.xz)
18 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
19 $name-$version-texmf.tar.xz)
20 mkdir -p $PKG/usr/share
21 bsdtar -p -o -C $PKG/usr/share -xf $(get_filename $file) --strip-components 1 ;;
22 texi2html-5.0.tar.bz2)
23 bsdtar -p -o -C $SRC -xf $(get_filename $file) ;;
24 *)
25 cp $(get_filename $file) $SRC ;;
26 esac
27 done
28 }
29
30 build() {
31 # remove broken symlinks
32 find $SRC -type l -xtype l -exec rm '{}' \+
33
34 # make ConTeXt work, and remove unused settings
35 sed -i \
36 -e 's|selfautoparent:|/usr/share/|g' \
37 -e 's|\(TEXMFLOCAL[ ]*=[ ]*\)[^,]*|\1"/usr/share/texmf-local"|' \
38 -e '/selfautodir/d' \
39 -e '/texmflocal/d' \
40 $PKG/usr/share/texmf-dist/web2c/texmfcnf.lua
41
42 cd $name-$version-source
43
44 chmod -R a-s $SRC
45
46 find $SRC \
47 \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
48 -exec chmod 755 {} \; -o \
49 \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
50 -exec chmod 644 {} \;
51
52 # Fix some paths
53 sed -i 's/SELFAUTOPARENT/TEXMFROOT/' texk/tex4htk/t4ht.c
54 sed -i 's|TEXMFROOT = .*|TEXMFROOT = $SELFAUTODIR/share|g' texk/kpathsea/texmf.cnf
55 sed -i 's|TEXMFLOCAL = .*|TEXMFLOCAL = $TEXMFROOT/texmf-local|g' texk/kpathsea/texmf.cnf
56
57 export TEXMFCNF=""
58 export KPATHSEA_WARNING=0
59
60 # prevent compiling Xdvi with libXp
61 sed -i 's|-lXp ||' texk/xdvik/configure
62
63 mkdir build
64 cd build
65 ../configure \
66 --prefix=/usr \
67 --with-banner-add=" $(crux)" \
68 --with-clisp-runtime=system \
69 --enable-{dvipdfm-x,gc=system,libtool-hack,luatex,pdftex,pdftex-syncex,shared,makeindexk,tex,texlive,tex-synctex,web2c,xindy} \
70 --with-system-{cairo,freetype2,gd,graphite2,gmp,harfbuzz,icu,libpaper,libpng,mpfr,ncurses,pixman,potrace,t1lib,zlib,zziplib} \
71 --with-x \
72 --with-xdvi-x-toolkit=xaw \
73 --disable-{all-pkgs,aleph,native-texlive-build,xetex,xindy-docs,xindy-rules}
74
75 make
76 make DESTDIR=$PKG install
77
78 cd ..
79
80 #fmtutil depends on these
81 perl_sitelib=$(perl -V:sitelib | sed -e "s|sitelib=[']\(.*\)['].*$|\1|")
82 install -d $PKG/$perl_sitelib/TeXLive
83 install texk/tests/TeXLive/TL{Config,Utils}.pm $PKG/$perl_sitelib/TeXLive
84
85 # configure fmtutil
86 sed \
87 -e 's/^aleph/#! aleph/g' \
88 -e 's/^lamed/#! lamed/g' \
89 -e 's/^amstex/#! amstex/g' \
90 -e 's/^cont-en xetex/#! cont-en xetex/g' \
91 -e 's/^pdfcs/#! pdfcs/g' \
92 -e 's/^luacs/#! luacs/g' \
93 -e 's/^pdfcs/#! pdfcs/g' \
94 -e 's/^csplain/#! csplain/g' \
95 -e 's/^eplain/#! eplain/g' \
96 -e 's/^pdfjadetex/#! pdfjadetex/g' \
97 -e 's/^jadetex/#! jadetex/g' \
98 -e 's/^pdfmex/#! pdfmex/g' \
99 -e 's/^utf8mex/#! utf8mex/g' \
100 -e 's/^mex/#! mex/g' \
101 -e 's/^mllatex/#! mllatex/g' \
102 -e 's/^mltex/#! mltex/g' \
103 -e 's/^mptopdf/#! mptopdf/g' \
104 -e 's/^platex/#! platex/g' \
105 -e 's/^eptex/#! eptex/g' \
106 -e 's/^ptex/#! ptex/g' \
107 -e 's/^texsis/#! texsis/g' \
108 -e 's/^euptex/#! euptex/g' \
109 -e 's/^uplatex/#! uplatex/g' \
110 -e 's/^uptex/#! uptex/g' \
111 -e 's/^xelatex/#! xelatex/g' \
112 -e 's/^xetex/#! xetex/g' \
113 -e 's/^cslatex/#! cslatex/g' \
114 -e 's/^lollipop/#! lollipop/g' \
115 -i $PKG/usr/share/texmf-dist/web2c/fmtutil.cnf
116 #-e 's/^pdftex/#! pdftex/g' \
117 #-e 's/^pdflatex/#! pdflatex/g' \
118 #-e 's/^luajittex/#! luajittex/g' \
119 #-e 's/^mf/#! mf/g' \
120
121 # Create symlinks
122 # this uses above configuration to create links like $PKG/usr/bin/lualatex for example
123 # without, the engines just won't work like we want
124 PATH="$PKG/usr/bin:$PATH" LD_LIBRARY_PATH+="$PKG/usr/lib:$LD_LIBRARY_PATH" \
125 texlinks -f $PKG/usr/share/texmf-dist/web2c/fmtutil.cnf $PKG/usr/bin
126
127 #cd $SRC/$name-$version-texmf
128
129 # Fix some paths
130 sed \
131 -e 's|TEXMFROOT = .*|TEXMFROOT = $SELFAUTODIR/share|g' \
132 -e 's|TEXMFLOCAL = .*|TEXMFLOCAL = $TEXMFROOT/texmf-local|g' \
133 -e 's|^OSFONTDIR.*|OSFONTDIR = ~/.fonts:/usr/share/fonts|' \
134 -i $PKG/usr/share/texmf-dist/web2c/texmf.cnf
135
136 cd $SRC/texi2html-*
137 ./configure --prefix=/usr
138 make
139 make install DESTDIR=$PKG
140
141 # final clean up
142 rm -r $PKG/usr/share/{info,locale,texmf-dist/doc}
143 rm -r $PKG/usr/bin/{tlmgr,man}
144 rm -r $PKG/usr/share/texmf-dist/scripts/texlive/tlmgr{,gui}.pl
145 find $PKG/usr/share/texmf-dist \
146 -regex '.*/\(COPYING\|README\|AUTHORS\|INSTALL\|ChangeLog\|NEWS\|TODO\|fonts_README.md\|BUGS\).*' \
147 -exec rm '{}' \+
148 find $PKG/usr/share/texi2html \
149 -regex '.*/\(README\|COPYING\).*' \
150 -exec rm '{}' \+
151 # strip .la files
152 rm -f $PKG/usr/lib/*.la
153 # patch tabu.sty from https://github.com/tabu-fixed/tabu to fix
154 # breakage when compiling doxygen
155 ( cd $PKG/usr/share/texmf-dist/tex/latex/tabu
156 cat $SRC/tabu.sty.diff | patch -p1 --verbose || exit 1
157 )
158 }
|