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
This commit is contained in:
Mathieu Boespflug 2017-10-02 15:25:12 +02:00 committed by zimbatm
parent 3594c358bd
commit f795d78d86

View File

@ -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