TeXLive. Now more configurable, and more options included. Beamer class for conference slides added. Before asking questions, look in configurations/misc/raskin.nix or in all-packages.nix .

svn path=/nixpkgs/trunk/; revision=11257
This commit is contained in:
Michael Raskin 2008-03-22 13:04:04 +00:00
parent 3bcb0f794f
commit b7ee7d1999
9 changed files with 221 additions and 21 deletions

View File

@ -0,0 +1,58 @@
args : with args;
rec {
phaseNames = ["doAggregate"];
name = "TeXLive-linkdir";
buildInputs = lib.closePropagation paths;
doAggregate = FullDepEntry (''
for currentPath in ${lib.concatStringsSep " " buildInputs}; do
echo Symlinking "$currentPath"
find $currentPath/share ! -type d | while read; do
REPLY="''${REPLY#$currentPath}"
ensureDir $out/"$(dirname "$REPLY")"
ln -fs $currentPath/"$REPLY" $out/"$REPLY"
echo
done | while read; do head -n 99 >/dev/null; echo -n .; done
echo
cp -Trfp $currentPath/libexec $out/libexec || true
done
rm -r $out/share/texmf-config
find $out/share/texmf -type d | while read; do
REPLY="''${REPLY#$out/share/texmf}"
ensureDir $out/share/texmf-config/"$REPLY"
done
ensureDir $out/bin
for i in $out/libexec/*/*; do
echo -ne "#! /bin/sh\\n$i \"\$@\"" >$out/bin/$(basename $i)
chmod a+x $out/bin/$(basename $i)
done
rm $out/share/texmf*/ls-R
for i in web2c texconfig fonts/map; do
cp -r $out/share/texmf/$i/* $out/share/texmf-config/$i || true
done
TEXMFCONFIG=$out/share/texmf-config HOME=$PWD PATH=$PATH:$out/bin updmap --syncwithtrees
PATH=$PATH:$out/bin mktexlsr $out/share/texmf*
TEXMFCONFIG=$out/share/texmf-config HOME=$PWD PATH=$PATH:$out/bin updmap --syncwithtrees
PATH=$PATH:$out/bin mktexlsr $out/share/texmf*
'') ["minInit" "defEnsureDir" "addInputs"];
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
directories take precedence. It is supposed that
share and libexec are symlinked, and bin is
recreated with wrappers for libexec-located
linked binaries.
'';
};
}

View File

@ -0,0 +1,20 @@
args: with args;
rec {
name = "texlive-beamer-2007";
src = fetchurl {
url = http://ftp.de.debian.org/debian/pool/main/l/latex-beamer/latex-beamer_3.07.orig.tar.gz;
sha256 = "07ldhg5f0hcnhjgzg5g8ailqacn8zhqc8nl2jkxc43c2qxbvswbv";
};
buildInputs = [texLive];
propagatedBuildInputs = [texLiveLatexXColor texLivePGF];
phaseNames = ["doCopy"];
doCopy = FullDepEntry (''
ensureDir $out/share/texmf-dist/tex/latex/beamer
cp -r * $out/share/texmf-dist/tex/latex/beamer
'') ["minInit" "doUnpack" "defEnsureDir" "addInputs"];
meta = {
description = "Extra components for TeXLive: beamer class";
};
}

View File

@ -0,0 +1,27 @@
args: with args;
rec {
name = "texlive-cm-super-2007";
src = fetchurl {
url = ftp://195.178.192.118/debian/pool/main/c/cm-super/cm-super_0.3.3.orig.tar.gz;
sha256 = "1lxvnhqds2zi6ssz66r1b7s6p855lab7cgp0hdg247zkacbjxcfg";
};
phaseNames = ["doCopy"];
doCopy = FullDepEntry (''
ensureDir $out/share/texmf/fonts/enc
ensureDir $out/share/texmf/fonts/map
ensureDir $out/share/texmf/fonts/type1/public/cm-super
cp pfb/*.pfb $out/share/texmf/fonts/type1/public/cm-super
ensureDir $out/share/texmf/dvips/cm-super
cp dvips/*.{map,enc} $out/share/texmf/dvips/cm-super
cp dvips/*.enc $out/share/texmf/fonts/enc
cp dvips/*.map $out/share/texmf/fonts/map
ensureDir $out/share/texmf/dvipdfm/config
cp dvipdfm/*.map $out/share/texmf/dvipdfm/config
'') ["minInit" "doUnpack" "defEnsureDir" "addInputs"];
buildInputs = [texLive];
meta = {
description = "Extra components for TeXLive: CM-Super fonts";
};
}

View File

@ -15,11 +15,6 @@ rec {
sha256 = "0cmd9ryd57rzzg7g2gm3qn4ijakkacy810h5zncqd39p3i1yn6nx";
};
cmSuperSrc = fetchurl {
url = ftp://195.178.192.118/debian/pool/main/c/cm-super/cm-super_0.3.3.orig.tar.gz;
sha256 = "1lxvnhqds2zi6ssz66r1b7s6p855lab7cgp0hdg247zkacbjxcfg";
};
setupHook = ./setup-hook.sh;
doPreConfigure = FullDepEntry (''
@ -39,18 +34,6 @@ rec {
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${icu}/include/layout";
'') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
doInstallCMSuper = FullDepEntry (''
tar xf ${cmSuperSrc}
ensureDir $out/share/texmf/fonts/type1/public/cm-super
cp cm-super-*/pfb/*.pfb $out/share/texmf/fonts/type1/public/cm-super
ensureDir $out/share/texmf/dvips/cm-super
cp cm-super-*/dvips/*.{map,enc} $out/share/texmf/dvips/cm-super
cp cm-super-*/dvips/*.enc $out/share/texmf/fonts/enc
cp cm-super-*/dvips/*.map $out/share/texmf/fonts/map
ensureDir $out/share/texmf/dvipdfm/config
cp cm-super-*/dvipdfm/*.map $out/share/texmf/dvipdfm/config
'') ["minInit" "defEnsureDir" "doPreConfigure"];
doPostInstall = FullDepEntry(''
mv $out/bin $out/libexec
ensureDir $out/bin
@ -90,11 +73,11 @@ rec {
];
phaseNames = ["doPreConfigure" "doConfigure"
"doInstallCMSuper" "doMakeInstall" "doPostInstall"];
"doMakeInstall" "doPostInstall"];
name = "texlive-core-2007";
meta = {
description = "A TeX distribution";
srcs = [texmfSrc langTexmfSrc cmSuperSrc];
srcs = [texmfSrc langTexmfSrc];
};
}

View File

@ -0,0 +1,19 @@
args: with args;
rec {
name = "texlive-extra-2007";
src = fetchurl {
url = ftp://ftp.ru.debian.org/debian/pool/main/t/texlive-extra/texlive-extra_2007.dfsg.1.orig.tar.gz;
sha256 = "1440495dcsrwhnz1p1prs4rf84ca0v7fjwg7sdw7isnprnpiq7w5";
};
buildInputs = [texLive];
phaseNames = ["doCopy"];
doCopy = FullDepEntry (''
ensureDir $out/share
cp -r texmf* $out/share/
'') ["minInit" "doUnpack" "defEnsureDir" "addInputs"];
meta = {
description = "Extra components for TeXLive";
};
}

View File

@ -0,0 +1,20 @@
args: with args;
rec {
name = "texlive-pgf-2007";
src = fetchurl {
url = http://ftp.de.debian.org/debian/pool/main/p/pgf/pgf_1.18.orig.tar.gz;
sha256 = "1fk0m3rqsgdrxp2n6mbhh92819g1133w67lbgk66pqgspbrnk6h2";
};
propagatedBuildInputs = [texLiveLatexXColor texLive];
phaseNames = ["doCopy"];
doCopy = FullDepEntry (''
ensureDir $out/share/texmf/tex/generic/pgf
cp -r * $out/share/texmf/tex/generic/pgf
'') ["minInit" "doUnpack" "defEnsureDir" "addInputs"];
meta = {
description = "Extra components for TeXLive: graphics package";
};
}

View File

@ -0,0 +1,34 @@
args: with args;
rec {
name = "texlive-latex-xcolor-2007";
src = fetchurl {
url = http://ftp.de.debian.org/debian/pool/main/l/latex-xcolor/latex-xcolor_2.11.orig.tar.gz;
sha256 = "0z78xfn5iq5ncg82sd6v2qrxs8p9hs3m4agaz90p4db5dvk2w0mn";
};
buildInputs = [texLive];
phaseNames = ["doCopy"];
doCopy = FullDepEntry (''
export HOME=$PWD
ensureDir $out/share/texmf/tex/latex/xcolor
ensureDir $out/share/texmf/dvips/xcolor
latex xcolor.ins
cp *.sty *.def $out/share/texmf/tex/latex/xcolor
cp *.pro $out/share/texmf/dvips/xcolor
latex xcolor.dtx
latex xcolor.dtx
makeindex -s gind.ist xcolor.idx
latex xcolor.dtx
latex xcolor.dtx
rm *.sty *.pro *.ins *.def *.dtx
ensureDir $out/share/texmf/doc/latex-xcolor
cp * $out/share/texmf/doc/latex-xcolor
'') ["minInit" "doUnpack" "defEnsureDir" "addInputs"];
meta = {
description = "Extra components for TeXLive: LaTeX color support";
};
}

View File

@ -6167,7 +6167,42 @@ let pkgs = rec {
ghostscript = ghostscriptX;
};
/* Look in configurations/misc/raskin.nix for usage example (around revisions
where TeXLive was added)
(texLiveAggregationFun {
paths = [texLive texLiveExtra texLiveCMSuper
texLiveBeamer
];
} null)
*/
texLive = texLiveFun null;
texLiveAggregationFun = builderDefsPackage (import ../misc/tex/texlive/aggregate.nix);
texLiveExtraFun = builderDefsPackage (import ../misc/tex/texlive/extra.nix) {
inherit texLive;
};
texLiveExtra = texLiveExtraFun null;
texLiveCMSuperFun = builderDefsPackage (import ../misc/tex/texlive/cm-super.nix) {
inherit texLive;
};
texLiveCMSuper = texLiveCMSuperFun null;
texLiveLatexXColorFun = builderDefsPackage (import ../misc/tex/texlive/xcolor.nix) {
inherit texLive;
};
texLiveLatexXColor = texLiveLatexXColorFun null;
texLivePGFFun = builderDefsPackage (import ../misc/tex/texlive/pgf.nix) {
inherit texLiveLatexXColor texLive;
};
texLivePGF = texLivePGFFun null;
texLiveBeamerFun = builderDefsPackage (import ../misc/tex/texlive/beamer.nix) {
inherit texLiveLatexXColor texLivePGF texLive;
};
texLiveBeamer = texLiveBeamerFun null;
toolbuslib = import ../development/libraries/toolbuslib {
inherit stdenv fetchurl aterm;

View File

@ -389,16 +389,20 @@ args: with args; with stringsWithDeps; with lib;
phaseNames = args.phaseNames ++
["doForceShare" "doPropagate"];
extraDerivationAttrs = lib.getAttr ["extraDerivationAttrs"] {} args;
builderDefsPackage = bd: func: args: (
let localDefs = bd (func ((bd null) // args)) args null; in
stdenv.mkDerivation (rec {
stdenv.mkDerivation ((rec {
inherit (localDefs) name;
builder = writeScript (name + "-builder")
(textClosure localDefs localDefs.phaseNames);
meta = localDefs.meta // {inherit src;};
})
}) // (if localDefs ? propagatedBuildInputs then {
inherit (localDefs) propagatedBuildInputs;
} else {}) // extraDerivationAttrs)
);
}) // args