From 8959aade3259a3dc4d3854c5a5eb3d9c88abfbb1 Mon Sep 17 00:00:00 2001
From: Peter Simons <simons@cryp.to>
Date: Mon, 19 Jan 2015 16:24:12 +0100
Subject: [PATCH] haskell-generic-builder: allow setting preUnpack and
 postUnpack hooks

This is useful for Hydra builds that have more than one package in the
same repository and need to change to the proper directory.
---
 pkgs/development/haskell-modules/generic-builder.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index 9fe6c1a78ba..db14869ad49 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -34,6 +34,7 @@
 , testDepends ? []
 , testTarget ? ""
 , broken ? false
+, preUnpack ? "", postUnpack ? ""
 , patches ? [], patchPhase ? "", prePatch ? "", postPatch ? ""
 , preConfigure ? "", postConfigure ? ""
 , preBuild ? "", postBuild ? ""
@@ -275,6 +276,8 @@ stdenv.mkDerivation ({
          ;
 
 }
+// optionalAttrs (preUnpack != "")      { inherit preUnpack; }
+// optionalAttrs (postUnpack != "")     { inherit postUnpack; }
 // optionalAttrs (configureFlags != []) { inherit configureFlags; }
 // optionalAttrs (patches != [])        { inherit patches; }
 // optionalAttrs (patchPhase != "")     { inherit patchPhase; }