blob: 0358f850c9abb6d9001d7dc06e709359edfc153a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
{ stdenv, git, gzip, perlPackages, fetchFromGitHub
, gitwebTheme ? false }:
let
gitwebPerlLibs = with perlPackages; [ CGI HTMLParser CGIFast FCGI FCGIProcManager HTMLTagCloud ];
gitwebThemeSrc = fetchFromGitHub {
owner = "kogakure";
repo = "gitweb-theme";
rev = "049b88e664a359f8ec25dc6f531b7e2aa60dd1a2";
sha256 = "0wksqma41z36dbv6w6iplkjfdm0ha3njp222fakyh4lismajr71p";
};
in stdenv.mkDerivation {
name = "gitweb";
src = git.gitweb;
installPhase = ''
mkdir $out
mv * $out
# gzip (and optionally bzip2, xz, zip) are runtime dependencies for
# gitweb.cgi, need to patch so that it's found
sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \
$out/gitweb.cgi
# Give access to CGI.pm and friends (was removed from perl core in 5.22)
for p in ${stdenv.lib.concatStringsSep " " gitwebPerlLibs}; do
sed -i -e "/use CGI /i use lib \"$p/lib/perl5/site_perl\";" \
"$out/gitweb.cgi"
done
${stdenv.lib.optionalString gitwebTheme "cp ${gitwebThemeSrc}/* $out/static"}
'';
meta = git.meta // {
maintainers = with stdenv.lib.maintainers; [ gnidorah ];
};
}
|