From b95bea03858c050fcd8cd2673a253aed45a0307a Mon Sep 17 00:00:00 2001 From: Joe Hermaszewski Date: Fri, 6 Nov 2020 14:31:00 +0800 Subject: [PATCH] haskellPackages.update-nix-fetchgit: Several fixes Fix versions of dependencies Generate shell completions Wrap executable so that required executables are in PATH Make sure necessary executables for tests are present during build --- .../haskell-modules/configuration-common.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 96686d990bf..32a539c6573 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1450,6 +1450,23 @@ self: super: { # binary-instances needs the latest version. time-compat = self.time-compat_1_9_4; + # - Deps are required during the build for testing and also during execution, + # so add them to build input and also wrap the resulting binary so they're in + # PATH. + update-nix-fetchgit = let deps = [ pkgs.git pkgs.nix pkgs.nix-prefetch-git ]; + in generateOptparseApplicativeCompletion "update-nix-fetchgit" (overrideCabal + (addTestToolDepends (super.update-nix-fetchgit.overrideScope (self: super: { + optparse-generic = self.optparse-generic_1_4_4; + optparse-applicative = self.optparse-applicative_0_16_0_0; + })) deps) (drv: { + buildTools = drv.buildTools or [ ] ++ [ pkgs.makeWrapper ]; + postInstall = drv.postInstall or "" + '' + wrapProgram "$out/bin/update-nix-fetchgit" --prefix 'PATH' ':' "${ + pkgs.lib.makeBinPath deps + }" + ''; + })); + optparse-generic_1_4_4 = super.optparse-generic_1_4_4.override { optparse-applicative = self.optparse-applicative_0_16_0_0; };