From 1fe20228b9f3b8d5d041ce4c31d73cf276c48b88 Mon Sep 17 00:00:00 2001
From: Shea Levy <shea@shealevy.com>
Date: Sat, 3 Sep 2011 20:01:06 +0000
Subject: [PATCH] sphinxbase: Add flag to play with multiple outputs

svn path=/nixpkgs/trunk/; revision=28999
---
 .../libraries/sphinxbase/default.nix          | 22 ++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/pkgs/development/libraries/sphinxbase/default.nix b/pkgs/development/libraries/sphinxbase/default.nix
index 25b248177937..b025e9a68a9b 100644
--- a/pkgs/development/libraries/sphinxbase/default.nix
+++ b/pkgs/development/libraries/sphinxbase/default.nix
@@ -1,6 +1,11 @@
-{ stdenv, fetchurl, bison, pkgconfig }:
+{ stdenv
+, fetchurl
+, bison
+, pkgconfig
+, multipleOutputs ? false #Uses incomplete features of nix!
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   name = "sphinxbase-0.7";
 
   src = fetchurl {
@@ -16,4 +21,15 @@ stdenv.mkDerivation rec {
     license = "free-non-copyleft";
     maintainers = [ stdenv.lib.maintainers.shlevy ];
   };
-}
+} // (stdenv.lib.optionalAttrs multipleOutputs {
+  outputs = [ "out" "lib" "headers" ];
+
+  postInstall = ''
+    ensureDir $lib
+    cp -av $out/lib* $lib
+
+    ensureDir $headers
+    cp -av $out/include $headers
+  '';
+}))
+