@@ -37,6 +37,9 @@
37, enableLibraryProfiling ? component.enableLibraryProfiling
37, enableLibraryProfiling ? component.enableLibraryProfiling
38, enableExecutableProfiling ? component.enableExecutableProfiling
38, enableExecutableProfiling ? component.enableExecutableProfiling
39, profilingDetail ? component.profilingDetail
39, profilingDetail ? component.profilingDetail
42+, enableSeparateDataOutput ? component.enableSeparateDataOutput
@@ -69,7 +72,8 @@ let
69 (if dontStrip then "--disable-library-stripping" else "--enable-library-stripping")
72 (if dontStrip then "--disable-library-stripping" else "--enable-library-stripping")
70 (if enableLibraryProfiling then "--enable-library-profiling" else "--disable-library-profiling" )
73 (if enableLibraryProfiling then "--enable-library-profiling" else "--disable-library-profiling" )
71 (if enableExecutableProfiling then "--enable-executable-profiling" else "--disable-executable-profiling" )
74 (if enableExecutableProfiling then "--enable-executable-profiling" else "--disable-executable-profiling" )
75+ ] ++ lib.optional enableSeparateDataOutput "--datadir=$data/share/${ghc.name}"
72− ] ++ lib.optional doHaddock' "--docdir=${docdir "$doc"}"
76+ ++ lib.optional doHaddock' "--docdir=${docdir "$doc"}"
73 ++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}"
77 ++ lib.optional (enableLibraryProfiling || enableExecutableProfiling) "--profiling-detail=${profilingDetail}"
74 ++ lib.optional (deadCodeElimination && stdenv.hostPlatform.isLinux) "--enable-split-sections"
78 ++ lib.optional (deadCodeElimination && stdenv.hostPlatform.isLinux) "--enable-split-sections"
75 ++ lib.optional (static) "--enable-static"
79 ++ lib.optional (static) "--enable-static"
@@ -154,7 +158,9 @@ stdenv.mkDerivation ({
155 SETUP_HS = setup + /bin/Setup;
159 SETUP_HS = setup + /bin/Setup;
162+ ++ (lib.optional enableSeparateDataOutput "data")
157− outputs = ["out" ] ++ (lib.optional doHaddock' "doc");
163+ ++ (lib.optional doHaddock' "doc");
160 preInstallPhases = lib.optional doHaddock' "haddockPhase";
166 preInstallPhases = lib.optional doHaddock' "haddockPhase";
@@ -233,12 +239,15 @@ stdenv.mkDerivation ({
233 ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
239 ${ghc.targetPrefix}ghc-pkg -v0 --package-db ${configFiles}/package.conf.d -f $out/package.conf.d register ${name}.conf
236− ${lib.optionalString (haskellLib.isTest componentId || haskellLib.isBenchmark componentId || haskellLib.isAll componentId) ''
242+ ${(lib.optionalString (haskellLib.isTest componentId || haskellLib.isBenchmark componentId || haskellLib.isAll componentId) ''
237 mkdir -p $out/${name}
243 mkdir -p $out/${name}
238 if [ -f ${testExecutable} ]; then
244 if [ -f ${testExecutable} ]; then
239 cp ${testExecutable} $out/${name}/
245 cp ${testExecutable} $out/${name}/
248+ # In case `setup copy` did not creat this
249+ + (lib.optionalString enableSeparateDataOutput "mkdir -p $data")
242 runHook postInstall
251 runHook postInstall