3
0
Fork 0
forked from mirrors/nixpkgs

Some refactorings in builderDefs. Psi is a simple showcase. TeXLive now works as far as English is concerned, and it is also updated up to newest builderDefs.

svn path=/nixpkgs/trunk/; revision=11235
This commit is contained in:
Michael Raskin 2008-03-20 15:40:26 +00:00
parent 95f0e6a1a7
commit 5f2bcdbdb6
6 changed files with 123 additions and 110 deletions

View file

@ -1,8 +1,6 @@
args : with args;
args : with args; with builderDefs {src="";} null; rec {
let localDefs = builderDefs (rec { src = fetchurl {
src = /* put a fetchurl here */
fetchurl {
url = ftp://ftp.ru.debian.org/debian/pool/main/p/psi/psi_0.11.orig.tar.gz; url = ftp://ftp.ru.debian.org/debian/pool/main/p/psi/psi_0.11.orig.tar.gz;
sha256 = "1rgjahngari4pwhi0zz9mricaaqxkk8ry8w6s1vgsq3zwa2l5x57"; sha256 = "1rgjahngari4pwhi0zz9mricaaqxkk8ry8w6s1vgsq3zwa2l5x57";
}; };
@ -12,19 +10,11 @@ args : with args; with builderDefs {src="";} null;
configureFlags = [" --with-zlib-inc=${zlib}/include " configureFlags = [" --with-zlib-inc=${zlib}/include "
" --with-openssl-inc=${openssl}/include " " --with-openssl-inc=${openssl}/include "
]; ];
}) args null; /* null is a terminator for sumArgs */
in with localDefs; phaseNames = ["doConfigure" "doMakeInstall"];
stdenv.mkDerivation rec {
name = "psi-"+version; name = "psi-" + version;
MAKE="make";
builder = writeScript (name + "-builder")
(textClosure localDefs
["doConfigure" "doMakeInstall" doForceShare doPropagate]);
meta = { meta = {
description = " description = "Psi, an XMPP (Jabber) client";
Psi, an XMPP (Jabber) client.
";
inherit src;
}; };
} }

View file

@ -1,44 +1,43 @@
args : with args; with builderDefs {src="";} null; args : with args;
let localDefs = builderDefs (rec { rec {
src = /* put a fetchurl here */ src = fetchurl {
fetchurl { url = mirror://debian/pool/main/t/texlive-bin/texlive-bin_2007.orig.tar.gz;
url = debian://pool/main/t/texlive-bin/texlive-bin_2007.orig.tar.gz;
sha256 = "1fz5lqbigdrdg0pmaynissd7wn59p2yj9f203nl93dcpffrapxjv"; sha256 = "1fz5lqbigdrdg0pmaynissd7wn59p2yj9f203nl93dcpffrapxjv";
}; };
texmfSrc =
fetchurl { texmfSrc = fetchurl {
url = debian://pool/main/t/texlive-base/texlive-base_2007.orig.tar.gz; url = mirror://debian/pool/main/t/texlive-base/texlive-base_2007.orig.tar.gz;
sha256 = "16a4dyliidk43qj0m4gpsl9ln7nqsdcdx1lkbk4wrm03xpx87zvh"; sha256 = "16a4dyliidk43qj0m4gpsl9ln7nqsdcdx1lkbk4wrm03xpx87zvh";
}; };
langTexmfSrc = fetchurl {
url = mirror://debian/pool/main/t/texlive-lang/texlive-lang_2007.orig.tar.gz;
sha256 = "0cmd9ryd57rzzg7g2gm3qn4ijakkacy810h5zncqd39p3i1yn6nx";
};
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
doInstall = FullDepEntry ('' doPreConfigure = 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/share --strip-components=1 tar xf ${texmfSrc} -C $out/share --strip-components=1
tar xf ${langTexmfSrc} -C $out/share --strip-components=1
cp -r texmf* $out/share
cd build/source cd build/source
sed -e s@/usr/bin/@@g -i $(grep /usr/bin/ -rl . ) sed -e s@/usr/bin/@@g -i $(grep /usr/bin/ -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 's/.*pyhyph.*/=&/' -i $out/share/texmf-config/tex/generic/config/language.dat
updmap --syncwithtrees
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2" NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
echo NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${icu}/include/unicode"
NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${icu}/include/layout"; NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${icu}/include/layout";
./configure --prefix=$out \ '') ["minInit" "doUnpack" "addInputs" "defEnsureDir"];
--with-x11 \
--with-system-zlib \ doPostInstall = FullDepEntry(''
--with-system-freetype2 \
--with-system-t1lib \
--with-system-pnglib \
--with-system-gd \
--with-system-icu \
--with-system-ncurses \
--enable-ipc \
--with-mktexfmt
make
make install
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
@ -48,26 +47,33 @@ args : with args; with builderDefs {src="";} null;
texmf_var=$(mktemp -d /var/tmp/texmf-varXXXXXXXX) texmf_var=$(mktemp -d /var/tmp/texmf-varXXXXXXXX)
mv $out/share/texmf-var/* $texmf_var/ mv $out/share/texmf-var/* $texmf_var/
chmod -R a+rwX $texmf_var chmod -R a+rwX $texmf_var
ln -s $texmf_var $out/share/texmf-var rm -r $out/share/texmf-var
rm -r /var/tmp/texmf-var
ln -sfT $texmf_var $out/share/texmf-var
ln -sfT $texmf_var /var/tmp/texmf-var
ln -s $out/share/texmf $out/share/texmf-config ln -s $out/share/texmf $out/share/texmf-config
'') ["minInit" "defEnsureDir" "doUnpack" "addInputs"]; PATH=$PATH:$out/bin mktexlsr $out/share/texmf*
buildInputs = [zlib bzip2 ncurses libpng ed flex bison libX11 xproto '') ["minInit" "defEnsureDir" "doUnpack" "doMakeInstall"];
freetype t1lib gd libXaw icu ghostscript
buildInputs = [
zlib bzip2 ncurses libpng flex bison libX11 libICE
xproto freetype t1lib gd libXaw icu ghostscript ed
libXt libXpm libXmu libXext xextproto perl libSM libXt libXpm libXmu libXext xextproto perl libSM
libICE]; ];
configureFlags = [];
}) args null; /* null is a terminator for sumArgs */ configureFlags = [ "--with-x11" "--with-system-zlib"
in with localDefs; "--with-system-freetype2" "--with-system-t1lib"
stdenv.mkDerivation rec { "--with-system-pnglib" "--with-system-gd"
name = "TeXLive-core-2007"; "--with-system-icu" "--with-system-ncurses"
builder = writeScript (name + "-builder") "--enable-ipc" "--with-mktexfmt"
(textClosure localDefs ];
[doInstall doForceShare doPropagate]);
phaseNames = ["doPreConfigure" "doConfigure"
"doMakeInstall" "doPostInstall"];
name = "texlive-core-2007";
meta = { meta = {
description = " description = "A TeX distribution";
TeX distribution. srcs = [texmfSrc langTexmfSrc];
";
inherit src;
srcs = [texmfSrc];
}; };
} }

View file

@ -270,6 +270,9 @@ let pkgs = rec {
inherit stringsWithDeps lib stdenv writeScript fetchurl; inherit stringsWithDeps lib stdenv writeScript fetchurl;
}; };
builderDefsPackage = expr: lib.sumArgs
(((builderDefs null).builderDefsPackage builderDefs) expr);
stringsWithDeps = import ../lib/strings-with-deps.nix { stringsWithDeps = import ../lib/strings-with-deps.nix {
inherit stdenv lib; inherit stdenv lib;
}; };
@ -6076,7 +6079,9 @@ let pkgs = rec {
inherit fetchurl stdenv tetex lazylist; inherit fetchurl stdenv tetex lazylist;
}; };
psiFun = lib.sumArgs (selectVersion ../applications/networking/instant-messengers/psi "0.11") { psiFun = builderDefsPackage
(selectVersion ../applications/networking/instant-messengers/psi "0.11")
{
inherit builderDefs zlib aspell sox openssl; inherit builderDefs zlib aspell sox openssl;
inherit (xlibs) xproto libX11 libSM libICE; inherit (xlibs) xproto libX11 libSM libICE;
qt = qt4; qt = qt4;
@ -6146,7 +6151,7 @@ let pkgs = rec {
inherit stdenv perl tetex graphviz ghostscript; inherit stdenv perl tetex graphviz ghostscript;
}; };
texLiveFun = lib.sumArgs (import ../misc/tex/texlive) { texLiveFun = builderDefsPackage (import ../misc/tex/texlive) {
inherit builderDefs zlib bzip2 ncurses libpng ed inherit builderDefs zlib bzip2 ncurses libpng ed
gd t1lib freetype icu perl; gd t1lib freetype icu perl;
inherit (xlibs) libXaw libX11 xproto libXt libXpm inherit (xlibs) libXaw libX11 xproto libXt libXpm

View file

@ -3,6 +3,8 @@ args: with args; with stringsWithDeps; with lib;
{ {
inherit writeScript; inherit writeScript;
src = getAttr ["src"] "" args;
addSbinPath = getAttr ["addSbinPath"] false args; addSbinPath = getAttr ["addSbinPath"] false args;
forceShare = if args ? forceShare then args.forceShare else ["man" "doc" "info"]; forceShare = if args ? forceShare then args.forceShare else ["man" "doc" "info"];
@ -385,4 +387,18 @@ args: with args; with stringsWithDeps; with lib;
GHC_PACKAGE_PATH=\$PACKAGE_DB ./register.sh GHC_PACKAGE_PATH=\$PACKAGE_DB ./register.sh
" ["defCreateEmptyPackageDatabaseAndSetupHook" "defCabalSetupCmd"]; " ["defCreateEmptyPackageDatabaseAndSetupHook" "defCabalSetupCmd"];
phaseNames = args.phaseNames ++
["doForceShare" "doPropagate"];
builderDefsPackage = bd: func: args: (
let localDefs = bd (func ((bd null) // args)) args null; in
stdenv.mkDerivation (rec {
inherit (localDefs) name;
builder = writeScript (name + "-builder")
(textClosure localDefs localDefs.phaseNames);
meta = localDefs.meta // {inherit src;};
})
);
}) // args }) // args

View file

@ -16,9 +16,7 @@ stdenv.mkDerivation rec {
builder = writeScript (name + "-builder") builder = writeScript (name + "-builder")
(textClosure localDefs [(abort "Check phases") doMakeInstall doForceShare doPropagate]); (textClosure localDefs [(abort "Check phases") doMakeInstall doForceShare doPropagate]);
meta = { meta = {
description = " description = "${(abort "Specify description")}";
${(abort "Specify description")}
";
inherit src; inherit src;
}; };
} }

View file

@ -1,4 +1,4 @@
args : with args; with builderDefs {src="";} null; args : with args; with builderDefs null;
let localDefs = builderDefs (rec { let localDefs = builderDefs (rec {
src = /* put a fetchurl here */ src = /* put a fetchurl here */
@ -12,9 +12,7 @@ stdenv.mkDerivation rec {
(textClosure localDefs (textClosure localDefs
[(abort "Specify phases - defined here or in builderDefs") doForceShare doPropagate]); [(abort "Specify phases - defined here or in builderDefs") doForceShare doPropagate]);
meta = { meta = {
description = " description = "${abort "Write a description"}";
${abort "Write a description"}
";
inherit src; inherit src;
}; };
} }