git.iko.soy/typeable/nixpkgs
on master help sign in
ghcWithPackages: add postBuild hook so that users can mess with the generated environment

postBuild can be used to execute user-specific commands on the generated $out environment before finalizing the build. For example, this hook can be used to generate appropriate 'makeWrapper' script for binaries contained in the environment.

commitc449a930aaf849416b39062d80b6e9eff24a9add authorPeter Simons <simons@cryp.to> dateTue 28 Apr 2015, 13:14 (12 years ago) parent71910be
1 file changed+5−4
pkgs/development/haskell-modules/with-packages-wrapper.nix+5−4
pkgs/development/haskell-modules/with-packages-wrapper.nix+5−4
@@ -1,6 +1,7 @@
1−{ stdenv, lib, ghc, llvmPackages, packages, buildEnv
2−, makeWrapper
3−, ignoreCollisions ? false, withLLVM ? false }:
1+{ stdenv, lib, ghc, llvmPackages, packages, buildEnv, makeWrapper
2+, ignoreCollisions ? false, withLLVM ? false
3+, postBuild ? ""
4+}:
45
56# This wrapper works only with GHC 6.12 or later.
67assert lib.versionOlder "6.12" ghc.version || ghc.isGhcjs;
@@ -89,7 +90,7 @@ buildEnv {
8990
9091 ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"}
9192 $out/bin/${ghcCommand}-pkg check
92− '';
93+ '' + postBuild;
9394} // {
9495 preferLocalBuild = true;
9596 inherit (ghc) version meta;