1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 13:10:33 +00:00

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

View file

@ -1,11 +1,11 @@
args : with args;
args : with args;
rec {
src = fetchurl {
src = fetchurl {
url = mirror://debian/pool/main/t/texlive-bin/texlive-bin_2009.orig.tar.gz;
sha256 = "0ywc8h4jnig53fs0bji2ivw5f9j6zlgdy477jqw7xvpc7migjpw7";
};
texmfSrc = fetchurl {
texmfSrc = fetchurl {
url = mirror://debian/pool/main/t/texlive-base/texlive-base_2009.orig.tar.gz;
sha256 = "130z907xcxr10yrzbbmp9l8a00dabvi4bi702s5jxamjzav17cmf";
};
@ -19,7 +19,7 @@ rec {
doMainBuild = fullDepEntry (''
ensureDir $out
ensureDir $out/nix-support
ensureDir $out/nix-support
cp ${setupHook} $out/nix-support/setup-hook.sh
ensureDir $out/share
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 '/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' )
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
@ -47,12 +47,13 @@ rec {
mv $out/bin $out/libexec
ensureDir $out/bin
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)
done
[ -d $out/texmf-config ] || ln -s $out/texmf $out/texmf-config
ln -s "$out/"*texmf* "$out/share/"
sed -e 's/.*pyhyph.*/=&/' -i $out/texmf-config/tex/generic/config/language.dat
PATH=$PATH:$out/bin mktexlsr $out/texmf*
@ -76,18 +77,16 @@ rec {
buildInputs = [
zlib bzip2 ncurses libpng flex bison libX11 libICE
xproto freetype t1lib gd libXaw icu ghostscript ed
libXt libXpm libXmu libXext xextproto perl libSM
xproto freetype t1lib gd libXaw icu ghostscript ed
libXt libXpm libXmu libXext xextproto perl libSM
ruby expat curl libjpeg python fontconfig
];
configureFlags = [ "--with-x11"
configureFlags = [ "--with-x11"
"--enable-ipc" "--with-mktexfmt"
];
phaseNames = ["addInputs" (doDump "0") "doMainBuild"
(doDump "1")
"doMakeInstall" "doPostInstall"];
phaseNames = ["addInputs" "doMainBuild" "doMakeInstall" "doPostInstall"];
name = "texlive-core-2009";
meta = {