git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #32112 from nc6/hask-split-out

Revive multiple outputs for Haskell packages.

commit7993e8790f45f1548adaed2782e9bb83d1dd9df8 authorPeter Simons <simons@cryp.to> dateMon 4 Dec 2017, 12:36 (9 years ago) parentf1e1617dc0e594
14 files changed+172−37
pkgs/development/compilers/ghc/7.10.2.nix+1−1 pkgs/development/compilers/ghc/7.10.3.nix+1−1 pkgs/development/compilers/ghc/8.0.2.nix+1−1 pkgs/development/compilers/ghc/8.2.1.nix+1−1 pkgs/development/compilers/ghc/head.nix+1−1 pkgs/development/compilers/ghcjs/base.nix+1−1 pkgs/development/compilers/halvm/2.4.0.nix+2−2 pkgs/development/haskell-modules/configuration-common.nix+1 pkgs/development/haskell-modules/configuration-nix.nix+52−1 pkgs/development/haskell-modules/generic-builder.nix+100−22 pkgs/development/haskell-modules/lib.nix+4 pkgs/development/haskell-modules/make-package-set.nix+1 pkgs/development/haskell-modules/with-packages-wrapper.nix+1−1 pkgs/top-level/all-packages.nix+5−5
pkgs/development/compilers/ghc/7.10.2.nix+1−1
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
3434 sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal";
3535 };
3636
37− buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
37+ buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ];
3838
3939 patches = [ ./relocation.patch ];
4040
pkgs/development/compilers/ghc/7.10.3.nix+1−1
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
3030 ./relocation.patch
3131 ];
3232
33− buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 hscolour ];
33+ buildInputs = [ ghc perl libxml2 libxslt docbook_xsl docbook_xml_dtd_45 docbook_xml_dtd_42 (stdenv.lib.getBin hscolour) ];
3434
3535 enableParallelBuilding = true;
3636
pkgs/development/compilers/ghc/8.0.2.nix+1−1
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
2323 ++ stdenv.lib.optional stdenv.isLinux ./ghc-no-madv-free.patch
2424 ++ stdenv.lib.optional stdenv.isDarwin ./ghc-8.0.2-no-cpp-warnings.patch;
2525
26− buildInputs = [ ghc perl hscolour sphinx ];
26+ buildInputs = [ ghc perl (stdenv.lib.getBin hscolour) sphinx ];
2727
2828 enableParallelBuilding = true;
2929
pkgs/development/compilers/ghc/8.2.1.nix+1−1
@@ -10,7 +10,7 @@
1010let
1111 inherit (bootPkgs) ghc;
1212 version = "8.2.1";
13−
13+ preReleaseName = "ghc-8.2.1";
1414 commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
1515 commonPreConfigure = ''
1616 sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
pkgs/development/compilers/ghc/head.nix+1−1
@@ -11,7 +11,7 @@
1111let
1212 inherit (bootPkgs) ghc;
1313
14− commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
14+ commonBuildInputs = [ ghc perl autoconf automake (stdenv.lib.getBin happy) (stdenv.lib.getBin alex) python3 ];
1515
1616 rev = "14457cf6a50f708eecece8f286f08687791d51f7";
1717
pkgs/development/compilers/ghcjs/base.nix+1−1
@@ -113,7 +113,7 @@ in mkDerivation (rec {
113113 lens optparse-applicative parallel safe shelly split
114114 stringsearch syb system-fileio system-filepath tar terminfo text-binary
115115 unordered-containers vector wl-pprint-text yaml
116− alex happy git gnumake autoconf automake libtool patch gmp
116+ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) git gnumake autoconf automake libtool patch gmp
117117 base16-bytestring cryptohash executable-path haddock-api
118118 transformers-compat QuickCheck haddock hspec xhtml
119119 regex-posix libiconv
pkgs/development/compilers/halvm/2.4.0.nix+2−2
@@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
2020 sed -ie 's|ld |${targetPackages.stdenv.cc.bintools}/bin/ld |g' src/scripts/ldkernel.in
2121 '';
2222 configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
23− propagatedNativeBuildInputs = [ alex happy ];
23+ propagatedNativeBuildInputs = [ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) ];
2424 buildInputs =
25− let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
25+ let haskellPkgs = [ (stdenv.lib.getBin alex) (stdenv.lib.getBin happy) (stdenv.lib.getBin bootPkgs.hscolour) bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
2626 ]; in [ bootPkgs.ghc
2727 automake perl git targetPackages.stdenv.cc.bintools
2828 autoconf xen zlib ncurses.dev
pkgs/development/haskell-modules/configuration-common.nix+1
@@ -897,6 +897,7 @@ self: super: {
897897 # Don't install internal mkReadme tool.
898898 hastache = overrideCabal super.hastache (drv: {
899899 doCheck = false;
900+ enableSeparateBinOutput = false;
900901 postInstall = "rm $out/bin/mkReadme && rmdir $out/bin";
901902 });
902903
pkgs/development/haskell-modules/configuration-nix.nix+52−1
@@ -217,7 +217,10 @@ self: super: builtins.intersectAttrs super {
217217
218218 # wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
219219 # http://hydra.cryp.to/build/1331287/log/raw
220− wxc = (addBuildDepend super.wxc self.split).override { wxGTK = pkgs.wxGTK30; };
220+ wxc = (overrideCabal super.wxc (drv: {
221+ buildDepends = (drv.buildDepends or []) ++ [self.split];
222+ postInstall = "cp -v dist/build/libwxc.so.0.92.3.0 $lib/lib/libwxc.so";
223+ })).override { wxGTK = pkgs.wxGTK30; };
221224 wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; };
222225
223226 # Test suite wants to connect to $DISPLAY.
@@ -507,4 +510,52 @@ self: super: builtins.intersectAttrs super {
507510 # Break cyclic reference that results in an infinite recursion.
508511 partial-semigroup = dontCheck super.partial-semigroup;
509512
513+ # Alex has some weird files in /usr/share that create a cyclic ref with
514+ # its bin dir.
515+ alex = hasNoBinOutput super.alex;
516+
517+ # Disable separate bin outputs for these specific packages that break with it.
518+ H = hasNoBinOutput super.H;
519+ cryptol = hasNoBinOutput super.cryptol;
520+ hscolour = hasNoBinOutput super.hscolour;
521+ sproxy = hasNoBinOutput super.sproxy;
522+ sproxy2 = hasNoBinOutput super.sproxy2;
523+ sproxy-web = hasNoBinOutput super.sproxy-web;
524+ juandelacosa = hasNoBinOutput super.juandelacosa;
525+ mywatch = hasNoBinOutput super.mywatch;
526+ sugarhaskell = hasNoBinOutput super.sugarhaskell;
527+ zerobin = hasNoBinOutput super.zerobin;
528+
529+ git-annex = overrideCabal super.git-annex (drv: {
530+ enableSeparateBinOutput = false;
531+ enableSeparateEtcOutput = false;
532+ });
533+
534+ # Has extra data files which are referred to from the binary output,
535+ # creating a store reference cycle. Putting data in separate output
536+ # solves the problem.
537+ happy = overrideCabal super.happy (drv: { enableSeparateDataOutput = true; });
538+
539+ # Override a number of packages with specific references to $out in their
540+ # derivations
541+ stack = overrideCabal super.stack (drv: {
542+ postInstall = ''
543+ exe=$bin/bin/stack
544+ mkdir -p $bin/share/bash-completion/completions
545+ $exe --bash-completion-script $exe >$bin/share/bash-completion/completions/stack
546+ '';
547+ });
548+ Agda = overrideCabal super.Agda (drv: {
549+ postInstall = ''
550+ files=("$out/share/"*"-ghc-"*"/Agda-"*"/lib/prim/Agda/"{Primitive.agda,Builtin"/"*.agda})
551+ for f in "''${files[@]}" ; do
552+ $bin/bin/agda $f
553+ done
554+ for f in "''${files[@]}" ; do
555+ $bin/bin/agda -c --no-main $f
556+ done
557+ $bin/bin/agda-mode compile
558+ '';
559+ });
560+
510561}
pkgs/development/haskell-modules/generic-builder.nix+100−22
@@ -56,6 +56,10 @@ let isCross = (ghc.cross or null) != null; in
5656, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
5757, enableSeparateDataOutput ? false
5858, enableSeparateDocOutput ? doHaddock
59+, enableSeparateBinOutput ? isExecutable
60+, outputsToInstall ? []
61+, enableSeparateLibOutput ? true
62+, enableSeparateEtcOutput ? (stdenv.lib.versionOlder "7.7" ghc.version)
5963} @ args:
6064
6165assert editedCabalFile != null -> revision != null;
@@ -79,9 +83,6 @@ let
7983 then "package-db"
8084 else "package-conf";
8185
82− # the target dir for haddock documentation
83− docdir = docoutput: docoutput + "/share/doc";
84−
8586 newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal";
8687 newCabalFile = fetchurl {
8788 url = newCabalFileUrl;
@@ -95,6 +96,13 @@ let
9596 '';
9697
9798 hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling);
99+ hasLibOutput = enableSeparateLibOutput && hasActiveLibrary;
100+ libDir = if hasLibOutput then "$lib/lib/${ghc.name}" else "$out/lib/${ghc.name}";
101+ binDir = if enableSeparateBinOutput then "$bin/bin" else "$out/bin";
102+ libexecDir = if enableSeparateBinOutput then "$libexec/bin" else "$out/libexec";
103+ etcDir = if enableSeparateEtcOutput then "$etc/etc" else "$out/etc";
104+ docDir = if enableSeparateDocOutput then "$doc/share/doc" else "$out/share/doc";
105+ dataDir = if enableSeparateDataOutput then "$data/share/${ghc.name}" else "$out/share/${ghc.name}";
98106
99107 # We cannot enable -j<n> parallelism for libraries because GHC is far more
100108 # likely to generate a non-determistic library ID in that case. Further
@@ -113,12 +121,20 @@ let
113121 stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
114122
115123 defaultConfigureFlags = [
116− "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid"
117− (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
118− (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
124+ "--verbose" "--prefix=$out"
125+ # Binary directory has to be $bin/bin instead of just $bin: this
126+ # is so that the package is added to the PATH when it's used as a
127+ # build input. Sadly mkDerivation won't add inputs that don't have
128+ # bin subdirectory.
129+ "--bindir=${binDir}"
130+ "--libdir=${libDir}" "--libsubdir=\\$pkgid"
131+ "--libexecdir=${libexecDir}"
132+ (optionalString (enableSeparateEtcOutput) "--sysconfdir=${etcDir}") # Old versions of cabal don't support this flag.
133+ "--datadir=${dataDir}"
134+ "--docdir=${docDir}"
119135 "--with-gcc=$CC" # Clang won't work without that extra information.
120136 "--package-db=$packageConfDir"
121− (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
137+ (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=${libDir}/${pname}-${version}")
122138 (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")
123139 (optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES")
124140 (optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp")
@@ -152,8 +168,11 @@ let
152168 allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++
153169 optionals doCheck testPkgconfigDepends ++ optionals doBenchmark benchmarkPkgconfigDepends;
154170
155− nativeBuildInputs = optional (allPkgconfigDepends != []) pkgconfig ++
156− buildTools ++ libraryToolDepends ++ executableToolDepends ++ [ removeReferencesTo ];
171+ nativeBuildInputs = map stdenv.lib.getBin
172+ ( optional (allPkgconfigDepends != []) pkgconfig
173+ ++ buildTools ++ libraryToolDepends ++ executableToolDepends
174+ ++ [ removeReferencesTo ]
175+ );
157176 propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends;
158177 otherBuildInputs = setupHaskellDepends ++ extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++
159178 optionals (allPkgconfigDepends != []) allPkgconfigDepends ++
@@ -182,7 +201,15 @@ assert allPkgconfigDepends != [] -> pkgconfig != null;
182201stdenv.mkDerivation ({
183202 name = "${pname}-${version}";
184203
185− outputs = if (args ? outputs) then args.outputs else ([ "out" ] ++ (optional enableSeparateDataOutput "data") ++ (optional enableSeparateDocOutput "doc"));
204+ outputs = if (args ? outputs) then args.outputs else
205+ ( (optional enableSeparateBinOutput "bin")
206+ ++ (optional enableSeparateBinOutput "libexec")
207+ ++ [ "out" ]
208+ ++ (optional enableSeparateDataOutput "data")
209+ ++ (optional enableSeparateDocOutput "doc")
210+ ++ (optional enableSeparateEtcOutput "etc")
211+ ++ (optional hasLibOutput "lib")
212+ );
186213 setOutputFlags = false;
187214
188215 pos = builtins.unsafeGetAttrPos "pname" args;
@@ -206,7 +233,7 @@ stdenv.mkDerivation ({
206233
207234 postPatch = optionalString jailbreak ''
208235 echo "Run jailbreak-cabal to lift version restrictions on build inputs."
209− ${jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
236+ ${stdenv.lib.getBin jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
210237 '' + postPatch;
211238
212239 setupCompilerEnvironmentPhase = ''
@@ -214,7 +241,7 @@ stdenv.mkDerivation ({
214241
215242 echo "Build with ${ghc}."
216243 export PATH="${ghc}/bin:$PATH"
217− ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
244+ ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${stdenv.lib.getBin hscolour}/bin:$PATH"}
218245
219246 packageConfDir="$TMPDIR/package.conf.d"
220247 mkdir -p $packageConfDir
@@ -241,7 +268,7 @@ stdenv.mkDerivation ({
241268 #
242269 # Create a local directory with symlinks of the *.dylib (macOS shared
243270 # libraries) from all the dependencies.
244− local dynamicLinksDir="$out/lib/links"
271+ local dynamicLinksDir="${libDir}/links"
245272 mkdir -p $dynamicLinksDir
246273 for d in $(grep dynamic-library-dirs "$packageConfDir/"*|awk '{print $2}'); do
247274 ln -s "$d/"*.dylib $dynamicLinksDir
@@ -313,7 +340,7 @@ stdenv.mkDerivation ({
313340
314341 ${if !hasActiveLibrary then "${setupCommand} install" else ''
315342 ${setupCommand} copy
316− local packageConfDir="$out/lib/${ghc.name}/package.conf.d"
343+ local packageConfDir="${libDir}/package.conf.d"
317344 local packageConfFile="$packageConfDir/${pname}-${version}.conf"
318345 mkdir -p "$packageConfDir"
319346 ${setupCommand} register --gen-pkg-config=$packageConfFile
@@ -321,7 +348,7 @@ stdenv.mkDerivation ({
321348 mv $packageConfFile $packageConfDir/$pkgId.conf
322349 ''}
323350 ${optionalString isGhcjs ''
324− for exeDir in "$out/bin/"*.jsexe; do
351+ for exeDir in "${binDir}/"*.jsexe; do
325352 exe="''${exeDir%.jsexe}"
326353 printWords '#!${nodejs}/bin/node' > "$exe"
327354 cat "$exeDir/all.js" >> "$exe"
@@ -330,18 +357,68 @@ stdenv.mkDerivation ({
330357 ''}
331358 ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
332359 ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") ''
333− for exe in "$out/bin/"* ; do
334− install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe"
360+ for exe in "${binDir}/"* ; do
361+ install_name_tool -add_rpath "${libDir}/${pname}-${version}" "$exe"
335362 done
336363 ''}
337364
338365 ${optionalString enableSeparateDocOutput ''
339− for x in ${docdir "$doc"}/html/src/*.html; do
340− remove-references-to -t $out $x
366+ # Remove references back to $out but also back to $lib if we have
367+ # docs. $lib is needed as it stores path to haddock interfaces in the
368+ # conf file which creates a cycle if docs refer back to library
369+ # path.
370+ mkdir -p ${docDir}
371+
372+ for x in ${docDir}/html/src/*.html; do
373+ remove-references-to -t $out -t ${libDir} -t ${binDir} ${optionalString enableSeparateDataOutput "-t $data"} $x
341374 done
342− mkdir -p $doc
343375 ''}
344− ${optionalString enableSeparateDataOutput "mkdir -p $data"}
376+
377+ ${optionalString hasLibOutput ''
378+ # Even if we don't have binary output for the package, things like
379+ # Paths files will embed paths to bin/libexec directories in themselves
380+ # which results in .lib <-> $out cyclic store reference. We
381+ # therefore patch out the paths from separate library if we don't have
382+ # separate bin output too.
383+ #
384+ # If we _do_ have separate bin and lib outputs, we may still be in
385+ # trouble in case of shared executables: executable contains path to
386+ # .lib, .lib contains path (through Paths) to .bin and we have a
387+ # cycle.
388+ #
389+ # Lastly we have to deal with references from .lib back into
390+ # $out/share if we're not splitting out data directory.
391+ #
392+ # It may happen that we have hasLibOutput set but the library
393+ # directory was not created: this happens in the case that library
394+ # section is not exposing any modules. See "fail" package for an
395+ # example where no modules are exposed for GHC >= 8.0.
396+ if [ -d ${libDir} ]; then
397+ find ${libDir} -type f -exec \
398+ remove-references-to -t ${binDir} -t ${libexecDir} "{}" \;
399+ fi
400+ ''}
401+
402+ ${optionalString (hasLibOutput && ! enableSeparateDocOutput) ''
403+ # If we don't have separate docs, we have to patch out the ref to
404+ # docs in package conf. This will likely break Haddock
405+ # cross-package links but is necessary to break store cycle…
406+ find ${libDir}/ -type f -name '*.conf' -exec \
407+ remove-references-to -t ${docDir} "{}" \;
408+ ''}
409+
410+ ${optionalString (hasLibOutput && ! enableSeparateDataOutput) ''
411+ # Just like for doc output path in $out potentially landing in
412+ # *.conf, we have to also remove the data directory so that it
413+ # doesn't appear under data-dir field creating a cycle.
414+ find ${libDir}/ -type f -exec echo Removing ${dataDir} refs from "{}" \;
415+ find ${libDir}/ -type f -exec \
416+ remove-references-to -t ${dataDir} "{}" \;
417+ ''}
418+
419+ ${optionalString enableSeparateDataOutput "mkdir -p ${dataDir}"}
420+ ${optionalString enableSeparateBinOutput "mkdir -p ${binDir} ${libexecDir}"}
421+ ${optionalString enableSeparateEtcOutput "mkdir -p ${etcDir}"}
345422
346423 runHook postInstall
347424 '';
@@ -358,7 +435,7 @@ stdenv.mkDerivation ({
358435 # the directory containing the haddock documentation.
359436 # `null' if no haddock documentation was built.
360437 # TODO: fetch the self from the fixpoint instead
361− haddockDir = self: if doHaddock then "${docdir self.doc}/html" else null;
438+ haddockDir = self: if doHaddock then "${docDir}/html" else null;
362439
363440 env = stdenv.mkDerivation {
364441 name = "interactive-${pname}-${version}-environment";
@@ -386,6 +463,7 @@ stdenv.mkDerivation ({
386463 // optionalAttrs (description != "") { inherit description; }
387464 // optionalAttrs (maintainers != []) { inherit maintainers; }
388465 // optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; }
466+ // optionalAttrs (outputsToInstall != []) { inherit outputsToInstall; }
389467 ;
390468
391469}
pkgs/development/haskell-modules/lib.nix+4
@@ -147,4 +147,8 @@ rec {
147147 overrideSrc = drv: { src, version ? drv.version }:
148148 overrideCabal drv (_: { inherit src version; editedCabalFile = null; });
149149
150+ hasNoBinOutput = drv: overrideCabal drv (drv: { enableSeparateBinOutput = false; });
151+
152+ installOutputs = drv: outputs: overrideCabal drv
153+ (drv: { outputsToInstall = outputs; });
150154}
pkgs/development/haskell-modules/make-package-set.nix+1
@@ -44,6 +44,7 @@ let
4444 isLibrary = false;
4545 doHaddock = false;
4646 hyperlinkSource = false; # Avoid depending on hscolour for this build.
47+ enableSeparateEtcOutput = false; # The flag to support this is missing in old versions of cabal.
4748 postFixup = "rm -rf $out/lib $out/share $out/nix-support";
4849 });
4950 cpphs = overrideCabal (self.cpphs.overrideScope (self: super: {
pkgs/development/haskell-modules/with-packages-wrapper.nix+1−1
@@ -43,7 +43,7 @@ let
4343 libDir = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
4444 docDir = "$out/share/doc/ghc/html";
4545 packageCfgDir = "${libDir}/package.conf.d";
46− paths = lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages);
46+ paths = map lib.getLib (lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages));
4747 hasLibraries = lib.any (x: x.isHaskellLibrary) paths;
4848 # CLang is needed on Darwin for -fllvm to work:
4949 # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html
pkgs/top-level/all-packages.nix+5−5
@@ -830,10 +830,10 @@ with pkgs;
830830 enableSharedExecutables = false;
831831 executableToolDepends = [ makeWrapper ];
832832 postInstall = ''
833− exe=$out/libexec/${drv.pname}-${drv.version}/${drv.pname}
834− install -D $out/bin/${drv.pname} $exe
835− rm -rf $out/{bin,lib,share}
836− makeWrapper $exe $out/bin/${drv.pname} \
833+ exe=$libexec/bin/${drv.pname}-${drv.version}/${drv.pname}
834+ install -D $bin/bin/${drv.pname} $exe
835+ rm -rf $bin/bin $out/lib $out/share
836+ makeWrapper $exe $bin/bin/${drv.pname} \
837837 --prefix PATH ":" "${nix}/bin" \
838838 --prefix PATH ":" "${nix-prefetch-scripts}/bin"
839839 mkdir -p $out/share/{bash-completion/completions,zsh/vendor-completions,fish/completions}
@@ -847,7 +847,7 @@ with pkgs;
847847 executableToolDepends = [ makeWrapper ];
848848 postInstall = ''
849849 wrapProgram $out/bin/stack2nix \
850− --prefix PATH ":" "${git}/bin:${cabal2nix}/bin:${cabal-install}/bin:${stack}/bin"
850+ ${lib.makeBinPath [ git cabal2nix cabal-install stack ]}
851851 '';
852852 });
853853