2008-03-22 14:04:04 +01:00
|
|
|
args : with args;
|
|
|
|
rec {
|
|
|
|
phaseNames = ["doAggregate"];
|
|
|
|
name = "TeXLive-linkdir";
|
|
|
|
|
|
|
|
buildInputs = lib.closePropagation paths;
|
|
|
|
|
2009-05-20 01:25:58 +02:00
|
|
|
doAggregate = fullDepEntry (''
|
2008-03-22 14:04:04 +01:00
|
|
|
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/bin
|
2008-03-22 14:04:04 +01:00
|
|
|
for currentPath in ${lib.concatStringsSep " " buildInputs}; do
|
|
|
|
echo Symlinking "$currentPath"
|
2010-02-23 20:14:31 +01:00
|
|
|
find $currentPath/share/info $currentPath/share/man $(echo $currentPath/texmf*/) ! -type d | while read; do
|
2008-03-22 14:04:04 +01:00
|
|
|
REPLY="''${REPLY#$currentPath}"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/"$(dirname "$REPLY")"
|
2011-07-09 00:45:23 +02:00
|
|
|
ln -fs $currentPath/"$REPLY" $out/"$REPLY"
|
|
|
|
echo
|
2008-03-22 14:04:04 +01:00
|
|
|
done | while read; do head -n 99 >/dev/null; echo -n .; done
|
2011-04-17 10:27:09 +02:00
|
|
|
|
2011-07-09 00:45:23 +02:00
|
|
|
for i in "$currentPath/bin/"* :; do
|
|
|
|
test "$i" != : || continue
|
|
|
|
echo -ne "#! $SHELL\\nexec $i \"\$@\"" > "$out/bin/$(basename "$i")" && \
|
2011-04-17 10:27:09 +02:00
|
|
|
chmod a+x "$out/bin/$(basename "$i")"
|
|
|
|
done
|
|
|
|
|
2011-07-09 00:45:23 +02:00
|
|
|
echo
|
2008-03-22 14:04:04 +01:00
|
|
|
|
2011-07-09 00:45:23 +02:00
|
|
|
cp -Trfp $currentPath/libexec $out/libexec || true
|
2008-03-22 14:04:04 +01:00
|
|
|
done
|
|
|
|
|
2010-02-11 10:45:07 +01:00
|
|
|
ln -s $out/texmf* $out/share/
|
|
|
|
|
|
|
|
rm -r $out/texmf-config
|
|
|
|
find $out/texmf/ -type d | while read; do
|
|
|
|
REPLY="''${REPLY#$out/texmf}"
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/texmf-config/"$REPLY"
|
2008-03-22 14:04:04 +01:00
|
|
|
done
|
|
|
|
|
2011-04-17 10:27:09 +02:00
|
|
|
for i in $out/libexec/*/* :; do
|
|
|
|
test "$i" = : && continue;
|
2010-08-25 21:31:23 +02:00
|
|
|
test -f "$i" && \
|
2011-07-09 00:45:23 +02:00
|
|
|
test -x "$i" && \
|
|
|
|
echo -ne "#! $SHELL\\nexec $i \"\$@\"" >$out/bin/$(basename $i) && \
|
2010-02-23 20:14:31 +01:00
|
|
|
chmod a+x $out/bin/$(basename $i)
|
2008-03-22 14:04:04 +01:00
|
|
|
done
|
|
|
|
|
2010-02-11 10:45:07 +01:00
|
|
|
rm $out/texmf*/ls-R
|
2008-03-22 14:04:04 +01:00
|
|
|
for i in web2c texconfig fonts/map; do
|
2010-02-11 10:45:07 +01:00
|
|
|
cp -r $out/texmf/$i/* $out/texmf-config/$i || true
|
2008-03-22 14:04:04 +01:00
|
|
|
done
|
|
|
|
|
2010-02-11 10:45:07 +01:00
|
|
|
TEXMFCONFIG=$out/texmf-config HOME=$PWD PATH=$PATH:$out/bin updmap --syncwithtrees
|
|
|
|
PATH=$PATH:$out/bin mktexlsr $out/texmf*
|
|
|
|
TEXMFCONFIG=$out/texmf-config HOME=$PWD PATH=$PATH:$out/bin updmap --syncwithtrees
|
|
|
|
PATH=$PATH:$out/bin mktexlsr $out/texmf*
|
2008-03-22 14:04:04 +01:00
|
|
|
'') ["minInit" "defEnsureDir" "addInputs"];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "TeX distribution directory";
|
|
|
|
longDescription = ''
|
2011-07-09 00:45:23 +02:00
|
|
|
Here all the files from different TeX-related
|
|
|
|
packages are collected in one directory. Of
|
|
|
|
course, mktexlsr is called. Later placed
|
2008-03-22 14:04:04 +01:00
|
|
|
directories take precedence. It is supposed that
|
|
|
|
share and libexec are symlinked, and bin is
|
2011-07-09 00:45:23 +02:00
|
|
|
recreated with wrappers for libexec-located
|
2008-03-22 14:04:04 +01:00
|
|
|
linked binaries.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|