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