2011-07-08 23:45:23 +01:00
|
|
|
args : with args;
|
2008-03-20 15:40:26 +00:00
|
|
|
rec {
|
2011-07-08 23:45:23 +01:00
|
|
|
src = fetchurl {
|
2010-02-10 04:38:11 +00:00
|
|
|
url = mirror://debian/pool/main/t/texlive-bin/texlive-bin_2009.orig.tar.gz;
|
|
|
|
sha256 = "0ywc8h4jnig53fs0bji2ivw5f9j6zlgdy477jqw7xvpc7migjpw7";
|
2008-03-20 15:40:26 +00:00
|
|
|
};
|
2011-07-08 23:45:23 +01:00
|
|
|
|
|
|
|
texmfSrc = fetchurl {
|
2010-02-10 04:38:11 +00:00
|
|
|
url = mirror://debian/pool/main/t/texlive-base/texlive-base_2009.orig.tar.gz;
|
|
|
|
sha256 = "130z907xcxr10yrzbbmp9l8a00dabvi4bi702s5jxamjzav17cmf";
|
2008-03-20 15:40:26 +00:00
|
|
|
};
|
2008-03-20 09:52:08 +00:00
|
|
|
|
2008-03-20 15:40:26 +00:00
|
|
|
langTexmfSrc = fetchurl {
|
2010-02-10 04:38:11 +00:00
|
|
|
url = mirror://debian/pool/main/t/texlive-lang/texlive-lang_2009.orig.tar.gz;
|
|
|
|
sha256 = "10shnsc71n95zy9ys938pljdid9ampmc50k4lji9wv53hm14laic";
|
2008-03-20 15:40:26 +00:00
|
|
|
};
|
2008-03-20 20:39:00 +00:00
|
|
|
|
2008-03-20 15:40:26 +00:00
|
|
|
setupHook = ./setup-hook.sh;
|
2008-03-20 09:52:08 +00:00
|
|
|
|
2010-02-10 04:38:11 +00:00
|
|
|
doMainBuild = fullDepEntry (''
|
2008-03-20 15:40:26 +00:00
|
|
|
ensureDir $out
|
2011-07-08 23:45:23 +01:00
|
|
|
ensureDir $out/nix-support
|
2008-03-20 15:40:26 +00:00
|
|
|
cp ${setupHook} $out/nix-support/setup-hook.sh
|
|
|
|
ensureDir $out/share
|
2010-02-11 05:20:16 +00:00
|
|
|
tar xf ${texmfSrc} -C $out --strip-components=1
|
|
|
|
tar xf ${langTexmfSrc} -C $out --strip-components=1
|
2010-02-10 04:38:11 +00:00
|
|
|
|
2010-02-10 18:16:32 +00:00
|
|
|
sed -e s@/usr/bin/@@g -i $(grep /usr/bin/ -rl . )
|
2010-02-10 04:38:11 +00:00
|
|
|
|
2010-02-10 18:16:32 +00:00
|
|
|
sed -e 's@\<env ruby@${ruby}/bin/ruby@' -i $(grep 'env ruby' -rl . )
|
|
|
|
sed -e 's@\<env perl@${perl}/bin/perl@' -i $(grep 'env perl' -rl . )
|
|
|
|
sed -e 's@\<env python@${python}/bin/python@' -i $(grep 'env python' -rl . )
|
2010-02-10 04:38:11 +00:00
|
|
|
|
2008-03-20 15:40:26 +00:00
|
|
|
sed -e '/ubidi_open/i#include <unicode/urename.h>' -i $(find . -name configure)
|
2011-07-08 23:45:23 +01:00
|
|
|
sed -e s@ncurses/curses.h@curses.h@g -i $(grep ncurses/curses.h -rl . )
|
2009-05-11 00:26:19 +01:00
|
|
|
sed -e '1i\#include <string.h>\n\#include <stdlib.h>' -i $( find libs/teckit -name '*.cpp' -o -name '*.c' )
|
2008-03-20 15:40:26 +00:00
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
|
|
|
|
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${icu}/include/layout";
|
2010-02-10 04:38:11 +00:00
|
|
|
|
2010-02-10 18:16:32 +00:00
|
|
|
./Build --prefix="$out" --datadir="$out/share" --mandir "$out/share/man" --infodir "$out/share/info" \
|
|
|
|
${args.lib.concatStringsSep " " configureFlags}
|
|
|
|
cd Work
|
2008-03-20 15:40:26 +00:00
|
|
|
'') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
|
|
|
|
|
2009-05-20 00:25:58 +01:00
|
|
|
doPostInstall = fullDepEntry(''
|
2008-03-20 15:40:26 +00:00
|
|
|
mv $out/bin $out/libexec
|
|
|
|
ensureDir $out/bin
|
2010-03-08 10:40:05 +00:00
|
|
|
for i in "$out/libexec/"*"/"*; do
|
2011-07-08 23:45:23 +01:00
|
|
|
test \( \! -d "$i" \) -a -x "$i" || continue
|
|
|
|
echo -ne "#! $SHELL\\nexec $i \"\$@\"" >$out/bin/$(basename $i)
|
2008-03-20 15:40:26 +00:00
|
|
|
chmod a+x $out/bin/$(basename $i)
|
|
|
|
done
|
2010-02-11 05:20:16 +00:00
|
|
|
[ -d $out/texmf-config ] || ln -s $out/texmf $out/texmf-config
|
2010-03-08 10:40:05 +00:00
|
|
|
ln -s "$out/"*texmf* "$out/share/"
|
2011-07-08 23:45:23 +01:00
|
|
|
|
2010-02-11 05:20:16 +00:00
|
|
|
sed -e 's/.*pyhyph.*/=&/' -i $out/texmf-config/tex/generic/config/language.dat
|
2008-03-20 20:39:00 +00:00
|
|
|
|
2010-03-08 13:22:45 +00:00
|
|
|
PATH=$PATH:$out/bin mktexlsr $out/texmf*
|
|
|
|
|
|
|
|
HOME=. PATH=$PATH:$out/bin updmap-sys --syncwithtrees
|
|
|
|
|
2010-03-08 10:40:05 +00:00
|
|
|
# Prebuild the format files, as it used to be done with TeXLive 2007.
|
2010-03-09 22:47:22 +00:00
|
|
|
# Luatex currently fails this way:
|
|
|
|
#
|
|
|
|
# This is a summary of all `failed' messages:
|
|
|
|
# `luatex -ini -jobname=luatex -progname=luatex luatex.ini' failed
|
|
|
|
# `luatex -ini -jobname=dviluatex -progname=dviluatex dviluatex.ini' failed
|
|
|
|
#
|
|
|
|
# I find it acceptable, hence the "|| true".
|
2010-03-09 15:57:33 +00:00
|
|
|
echo "building format files..."
|
2010-03-08 10:40:05 +00:00
|
|
|
ensureDir "$out/texmf-var/web2c"
|
2010-03-09 22:47:22 +00:00
|
|
|
PATH="$PATH:$out/bin" fmtutil-sys --all || true
|
2010-03-08 10:40:05 +00:00
|
|
|
|
2010-02-11 05:20:16 +00:00
|
|
|
PATH=$PATH:$out/bin mktexlsr $out/texmf*
|
2008-03-20 15:40:26 +00:00
|
|
|
'') ["minInit" "defEnsureDir" "doUnpack" "doMakeInstall"];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
zlib bzip2 ncurses libpng flex bison libX11 libICE
|
2011-07-08 23:45:23 +01:00
|
|
|
xproto freetype t1lib gd libXaw icu ghostscript ed
|
|
|
|
libXt libXpm libXmu libXext xextproto perl libSM
|
2010-02-10 18:16:32 +00:00
|
|
|
ruby expat curl libjpeg python fontconfig
|
2008-03-20 15:40:26 +00:00
|
|
|
];
|
|
|
|
|
2011-07-08 23:45:23 +01:00
|
|
|
configureFlags = [ "--with-x11"
|
2008-03-20 15:40:26 +00:00
|
|
|
"--enable-ipc" "--with-mktexfmt"
|
|
|
|
];
|
|
|
|
|
2011-07-08 23:45:23 +01:00
|
|
|
phaseNames = ["addInputs" "doMainBuild" "doMakeInstall" "doPostInstall"];
|
2008-03-20 15:40:26 +00:00
|
|
|
|
2010-02-10 04:38:11 +00:00
|
|
|
name = "texlive-core-2009";
|
2008-03-20 15:40:26 +00:00
|
|
|
meta = {
|
|
|
|
description = "A TeX distribution";
|
2010-02-10 04:38:11 +00:00
|
|
|
maintainers = [ args.lib.maintainers.raskin ];
|
|
|
|
platforms = args.lib.platforms.linux ++ args.lib.platforms.freebsd ;
|
2008-03-20 15:40:26 +00:00
|
|
|
};
|
2008-03-20 09:52:08 +00:00
|
|
|
}
|