From c449a930aaf849416b39062d80b6e9eff24a9add Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Tue, 28 Apr 2015 13:14:05 +0200 Subject: [PATCH] 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. --- .../haskell-modules/with-packages-wrapper.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index 30035671a327..136566f65f0b 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -1,6 +1,7 @@ -{ stdenv, lib, ghc, llvmPackages, packages, buildEnv -, makeWrapper -, ignoreCollisions ? false, withLLVM ? false }: +{ stdenv, lib, ghc, llvmPackages, packages, buildEnv, makeWrapper +, ignoreCollisions ? false, withLLVM ? false +, postBuild ? "" +}: # This wrapper works only with GHC 6.12 or later. assert lib.versionOlder "6.12" ghc.version || ghc.isGhcjs; @@ -89,7 +90,7 @@ buildEnv { ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"} $out/bin/${ghcCommand}-pkg check - ''; + '' + postBuild; } // { preferLocalBuild = true; inherit (ghc) version meta;