@@ -1,6 +1,8 @@
1{ stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles }:
1{ stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles }:
3−{ setup-depends, package, name, src, flags, revision, patches, defaultSetupSrc }:
3+{ setup-depends, package, name, src, flags, revision, patches, defaultSetupSrc
4+, preUnpack ? null, postUnpack ? null
6 component = {
8 component = {
@@ -31,6 +33,9 @@ let
31 inherit (package) identifier;
33 inherit (package) identifier;
32 inherit fullName flags component;
34 inherit fullName flags component;
36+ hooks = haskellLib.optionalHooks {
37+ inherit preUnpack postUnpack;
36 stdenv.lib.fix (drv:
41 stdenv.lib.fix (drv:
@@ -66,5 +71,6 @@ in
66 install ./Setup $out/bin/Setup
71 install ./Setup $out/bin/Setup
69− // lib.optionalAttrs (patches != []) { patches = map (p: if builtins.isFunction p then p { inherit (package.identifier) version; inherit revision; } else p) patches; }
74+ // (lib.optionalAttrs (patches != []) { patches = map (p: if builtins.isFunction p then p { inherit (package.identifier) version; inherit revision; } else p) patches; })