From f795d78d86b453c7bc34ada886025edc0433e512 Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Mon, 2 Oct 2017 15:25:12 +0200 Subject: [PATCH] git: Properly wrap Git commands that are implemented in Perl. (#30001) Some Git commands are implemented as Perl scripts. Some of these scripts use Perl modules from CPAN. Without wrapping these programs to set `GITPERLLIB`, these programs would not be fully functional because some Perl libraries are found to be missing at runtime. Fixes #29996 --- .../git-and-tools/git/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index fcf35a9ca34e..51f523305d18 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -145,6 +145,22 @@ stdenv.mkDerivation { # Also put git-http-backend into $PATH, so that we can use smart # HTTP(s) transports for pushing ln -s $out/libexec/git-core/git-http-backend $out/bin/git-http-backend + + # wrap perl commands + gitperllib=$out/lib/perl5/site_perl + for i in ${builtins.toString perlLibs}; do + gitperllib=$gitperllib:$i/lib/perl5/site_perl + done + wrapProgram $out/libexec/git-core/git-cvsimport \ + --set GITPERLLIB "$gitperllib" + wrapProgram $out/libexec/git-core/git-add--interactive \ + --set GITPERLLIB "$gitperllib" + wrapProgram $out/libexec/git-core/git-archimport \ + --set GITPERLLIB "$gitperllib" + wrapProgram $out/libexec/git-core/git-instaweb \ + --set GITPERLLIB "$gitperllib" + wrapProgram $out/libexec/git-core/git-cvsexportcommit \ + --set GITPERLLIB "$gitperllib" '' + (if svnSupport then