@@ -14,13 +14,20 @@ lib.makeOverridable (
14, patches ? []
14, patches ? []
16, preUnpack ? component.preUnpack, postUnpack ? component.postUnpack
16, preUnpack ? component.preUnpack, postUnpack ? component.postUnpack
17+, configureFlags ? component.configureFlags
17, preConfigure ? component.preConfigure, postConfigure ? component.postConfigure
18, preConfigure ? component.preConfigure, postConfigure ? component.postConfigure
19+, setupBuildFlags ? component.setupBuildFlags
18, preBuild ? component.preBuild , postBuild ? component.postBuild
20, preBuild ? component.preBuild , postBuild ? component.postBuild
19, preCheck ? component.preCheck , postCheck ? component.postCheck
21, preCheck ? component.preCheck , postCheck ? component.postCheck
22+, setupInstallFlags ? component.setupInstallFlags
20, preInstall ? component.preInstall , postInstall ? component.postInstall
23, preInstall ? component.preInstall , postInstall ? component.postInstall
21, preHaddock ? component.preHaddock , postHaddock ? component.postHaddock
24, preHaddock ? component.preHaddock , postHaddock ? component.postHaddock
22, shellHook ? ""
25, shellHook ? ""
27+, pkgconfig ? component.pkgconfig
28+, platforms ? component.platforms
29+, frameworks ? component.frameworks
24, dontPatchELF ? component.dontPatchELF
31, dontPatchELF ? component.dontPatchELF
25, dontStrip ? component.dontStrip
32, dontStrip ? component.dontStrip
@@ -33,6 +40,7 @@ lib.makeOverridable (
33, doHoogle ? component.doHoogle # Also build a hoogle index
40, doHoogle ? component.doHoogle # Also build a hoogle index
34, hyperlinkSource ? component.doHyperlinkSource # Link documentation to the source code
41, hyperlinkSource ? component.doHyperlinkSource # Link documentation to the source code
35, keepSource ? component.keepSource # Build from `source` output in the store then delete `dist`
42, keepSource ? component.keepSource # Build from `source` output in the store then delete `dist`
43+, setupHaddockFlags ? component.setupHaddockFlags
37# Profiling
45# Profiling
38, enableLibraryProfiling ? component.enableLibraryProfiling
46, enableLibraryProfiling ? component.enableLibraryProfiling
@@ -116,7 +124,7 @@ let
116 ++ lib.optionals haskellLib.isCrossHost (
124 ++ lib.optionals haskellLib.isCrossHost (
117 map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals (stdenv.hostPlatform.isWindows) ["--via-asm"])
125 map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals (stdenv.hostPlatform.isWindows) ["--via-asm"])
118 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}" )
126 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}" )
119− ++ component.configureFlags
127+ ++ configureFlags
120 ++ (ghc.extraConfigureFlags or [])
128 ++ (ghc.extraConfigureFlags or [])
121 ++ lib.optional enableDebugRTS "--ghc-option=-debug"
129 ++ lib.optional enableDebugRTS "--ghc-option=-debug"
@@ -127,7 +135,7 @@ let
127 (lib.concatMap (c: if c.isHaskell or false
135 (lib.concatMap (c: if c.isHaskell or false
128 then builtins.attrValues (c.components.exes or {})
136 then builtins.attrValues (c.components.exes or {})
129 else [c]) component.build-tools) ++
137 else [c]) component.build-tools) ++
130− lib.optional (component.pkgconfig != []) buildPackages.pkgconfig;
138+ lib.optional (pkgconfig != []) buildPackages.pkgconfig;
132 # Unfortunately, we need to wrap ghc commands for cabal builds to
140 # Unfortunately, we need to wrap ghc commands for cabal builds to
133 # work in the nix-shell. See ../doc/removing-with-package-wrapper.md.
141 # work in the nix-shell. See ../doc/removing-with-package-wrapper.md.
@@ -184,7 +192,7 @@ stdenv.mkDerivation ({
184 license-map = import ../lib/cabal-licenses.nix lib;
192 license-map = import ../lib/cabal-licenses.nix lib;
185 in license-map.${package.license} or
193 in license-map.${package.license} or
186 (builtins.trace "WARNING: license \"${package.license}\" not found" license-map.LicenseRef-OtherLicense);
194 (builtins.trace "WARNING: license \"${package.license}\" not found" license-map.LicenseRef-OtherLicense);
187− platforms = if component.platforms == null then stdenv.lib.platforms.all else component.platforms;
195+ platforms = if platforms == null then stdenv.lib.platforms.all else platforms;
190 LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase.
198 LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase.
@@ -193,8 +201,8 @@ stdenv.mkDerivation ({
193 enableParallelBuilding = true;
201 enableParallelBuilding = true;
195 buildInputs = component.libs
203 buildInputs = component.libs
196− ++ component.frameworks
204+ ++ frameworks
197− ++ builtins.concatLists component.pkgconfig
205+ ++ builtins.concatLists pkgconfig
198 # Note: This is a hack until we can fix properly. See:
206 # Note: This is a hack until we can fix properly. See:
199 # https://github.com/haskell-gi/haskell-gi/issues/226
207 # https://github.com/haskell-gi/haskell-gi/issues/226
200 ++ lib.optional (lib.strings.hasPrefix "gi-" fullName) gobject-introspection;
208 ++ lib.optional (lib.strings.hasPrefix "gi-" fullName) gobject-introspection;
@@ -236,7 +244,7 @@ stdenv.mkDerivation ({
236 buildPhase = ''
244 buildPhase = ''
237 runHook preBuild
245 runHook preBuild
238 # https://gitlab.haskell.org/ghc/ghc/issues/9221
246 # https://gitlab.haskell.org/ghc/ghc/issues/9221
239− $SETUP_HS build ${haskellLib.componentTarget componentId} -j$(($NIX_BUILD_CORES > 4 ? 4 : $NIX_BUILD_CORES)) ${lib.concatStringsSep " " (component.setupBuildFlags ++ setupGhcOptions)}
247+ $SETUP_HS build ${haskellLib.componentTarget componentId} -j$(($NIX_BUILD_CORES > 4 ? 4 : $NIX_BUILD_CORES)) ${lib.concatStringsSep " " (setupBuildFlags ++ setupGhcOptions)}
240 runHook postBuild
248 runHook postBuild
@@ -253,7 +261,7 @@ stdenv.mkDerivation ({
253 "--html" \
261 "--html" \
254 ${lib.optionalString doHoogle "--hoogle"} \
262 ${lib.optionalString doHoogle "--hoogle"} \
255 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
263 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
256− ${lib.concatStringsSep " " (component.setupHaddockFlags ++ setupGhcOptions)}
264+ ${lib.concatStringsSep " " (setupHaddockFlags ++ setupGhcOptions)}
258 html="dist/doc/html/${componentId.cname}"
266 html="dist/doc/html/${componentId.cname}"
@@ -283,7 +291,7 @@ stdenv.mkDerivation ({
283 target-pkg-and-db = "${ghc.targetPrefix}ghc-pkg -v0 --package-db $out/package.conf.d";
291 target-pkg-and-db = "${ghc.targetPrefix}ghc-pkg -v0 --package-db $out/package.conf.d";
285 runHook preInstall
293 runHook preInstall
286− $SETUP_HS copy ${lib.concatStringsSep " " component.setupInstallFlags}
294+ $SETUP_HS copy ${lib.concatStringsSep " " setupInstallFlags}
287 ${lib.optionalString (haskellLib.isLibrary componentId || haskellLib.isAll componentId) ''
295 ${lib.optionalString (haskellLib.isLibrary componentId || haskellLib.isAll componentId) ''
288 $SETUP_HS register --gen-pkg-config=${name}.conf
296 $SETUP_HS register --gen-pkg-config=${name}.conf
289 ${ghc.targetPrefix}ghc-pkg -v0 init $out/package.conf.d
297 ${ghc.targetPrefix}ghc-pkg -v0 init $out/package.conf.d