PKGBUILDs/extra/texlive-bin/PKGBUILD
2009-10-09 21:23:22 -05:00

289 lines
11 KiB
Bash

# Maintainer: francois at archlinux dot org
pkgname=texlive-bin
pkgver=2009.4
pkgrel=2
pkgdesc="TeX Live binaries"
license=('GPL')
arch=('i686' 'x86_64')
depends=('t1lib' 'gd' 'libsigsegv' 'poppler')
makedepends=('clisp' 'ffcall')
options=('!makeflags' '!libtool')
url='http://tug.org/texlive/'
source=('texmf.cnf'
'ftp://ftp.archlinux.org/other/texlive/texlive-bin-source-20090930.tar.xz'
'ftp://ftp.archlinux.org/other/texlive/texlive-bin-texmf-20090930.tar.xz'
'http://foundry.supelec.fr/gf/download/frsrelease/353/1363/luatex-beta-0.43.0.tar.bz2'
'fix-fontforge-encoding.patch')
backup=(usr/share/texmf/web2c/texmf.cnf \
usr/share/texmf-config/web2c/mktex.cnf \
usr/share/texmf-config/web2c/updmap.cfg \
usr/share/texmf-config/web2c/fmtutil.cfg \
usr/share/texmf-config/tex/generic/config/language.dat \
usr/share/texmf-config/tex/generic/config/pdftexconfig.tex \
usr/share/texmf-config/ttf2pk/ttf2pk.cfg \
usr/share/texmf-config/dvips/config/config.ps \
usr/share/texmf-config/dvipdfm/dvipdfmx.cfg \
usr/share/texmf-config/dvipdfm/config/config \
usr/share/texmf-config/xdvi/XDvi)
md5sums=('04aff1501d9a8418903dd7342b6db87f'
'1baf3379a2be374d5793f82134b17f4f'
'95bfd32a0176645694935d117271e1db'
'2ca3f261191310b62fc93c98791a67e7'
'bfb9716aa00c86c08cd31e5b32edeb98')
build() {
if [ "${CARCH}" = "x86_64" ]; then
export CFLAGS="${CFLAGS} -fPIC"
export CXXFLAGS="${CXXFLAGS} -fPIC"
fi
cd $srcdir
install -m755 -d $pkgdir/usr/share || return 1
cp -r texmf $pkgdir/usr/share/ || return 1
### provisory: we configure and build luatex 0.43 separately, because
# it is needed for latest ConTeXT in texlive-core, but it fails to build
# when integrated in the texlive build tree
cd luatex-beta-0.43.0
patch -p0 -i ../fix-fontforge-encoding.patch || return 1
mkdir build
cd build
../source/configure --prefix=/usr \
--enable-cxx-runtime-hack \
--disable-afm2pl \
--disable-aleph \
--disable-bibtex \
--disable-bibtex8 \
--disable-cfftot1 \
--disable-cjkutils \
--disable-detex \
--disable-devnag \
--disable-dialog \
--disable-dtl \
--disable-dump-share \
--disable-dvi2tty \
--disable-dvidvi \
--disable-dviljk \
--disable-dvipdfm \
--disable-dvipdfmx \
--disable-dvipos \
--disable-dvipsk \
--disable-gsftopk \
--disable-lacheck \
--disable-lcdf-typetools \
--disable-makeindexk \
--disable-mf \
--disable-mmafm \
--disable-mmpfb \
--disable-musixflx \
--disable-otfinfo \
--disable-otftotfm \
--disable-pdfopen \
--disable-pdftex \
--disable-ps2eps \
--disable-ps2pkm \
--disable-psutils \
--disable-seetexk \
--disable-t1dotlessj \
--disable-t1lint \
--disable-t1rawafm \
--disable-t1reencode \
--disable-t1testpage \
--disable-t1utils \
--disable-tex \
--disable-tex4htk \
--disable-tpic2pdftex \
--disable-ttf2pk \
--disable-ttfdump \
--disable-ttftotype42 \
--disable-vlna \
--disable-web-progs \
--disable-xdv2pdf \
--disable-xdvipdfmx \
--without-system-kpathsea \
--with-system-freetype2 \
--with-freetype2-libdir=/usr/lib \
--with-freetype2-include=/usr/include/freetype2 \
--with-system-gd \
--with-system-libpng \
--without-system-teckit \
--with-system-zlib \
--with-system-t1lib \
--with-system-xpdf \
--disable-shared \
--disable-largefile \
--disable-ipc \
--without-mf-x-toolkit \
--without-x || return 1
make || return 1
## install luatex binary
install -d -m755 $pkgdir/usr/bin || return 1
install -m755 texk/web2c/luatex $pkgdir/usr/bin/ || return 1
/bin/ln -s $pkgdir/usr/bin/luatex texlua || return 1
/bin/ln -s $pkgdir/usr/bin/luatexc texlua || return 1
cd ../..
##################################
# TODO don't forget to remove --disable-luatex below
# once luatex is updated in TeXLive...
cd source
## prevent compiling Xdvi with libXp
sed -i~ 's|-lXp ||' texk/xdvik/configure
test ! -d Work && mkdir Work
cd Work
echo "--> Initial configuration..."
../configure --prefix=/usr \
--datarootdir=$pkgdir/usr/share \
--datadir=$pkgdir/usr/share \
--mandir=$pkgdir/usr/share/man \
--disable-native-texlive-build \
--with-tex-banner="TeX Live 2009/Arch Linux" \
--disable-multiplatform \
--disable-dialog \
--disable-psutils \
--disable-t1utils \
--disable-xz \
--with-system-zlib \
--with-system-pnglib \
--with-system-ncurses \
--with-system-t1lib \
--with-system-gd \
--with-system-xpdf \
--with-system-freetype2 \
--with-freetype2-libdir=/usr/lib \
--with-freetype2-include=/usr/include/freetype2 \
--with-xdvi-x-toolkit=xaw \
--disable-dump-share \
--disable-aleph \
--disable-luatex \
--without-graphite \
--enable-xindy || return 1
#############################################################
#############################################################
echo "-------------------------------------------------------"
echo "--> Building the whole beast ..."
make || return 1
#############################################################
### fixes for xindy
find utils/xindy -name Makefile -exec sed -i -e "s|^prefix =.\+$|prefix = $pkgname/usr|" -e "s|^mandir =.\+$|mandir = \${prefix}/share/man|" -e "s|^datadir =.\+$|datadir = \${datarootdir}/texmf|" -e "s|^docdir =.\+$|docdir = \${datadir}/doc/xindy|" '{}' \; || return 1
echo "-------------------------------------------------------"
echo "--> Proceeding with make install ..."
install -d -m755 $pkgdir/usr/share/man/man5
make prefix=$pkgdir/usr texmf=$pkgdir/usr/share/texmf install || return 1
echo "-------------------------------------------------------"
echo "--> Fixing symlinks for scripts ..."
for f in $pkgdir/usr/bin/* ; do
if [ -L $f ]; then
target=`ls -l "$f" | sed 's/^.\+ -> //'`
if [[ "$target" == ..* ]]; then
newtarget=`echo $target | sed -e 's#../#/usr/share/#'`
rm -f $f
ln -s $newtarget $f
test -f $pkgdir/$newtarget && chmod a+x $pkgdir/$newtarget
fi
fi
done
## create symlinks for formats
echo "--> Create symlinks for TeX formats ..."
$pkgdir/usr/bin/texlinks -f $pkgdir/usr/share/texmf/web2c/fmtutil.cnf $pkgdir/usr/bin/ || return 1
#############################################################
## CLEAN UP...
echo "--> ...Cleaning up installation"
# remove tlmgr from PATH
rm -f $pkgdir/usr/bin/tlmgr
# spurious symlink
rm -f $pkgdir/usr/bin/man
# remove symlinks to scripts that are not in texlive-core:
for s in cachepic ht htcontext htlatex htmex httex httexi htxelatex htxetex mk4ht \
htcontext mkgrkindex epspdftk pst2pdf epspdf ulqda ebong makeglossaries \
pdfannotextractor perltex pdfthumb ppower4 ps4pdf splitindex svn-multi vpe; do
rm $pkgdir/usr/bin/$s
done
# the mandirs contain Makefiles ...
find $pkgdir -name Makefile -delete
rm -f $pkgdir/usr/share/texmf/scripts/texlive/*-{win32,w32}*
rm -rf $pkgdir/usr/share/texmf/scripts/tlgs
rm -rf $pkgdir/usr/share/texmf/asymptote
# make install targets are somewhat chaotic :)
mv -n $pkgdir/usr/texmf/* $pkgdir/usr/share/texmf/
mv -n $pkgdir/usr/texmf-dist/* $pkgdir/usr/share/texmf/
rm -rf $pkgdir/usr/{texmf,texmf-dist}
rmdir $pkgdir/usr/share/lcdf-typetools
# most man files went to two different places:
for i in 1 5; do
# remove pdf versions of manpages:
rm -f $pkgdir/usr/share/texmf/doc/man/man$i/*.pdf
# move to
mv -n $pkgdir/usr/share/texmf/doc/man/man$i/*.$i $pkgdir/usr/share/man/man$i/
done
# remove all doc (essentially xindy and duplicated man files)
rm -rf $pkgdir/usr/share/texmf/doc
# those files are also in base, but "make install" duplicated them here:
rm -rf $pkgdir/usr/share/texmf/bibtex/
# remove files that belong to asymptote
rm -rf $pkgdir/usr/share/texmf/tex/latex/asymptote
for f in asy xasy; do
rm -f $pkgdir/usr/share/man/man1/$f.1
done
# remove files that belong to t1utils
for f in t1ascii t1asm t1binary t1disasm t1mac t1unmac; do
rm -f $pkgdir/usr/share/man/man1/$f.1
done
# remove files that belong to psutils
for f in epsffit extractres fixdlsrps fixfmps fixmacps fixpsditps fixpspps fixscribeps fixtpps fixwfwps fixwpps fixwwps getafm includeres psbook psmerge psnup psresize psselect pstops; do
rm -f $pkgdir/usr/share/man/man1/$f.1
done
# remove man files that belong to omega/aleph
for f in lambda odvicopy odvitype ofm2opl opl2ofm otp2ocp outocp ovf2ovp ovp2ovf ; do
rm -f $pkgdir/usr/share/man/man1/$f.1
done
# replace upstream texmf.cnf with ours
rm -f $pkgdir/usr/share/texmf/web2c/texmf.cnf
install -m644 $srcdir/texmf.cnf $pkgdir/usr/share/texmf/web2c/texmf.cnf
## remove aleph from fmtutil.cnf
sed -i -e '/aleph/d' $pkgdir/usr/share/texmf/web2c/fmtutil.cnf || return 1
###################################################################
# copy config files to texmf-config tree
install -d -m755 $pkgdir/usr/share/texmf-config/web2c
install -d -m755 $pkgdir/usr/share/texmf-config/dvips/config
install -d -m755 $pkgdir/usr/share/texmf-config/dvipdfm/config
install -d -m755 $pkgdir/usr/share/texmf-config/dvipdfmx
install -d -m755 $pkgdir/usr/share/texmf-config/tex/generic/config
install -d -m755 $pkgdir/usr/share/texmf-config/xdvi
cp -a $pkgdir/usr/share/texmf/web2c/mktex.cnf \
$pkgdir/usr/share/texmf-config/web2c/
cp -a $pkgdir/usr/share/texmf/web2c/updmap.cfg \
$pkgdir/usr/share/texmf-config/web2c/
cp -a $pkgdir/usr/share/texmf/web2c/fmtutil.cnf \
$pkgdir/usr/share/texmf-config/web2c/
cp -a $pkgdir/usr/share/texmf/dvips/config/config.ps \
$pkgdir/usr/share/texmf-config/dvips/config/
cp -a $pkgdir/usr/share/texmf/dvipdfm/config/config \
$pkgdir/usr/share/texmf-config/dvipdfm/config/
cp -a $pkgdir/usr/share/texmf/dvipdfmx/dvipdfmx.cfg \
$pkgdir/usr/share/texmf-config/dvipdfmx/
cp -a $pkgdir/usr/share/texmf/tex/generic/config/pdftexconfig.tex \
$pkgdir/usr/share/texmf-config/tex/generic/config/
cp -a $pkgdir/usr/share/texmf/tex/generic/config/language.dat \
$pkgdir/usr/share/texmf-config/tex/generic/config/
cp -a $pkgdir/usr/share/texmf/xdvi/XDvi \
$pkgdir/usr/share/texmf-config/xdvi/
# clean updmap.cfg
sed -i '/^\(Map\|MixedMap\)/d' $pkgdir/usr/share/texmf-config/web2c/updmap.cfg
sed -i '/^#! \(Map\|MixedMap\)/d' $pkgdir/usr/share/texmf-config/web2c/updmap.cfg
# fix hard-coded paths in xindy.pl
sed -i "s|'/.\+/pkg/usr|'/usr|" $pkgdir/usr/share/texmf/scripts/xindy/xindy.pl
# move xindy modules to /usr/share/xindy
rm -rf $pkgdir/usr/share/xindy
mv $pkgdir/usr/share/texmf/xindy $pkgdir/usr/share/
}