Changed builderDefs to use composedArgsAndFun, reduced number of nulls, made overrides in builderDefsPackage to work in an intuitive manner.
svn path=/nixpkgs/trunk/; revision=12655wip/yesman
parent
b5b68ce414
commit
87ff8d6347
@ -1,51 +1,60 @@ |
||||
args : with args; |
||||
let localDefs = builderDefs { |
||||
src = |
||||
fetchurl { |
||||
url = http://downloads.sourceforge.net/snd/snd-9.4.tar.gz; |
||||
sha256 = "0zqgfnkvkqxby1k74mwba1r4pb520glcsz5jjmpzm9m41nqnghmm"; |
||||
}; |
||||
args : |
||||
let |
||||
lib = args.lib; |
||||
fetchurl = args.fetchurl; |
||||
FullDepEntry = args.FullDepEntry; |
||||
|
||||
buildInputs = [gtk glib pkgconfig libXpm gmp gettext libX11 fftw] |
||||
++ (lib.optional (args ? ruby) args.ruby) |
||||
++ (lib.optional (args ? mesa) args.mesa) |
||||
++ (lib.optional (args ? guile) args.guile) |
||||
++ (lib.optional (args ? libtool) args.libtool) |
||||
++ (lib.optional (args ? sndlib) args.sndlib) |
||||
++ (lib.optional (args ? alsaLib) args.alsaLib) |
||||
++ (lib.optional (args ? jackaudio) args.jackaudio) |
||||
; |
||||
configureFlags = ["--with-gtk" "--with-xpm"] |
||||
++ (lib.optional (args ? ruby) "--with-ruby" ) |
||||
++ (lib.optional (args ? mesa) "--with-gl" ) |
||||
++ (lib.optional (args ? guile) "--with-guile") |
||||
++ (lib.optional (args ? sndlib) "--with-midi" ) |
||||
++ (lib.optional (args ? alsaLib) "--with-alsa") |
||||
++ (lib.optional (args ? jackaudio) "--with-jack" ) |
||||
++ [ "--with-fftw" "--htmldir=$out/share/snd/html" "--with-doc-dir=$out/share/snd/html" ] |
||||
; |
||||
} null; /* null is a terminator for sumArgs */ |
||||
in with localDefs; |
||||
let makeDocsWork = FullDepEntry '' |
||||
version = lib.getAttr ["version"] "9.4" args; |
||||
buildInputs = with args; [gtk glib pkgconfig |
||||
libXpm gmp gettext libX11 fftw] |
||||
++ (lib.optional (args ? ruby) args.ruby) |
||||
++ (lib.optional (args ? mesa) args.mesa) |
||||
++ (lib.optional (args ? guile) args.guile) |
||||
++ (lib.optional (args ? libtool) args.libtool) |
||||
++ (lib.optional (args ? sndlib) args.sndlib) |
||||
++ (lib.optional (args ? alsaLib) args.alsaLib) |
||||
++ (lib.optional (args ? jackaudio) args.jackaudio) |
||||
; |
||||
configureFlags = ["--with-gtk" "--with-xpm"] |
||||
++ (lib.optional (args ? ruby) "--with-ruby" ) |
||||
++ (lib.optional (args ? mesa) "--with-gl" ) |
||||
++ (lib.optional (args ? guile) "--with-guile") |
||||
++ (lib.optional (args ? sndlib) "--with-midi" ) |
||||
++ (lib.optional (args ? alsaLib) "--with-alsa") |
||||
++ (lib.optional (args ? jackaudio) "--with-jack" ) |
||||
++ [ "--with-fftw" "--htmldir=$out/share/snd/html" "--with-doc-dir=$out/share/snd/html" ] |
||||
; |
||||
in |
||||
rec { |
||||
src = fetchurl { |
||||
url = "http://downloads.sourceforge.net/snd/snd-${version}.tar.gz"; |
||||
sha256 = "0zqgfnkvkqxby1k74mwba1r4pb520glcsz5jjmpzm9m41nqnghmm"; |
||||
}; |
||||
|
||||
inherit buildInputs; |
||||
configureFlags = []; |
||||
|
||||
/* doConfigure should be specified separately */ |
||||
phaseNames = ["doConfigure" "preBuild" "makeDocsWork" |
||||
"doMakeInstall" "doForceShare"]; |
||||
|
||||
makeDocsWork = FullDepEntry '' |
||||
# hackish way to make html docs work |
||||
h="$out/share/snd/html"; ensureDir "$h"; cp *.html "$h" |
||||
patch -p1 < ${./doc.patch} |
||||
sed "s@HTML-DIR@$h@" -i index.scm snd-help.c |
||||
'' [defEnsureDir]; |
||||
'' ["defEnsureDir"]; |
||||
|
||||
preBuild = FullDepEntry ('' |
||||
preBuild = FullDepEntry ('' |
||||
cp config.log /tmp/snd-config.log |
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -L${libX11}/lib -lX11" |
||||
export NIX_LDFLAGS="$NIX_LDFLAGS -L${args.libX11}/lib -lX11" |
||||
|
||||
'') [minInit doUnpack makeDocsWork]; |
||||
in |
||||
stdenv.mkDerivation rec { |
||||
name = "Snd-9.4"; |
||||
builder = writeScript (name + "-builder") |
||||
(textClosure localDefs [doConfigure preBuild makeDocsWork doMakeInstall doForceShare ]); |
||||
meta = { |
||||
description = "Snd sound editor."; |
||||
homepage = http://ccrma.stanford.edu/software/snd; |
||||
inherit src; |
||||
}; |
||||
'') ["minInit" "doUnpack" "makeDocsWork"]; |
||||
|
||||
name = "Snd-" + version; |
||||
meta = { |
||||
description = "Snd sound editor."; |
||||
homepage = http://ccrma.stanford.edu/software/snd; |
||||
inherit src; |
||||
}; |
||||
} |
||||
|
@ -0,0 +1,26 @@ |
||||
args : |
||||
let |
||||
lib = args.lib; |
||||
fetchurl = args.fetchurl; |
||||
simplyShare = args.simplyShare; |
||||
|
||||
version = lib.getAttr ["version"] "2.0.0" args; |
||||
buildInputs = with args; [ ]; |
||||
in |
||||
rec { |
||||
src = fetchurl { |
||||
url = http://weitz.de/files/cl-ppcre.tar.gz; |
||||
sha256 = "14zxrmc4b4q9kg505y9lb0nqp80fpmpwn51xwkqiwkm361n6h23p"; |
||||
}; |
||||
|
||||
inherit buildInputs; |
||||
configureFlags = []; |
||||
|
||||
/* doConfigure should be specified separately */ |
||||
phaseNames = [(simplyShare "cl-ppcre")]; |
||||
|
||||
name = "cl-ppcre-" + version; |
||||
meta = { |
||||
description = "Common Lisp Portable Perl Compatible RegExp library"; |
||||
}; |
||||
} |
@ -1,24 +1,24 @@ |
||||
args : with args; with builderDefs {src="";} null; |
||||
let localDefs = builderDefs (rec { |
||||
src = /* put a fetchurl here */ |
||||
fetchurl { |
||||
url = ftp://ftp.dict.org/pub/dict/dictd-1.9.15.tar.gz; |
||||
sha256 = "0p41yf72l0igmshz6vxy3hm51z25600vrnb9j2jpgws4c03fqnac"; |
||||
}; |
||||
args : with args; with builderDefs; |
||||
let localDefs = builderDefs.meta.function ((rec { |
||||
src = /* put a fetchurl here */ |
||||
fetchurl { |
||||
url = ftp://ftp.dict.org/pub/dict/dictd-1.9.15.tar.gz; |
||||
sha256 = "0p41yf72l0igmshz6vxy3hm51z25600vrnb9j2jpgws4c03fqnac"; |
||||
}; |
||||
|
||||
buildInputs = [flex bison which]; |
||||
configureFlags = [ " --datadir=/var/run/current-system/share/dictd " ]; |
||||
}) args null; /* null is a terminator for sumArgs */ |
||||
in with localDefs; |
||||
buildInputs = [flex bison which]; |
||||
configureFlags = [ " --datadir=/var/run/current-system/share/dictd " ]; |
||||
}) // args); |
||||
in with localDefs; |
||||
stdenv.mkDerivation rec { |
||||
name = "dict-"+version; |
||||
builder = writeScript (name + "-builder") |
||||
(textClosure localDefs |
||||
[doConfigure doMakeInstall doForceShare doPropagate]); |
||||
meta = { |
||||
description = " |
||||
Dict protocol server and client. |
||||
name = "dict-"+version; |
||||
builder = writeScript (name + "-builder") |
||||
(textClosure localDefs |
||||
[doConfigure doMakeInstall doForceShare doPropagate]); |
||||
meta = { |
||||
description = " |
||||
Dict protocol server and client. |
||||
"; |
||||
inherit src; |
||||
}; |
||||
inherit src; |
||||
}; |
||||
} |
||||
|
Loading…
Reference in new issue