about summary refs log tree commit diff
path: root/pkgs/applications/audio/snd/default.nix
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2008-08-19 05:54:09 +0000
committerMichael Raskin <7c6f434c@mail.ru>2008-08-19 05:54:09 +0000
commit87ff8d6347cd99618bc8f9ff58ddf357ce38c522 (patch)
tree304d18d1a67cf9e844bf9d772b2a5386d00aa5f0 /pkgs/applications/audio/snd/default.nix
parentb5b68ce414fabb63a782dd74e86e940350e9a662 (diff)
downloadnixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.tar
nixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.tar.gz
nixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.tar.bz2
nixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.tar.lz
nixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.tar.xz
nixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.tar.zst
nixlib-87ff8d6347cd99618bc8f9ff58ddf357ce38c522.zip
Changed builderDefs to use composedArgsAndFun, reduced number of nulls, made overrides in builderDefsPackage to work in an intuitive manner.
svn path=/nixpkgs/trunk/; revision=12655
Diffstat (limited to 'pkgs/applications/audio/snd/default.nix')
-rw-r--r--pkgs/applications/audio/snd/default.nix93
1 files changed, 51 insertions, 42 deletions
diff --git a/pkgs/applications/audio/snd/default.nix b/pkgs/applications/audio/snd/default.nix
index 0a8bb95173f3..a8eb2de8e1a7 100644
--- a/pkgs/applications/audio/snd/default.nix
+++ b/pkgs/applications/audio/snd/default.nix
@@ -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;
+  };
 }