@@ -14,13 +14,20 @@ lib.makeOverridable (
1414, patches ? []
1515
1616, preUnpack ? component.preUnpack, postUnpack ? component.postUnpack
17+, configureFlags ? component.configureFlags
1718, preConfigure ? component.preConfigure, postConfigure ? component.postConfigure
19+, setupBuildFlags ? component.setupBuildFlags
1820, preBuild ? component.preBuild , postBuild ? component.postBuild
1921, preCheck ? component.preCheck , postCheck ? component.postCheck
22+, setupInstallFlags ? component.setupInstallFlags
2023, preInstall ? component.preInstall , postInstall ? component.postInstall
2124, preHaddock ? component.preHaddock , postHaddock ? component.postHaddock
2225, shellHook ? ""
2326
27+, pkgconfig ? component.pkgconfig
28+, platforms ? component.platforms
29+, frameworks ? component.frameworks
30+
2431, dontPatchELF ? component.dontPatchELF
2532, dontStrip ? component.dontStrip
2633
@@ -33,6 +40,7 @@ lib.makeOverridable (
3340, doHoogle ? component.doHoogle # Also build a hoogle index
3441, hyperlinkSource ? component.doHyperlinkSource # Link documentation to the source code
3542, keepSource ? component.keepSource # Build from `source` output in the store then delete `dist`
43+, setupHaddockFlags ? component.setupHaddockFlags
3644
3745# Profiling
3846, enableLibraryProfiling ? component.enableLibraryProfiling
@@ -116,7 +124,7 @@ let
116124 ++ lib.optionals haskellLib.isCrossHost (
117125 map (arg: "--hsc2hs-option=" + arg) (["--cross-compile"] ++ lib.optionals (stdenv.hostPlatform.isWindows) ["--via-asm"])
118126 ++ lib.optional (package.buildType == "Configure") "--configure-option=--host=${stdenv.hostPlatform.config}" )
119− ++ component.configureFlags
127+ ++ configureFlags
120128 ++ (ghc.extraConfigureFlags or [])
121129 ++ lib.optional enableDebugRTS "--ghc-option=-debug"
122130 );
@@ -127,7 +135,7 @@ let
127135 (lib.concatMap (c: if c.isHaskell or false
128136 then builtins.attrValues (c.components.exes or {})
129137 else [c]) component.build-tools) ++
130− lib.optional (component.pkgconfig != []) buildPackages.pkgconfig;
138+ lib.optional (pkgconfig != []) buildPackages.pkgconfig;
131139
132140 # Unfortunately, we need to wrap ghc commands for cabal builds to
133141 # work in the nix-shell. See ../doc/removing-with-package-wrapper.md.
@@ -184,7 +192,7 @@ stdenv.mkDerivation ({
184192 license-map = import ../lib/cabal-licenses.nix lib;
185193 in license-map.${package.license} or
186194 (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;
188196 };
189197
190198 LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase.
@@ -193,8 +201,8 @@ stdenv.mkDerivation ({
193201 enableParallelBuilding = true;
194202
195203 buildInputs = component.libs
196− ++ component.frameworks
197− ++ builtins.concatLists component.pkgconfig
204+ ++ frameworks
205+ ++ builtins.concatLists pkgconfig
198206 # Note: This is a hack until we can fix properly. See:
199207 # https://github.com/haskell-gi/haskell-gi/issues/226
200208 ++ lib.optional (lib.strings.hasPrefix "gi-" fullName) gobject-introspection;
@@ -236,7 +244,7 @@ stdenv.mkDerivation ({
236244 buildPhase = ''
237245 runHook preBuild
238246 # 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)}
240248 runHook postBuild
241249 '';
242250
@@ -253,7 +261,7 @@ stdenv.mkDerivation ({
253261 "--html" \
254262 ${lib.optionalString doHoogle "--hoogle"} \
255263 ${lib.optionalString hyperlinkSource "--hyperlink-source"} \
256− ${lib.concatStringsSep " " (component.setupHaddockFlags ++ setupGhcOptions)}
264+ ${lib.concatStringsSep " " (setupHaddockFlags ++ setupGhcOptions)}
257265
258266 html="dist/doc/html/${componentId.cname}"
259267
@@ -283,7 +291,7 @@ stdenv.mkDerivation ({
283291 target-pkg-and-db = "${ghc.targetPrefix}ghc-pkg -v0 --package-db $out/package.conf.d";
284292 in ''
285293 runHook preInstall
286− $SETUP_HS copy ${lib.concatStringsSep " " component.setupInstallFlags}
294+ $SETUP_HS copy ${lib.concatStringsSep " " setupInstallFlags}
287295 ${lib.optionalString (haskellLib.isLibrary componentId || haskellLib.isAll componentId) ''
288296 $SETUP_HS register --gen-pkg-config=${name}.conf
289297 ${ghc.targetPrefix}ghc-pkg -v0 init $out/package.conf.d