1 # Maintainer: Aditya Mahajan <adityam at umich dot edu>
2 pkgname=context-minimals-git
5 pkgdesc="A standalone ConTeXt distribution"
6 url="http://www.contextgarden.net"
10 optdepends=('fontconfig: xetex support' 'ruby: pdftex support')
16 install=context-minimals-git.install
20 # ConTeXt minimals uses a different naming convention for architectures
22 declare -A _platform_map
24 _platform_map['i686']='linux'
25 _platform_map['x86_64']='linux-64'
27 _platform=${_platform_map[$CARCH]}
29 _rsyncurl=rsync://contextgarden.net/minimals/setup/${_platform}/bin
30 _dest=/opt/context-minimals
32 # This is the only way to get yaourt to store the files in
33 # /var/abs/local/yaourtbuild so that rsyncing the next time is efficient
35 _gitroot="http://dl.contextgarden.net/distribution/git/"
39 _texlivefontdir="/usr/share/texmf-dist/fonts/"
40 _userfontdir="\$HOME/.fonts"
41 _osfontdir="/usr/share/fonts"
44 msg "Downloading the latest scripts first"
45 rsync -rlptv $_rsyncurl $srcdir
46 msg "Initializing download directory"
48 mkdir -p $srcdir/tex/texmf-cache
50 msg "Starting download or update of ConTeXt distribution"
51 PATH=$scrdir/tex/texmf-$platform/bin:$PATH \
52 $srcdir/bin/texlua $srcdir/bin/mtxrun --script $srcdir/bin/mtx-update.lua \
53 --platform=$_platform --texroot=$srcdir/tex --engine=all --extras=all \
54 --context=beta --update --force --make || return 1
56 # The setuptex that comes with minimals does not work in a multi-user
57 # environment. So, we modify it appropriately.
59 echo "TEXMFOS=${_dest}/texmf-${_platform}" > $srcdir/tex/setuptex
60 echo "export TEXMFOS" >> $srcdir/tex/setuptex
61 echo "" >> $srcdir/tex/setuptex
62 echo "TEXMFCACHE=\$HOME/texmf-cache" >> $srcdir/tex/setuptex
63 echo "export TEXMFCACHE" >> $srcdir/tex/setuptex
64 echo "" >> $srcdir/tex/setuptex
65 echo "unset TEXINPUTS MPINPUTS MFINPUTS" >> $srcdir/tex/setuptex
66 echo "" >> $srcdir/tex/setuptex
67 echo "PATH=\$TEXMFOS/bin:\$PATH" >> $srcdir/tex/setuptex
68 echo "export PATH" >> $srcdir/tex/setuptex
69 echo "" >> $srcdir/tex/setuptex
70 echo "OSFONTDIR=\"$_userfontdir;$_osfontdir;\"" \
71 >> $srcdir/tex/setuptex
72 echo "export OSFONTDIR" >> $srcdir/tex/setuptex
73 # If texlive exists, use fonts from texlive
74 if [ -d $_texlivefontdir ]
76 mkdir -p $srcdir/tex/texmf-fonts
77 if [ -L $srcdir/tex/texmf-fonts/fonts ]
79 rm $srcdir/tex/texmf-fonts/fonts
81 ln -s $_texlivefontdir $srcdir/tex/texmf-fonts/fonts
85 install -d $pkgdir/opt || return 1
87 cp -r --preserve=links $srcdir/tex $pkgdir/$_dest || return 1