texlive: fixed erroneous forwarder scripts

- Generate a forwarder scripts only for executable files. This change
   removes the broken 'man' script, for example.

 - Run the real binaries with 'exec'.

 - Use $SHELL to interpret the forwarder scripts rather than /bin/sh.

 - Indent consistently with blanks.

 - Removed some debug output from the build expression.

svn path=/nixpkgs/trunk/; revision=27679
This commit is contained in:
Peter Simons 2011-07-08 22:45:23 +00:00
parent f92f3deed8
commit 758e85cfac
2 changed files with 27 additions and 28 deletions

View File

@ -12,20 +12,20 @@ rec {
echo Symlinking "$currentPath" echo Symlinking "$currentPath"
find $currentPath/share/info $currentPath/share/man $(echo $currentPath/texmf*/) ! -type d | while read; do find $currentPath/share/info $currentPath/share/man $(echo $currentPath/texmf*/) ! -type d | while read; do
REPLY="''${REPLY#$currentPath}" REPLY="''${REPLY#$currentPath}"
ensureDir $out/"$(dirname "$REPLY")" ensureDir $out/"$(dirname "$REPLY")"
ln -fs $currentPath/"$REPLY" $out/"$REPLY" ln -fs $currentPath/"$REPLY" $out/"$REPLY"
echo echo
done | while read; do head -n 99 >/dev/null; echo -n .; done done | while read; do head -n 99 >/dev/null; echo -n .; done
for i in $currentPath/bin/* :; do #*/ for i in "$currentPath/bin/"* :; do
test "$i" = : && continue; test "$i" != : || continue
echo -ne "#! /bin/sh\\n$i \"\$@\"" > "$out/bin/$(basename "$i")" && \ echo -ne "#! $SHELL\\nexec $i \"\$@\"" > "$out/bin/$(basename "$i")" && \
chmod a+x "$out/bin/$(basename "$i")" chmod a+x "$out/bin/$(basename "$i")"
done done
echo echo
cp -Trfp $currentPath/libexec $out/libexec || true cp -Trfp $currentPath/libexec $out/libexec || true
done done
ln -s $out/texmf* $out/share/ ln -s $out/texmf* $out/share/
@ -39,8 +39,8 @@ rec {
for i in $out/libexec/*/* :; do for i in $out/libexec/*/* :; do
test "$i" = : && continue; test "$i" = : && continue;
test -f "$i" && \ test -f "$i" && \
test -x "$i" && \ test -x "$i" && \
echo -ne "#! /bin/sh\\n$i \"\$@\"" >$out/bin/$(basename $i) && \ echo -ne "#! $SHELL\\nexec $i \"\$@\"" >$out/bin/$(basename $i) && \
chmod a+x $out/bin/$(basename $i) chmod a+x $out/bin/$(basename $i)
done done
@ -58,12 +58,12 @@ rec {
meta = { meta = {
description = "TeX distribution directory"; description = "TeX distribution directory";
longDescription = '' longDescription = ''
Here all the files from different TeX-related Here all the files from different TeX-related
packages are collected in one directory. Of packages are collected in one directory. Of
course, mktexlsr is called. Later placed course, mktexlsr is called. Later placed
directories take precedence. It is supposed that directories take precedence. It is supposed that
share and libexec are symlinked, and bin is share and libexec are symlinked, and bin is
recreated with wrappers for libexec-located recreated with wrappers for libexec-located
linked binaries. linked binaries.
''; '';
}; };

View File

@ -1,11 +1,11 @@
args : with args; args : with args;
rec { rec {
src = fetchurl { src = fetchurl {
url = mirror://debian/pool/main/t/texlive-bin/texlive-bin_2009.orig.tar.gz; url = mirror://debian/pool/main/t/texlive-bin/texlive-bin_2009.orig.tar.gz;
sha256 = "0ywc8h4jnig53fs0bji2ivw5f9j6zlgdy477jqw7xvpc7migjpw7"; sha256 = "0ywc8h4jnig53fs0bji2ivw5f9j6zlgdy477jqw7xvpc7migjpw7";
}; };
texmfSrc = fetchurl { texmfSrc = fetchurl {
url = mirror://debian/pool/main/t/texlive-base/texlive-base_2009.orig.tar.gz; url = mirror://debian/pool/main/t/texlive-base/texlive-base_2009.orig.tar.gz;
sha256 = "130z907xcxr10yrzbbmp9l8a00dabvi4bi702s5jxamjzav17cmf"; sha256 = "130z907xcxr10yrzbbmp9l8a00dabvi4bi702s5jxamjzav17cmf";
}; };
@ -19,7 +19,7 @@ rec {
doMainBuild = fullDepEntry ('' doMainBuild = fullDepEntry (''
ensureDir $out ensureDir $out
ensureDir $out/nix-support ensureDir $out/nix-support
cp ${setupHook} $out/nix-support/setup-hook.sh cp ${setupHook} $out/nix-support/setup-hook.sh
ensureDir $out/share ensureDir $out/share
tar xf ${texmfSrc} -C $out --strip-components=1 tar xf ${texmfSrc} -C $out --strip-components=1
@ -32,7 +32,7 @@ rec {
sed -e 's@\<env python@${python}/bin/python@' -i $(grep 'env python' -rl . ) sed -e 's@\<env python@${python}/bin/python@' -i $(grep 'env python' -rl . )
sed -e '/ubidi_open/i#include <unicode/urename.h>' -i $(find . -name configure) sed -e '/ubidi_open/i#include <unicode/urename.h>' -i $(find . -name configure)
sed -e s@ncurses/curses.h@curses.h@g -i $(grep ncurses/curses.h -rl . ) sed -e s@ncurses/curses.h@curses.h@g -i $(grep ncurses/curses.h -rl . )
sed -e '1i\#include <string.h>\n\#include <stdlib.h>' -i $( find libs/teckit -name '*.cpp' -o -name '*.c' ) sed -e '1i\#include <string.h>\n\#include <stdlib.h>' -i $( find libs/teckit -name '*.cpp' -o -name '*.c' )
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2" NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
@ -47,12 +47,13 @@ rec {
mv $out/bin $out/libexec mv $out/bin $out/libexec
ensureDir $out/bin ensureDir $out/bin
for i in "$out/libexec/"*"/"*; do for i in "$out/libexec/"*"/"*; do
echo -ne "#! /bin/sh\\n$i \"\$@\"" >$out/bin/$(basename $i) test \( \! -d "$i" \) -a -x "$i" || continue
echo -ne "#! $SHELL\\nexec $i \"\$@\"" >$out/bin/$(basename $i)
chmod a+x $out/bin/$(basename $i) chmod a+x $out/bin/$(basename $i)
done done
[ -d $out/texmf-config ] || ln -s $out/texmf $out/texmf-config [ -d $out/texmf-config ] || ln -s $out/texmf $out/texmf-config
ln -s "$out/"*texmf* "$out/share/" ln -s "$out/"*texmf* "$out/share/"
sed -e 's/.*pyhyph.*/=&/' -i $out/texmf-config/tex/generic/config/language.dat sed -e 's/.*pyhyph.*/=&/' -i $out/texmf-config/tex/generic/config/language.dat
PATH=$PATH:$out/bin mktexlsr $out/texmf* PATH=$PATH:$out/bin mktexlsr $out/texmf*
@ -76,18 +77,16 @@ rec {
buildInputs = [ buildInputs = [
zlib bzip2 ncurses libpng flex bison libX11 libICE zlib bzip2 ncurses libpng flex bison libX11 libICE
xproto freetype t1lib gd libXaw icu ghostscript ed xproto freetype t1lib gd libXaw icu ghostscript ed
libXt libXpm libXmu libXext xextproto perl libSM libXt libXpm libXmu libXext xextproto perl libSM
ruby expat curl libjpeg python fontconfig ruby expat curl libjpeg python fontconfig
]; ];
configureFlags = [ "--with-x11" configureFlags = [ "--with-x11"
"--enable-ipc" "--with-mktexfmt" "--enable-ipc" "--with-mktexfmt"
]; ];
phaseNames = ["addInputs" (doDump "0") "doMainBuild" phaseNames = ["addInputs" "doMainBuild" "doMakeInstall" "doPostInstall"];
(doDump "1")
"doMakeInstall" "doPostInstall"];
name = "texlive-core-2009"; name = "texlive-core-2009";
meta = { meta = {