git.iko.soy/typeable/nixpkgs
on master help sign in
git: fix gitweb.cgi breakage due to missing CGI.pm

CGI.pm was removed from Perl core in v5.22, breaking the gitweb.cgi script and thus NixOS' services.lighttpd.gitweb. Nixpkgs switched to Perl 5.22 with a85ba820a409c84d97ca0 ("perl: Make 5.22 the default"). Fix it by bringing in the Perl CGI module (and dependency HTMLParser). The closure size of "nix-build -A git" increase by 1 MiB, to 201 MiB.

commite7ef33c50a80f2382e62a039060894efd189ecc0 authorBjørn Forsman <bjorn.forsman@gmail.com> dateMon 25 Jul 2016, 22:48 (10 years ago) parent3d0e806
2 files changed+7−1
pkgs/applications/version-management/git-and-tools/default.nix+1 pkgs/applications/version-management/git-and-tools/git/default.nix+6−1
pkgs/applications/version-management/git-and-tools/default.nix+1
@@ -15,6 +15,7 @@ let
1515 perlPackages.MIMEBase64 perlPackages.AuthenSASL
1616 perlPackages.DigestHMAC
1717 ];
18+ gitwebPerlLibs = with perlPackages; [ CGI HTMLParser ];
1819 };
1920
2021in
pkgs/applications/version-management/git-and-tools/git/default.nix+6−1
@@ -2,7 +2,7 @@
22, gnugrep, gzip, openssh
33, asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
44, libxslt, tcl, tk, makeWrapper, libiconv
5−, svnSupport, subversionClient, perlLibs, smtpPerlLibs
5+, svnSupport, subversionClient, perlLibs, smtpPerlLibs, gitwebPerlLibs
66, guiSupport
77, withManual ? true
88, pythonSupport ? true
@@ -102,6 +102,11 @@ stdenv.mkDerivation {
102102 # gitweb.cgi, need to patch so that it's found
103103 sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \
104104 $out/share/gitweb/gitweb.cgi
105+ # Give access to CGI.pm and friends (was removed from perl core in 5.22)
106+ for p in ${stdenv.lib.concatStringsSep " " gitwebPerlLibs}; do
107+ sed -i -e "/use CGI /i use lib \"$p/lib/perl5/site_perl\";" \
108+ "$out/share/gitweb/gitweb.cgi"
109+ done
105110
106111 # Also put git-http-backend into $PATH, so that we can use smart
107112 # HTTP(s) transports for pushing