@@ -1,6 +1,8 @@
11{ stdenv, lib, buildPackages, haskellLib, ghc, nonReinstallablePkgs, hsPkgs, makeSetupConfigFiles }:
22
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
5+}:
46
57let
68 component = {
@@ -31,6 +33,9 @@ let
3133 inherit (package) identifier;
3234 inherit fullName flags component;
3335 };
36+ hooks = haskellLib.optionalHooks {
37+ inherit preUnpack postUnpack;
38+ };
3439
3540in
3641 stdenv.lib.fix (drv:
@@ -66,5 +71,6 @@ in
6671 install ./Setup $out/bin/Setup
6772 '';
6873 }
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; })
75+ // hooks
7076 ))