@@ -9,7 +9,12 @@
10, cabalFile
10, cabalFile
11, patches ? []
11, patches ? []
12−, postUnpack ? null
13+, preUnpack ? null, postUnpack ? null
14+, preConfigure ? null, postConfigure ? null
15+, preBuild ? null, postBuild ? null
16+, preCheck ? null, postCheck ? null
17+, preInstall ? null, postInstall ? null
@@ -160,29 +165,46 @@ in stdenv.mkDerivation ({
162 configurePhase = ''
167 configurePhase = ''
168+ runHook preConfigure
163 echo Configure flags:
169 echo Configure flags:
164 printf "%q " ${finalConfigureFlags}
170 printf "%q " ${finalConfigureFlags}
166 $SETUP_HS configure ${finalConfigureFlags}
172 $SETUP_HS configure ${finalConfigureFlags}
173+ runHook postConfigure
169 buildPhase = ''
176 buildPhase = ''
170 $SETUP_HS build -j$NIX_BUILD_CORES ${lib.concatStringsSep " " component.setupBuildFlags}
178 $SETUP_HS build -j$NIX_BUILD_CORES ${lib.concatStringsSep " " component.setupBuildFlags}
173 checkPhase = ''
182 checkPhase = ''
174 $SETUP_HS test
184 $SETUP_HS test
177 installPhase = ''
188 installPhase = ''
178 $SETUP_HS copy
190 $SETUP_HS copy
179 ${lib.optionalString (haskellLib.isLibrary componentId) ''
191 ${lib.optionalString (haskellLib.isLibrary componentId) ''
180 $SETUP_HS register --gen-pkg-config=${name}.conf
192 $SETUP_HS register --gen-pkg-config=${name}.conf
181 ${ghc.targetPrefix}ghc-pkg init $out/package.conf.d
193 ${ghc.targetPrefix}ghc-pkg init $out/package.conf.d
182 ${ghc.targetPrefix}ghc-pkg --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
194 ${ghc.targetPrefix}ghc-pkg --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
186// lib.optionalAttrs (patches != []) { inherit patches; }
199// lib.optionalAttrs (patches != []) { inherit patches; }
200+// lib.optionalAttrs (preUnpack != "") { inherit preUnpack; }
187−// lib.optionalAttrs (postUnpack != null) { inherit postUnpack; }
201+// lib.optionalAttrs (postUnpack != "") { inherit postUnpack; }
202+// lib.optionalAttrs (preConfigure != "") { inherit preConfigure; }
203+// lib.optionalAttrs (postConfigure != "") { inherit postConfigure; }
204+// lib.optionalAttrs (preBuild != "") { inherit preBuild; }
205+// lib.optionalAttrs (postBuild != "") { inherit postBuild; }
206+// lib.optionalAttrs (preCheck != "") { inherit preCheck; }
207+// lib.optionalAttrs (postCheck != "") { inherit postCheck; }
208+// lib.optionalAttrs (preInstall != "") { inherit preInstall; }
209+// lib.optionalAttrs (postInstall != "") { inherit postInstall; }