diff options
author | gnidorah <gnidorah@users.noreply.github.com> | 2018-04-17 20:06:44 +0300 |
---|---|---|
committer | gnidorah <gnidorah@users.noreply.github.com> | 2018-04-17 20:07:01 +0300 |
commit | 9029ed933c69287c64a30d40b6b4f9f1ace7dd94 (patch) | |
tree | 3ce069646e63b7d4cee63874265337e41c6fb6a9 /pkgs/applications/version-management | |
parent | a415a95e7c520b1f0f86c9729a54f5c8e7bd416c (diff) | |
download | nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.tar nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.tar.gz nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.tar.bz2 nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.tar.lz nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.tar.xz nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.tar.zst nixlib-9029ed933c69287c64a30d40b6b4f9f1ace7dd94.zip |
nixos/gitweb: add gitwebTheme option
Diffstat (limited to 'pkgs/applications/version-management')
3 files changed, 43 insertions, 12 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix index cd969ff81d0b..73659a32f4bf 100644 --- a/pkgs/applications/version-management/git-and-tools/default.nix +++ b/pkgs/applications/version-management/git-and-tools/default.nix @@ -15,7 +15,6 @@ let perlPackages.MIMEBase64 perlPackages.AuthenSASL perlPackages.DigestHMAC ]; - gitwebPerlLibs = with perlPackages; [ CGI HTMLParser CGIFast FCGI FCGIProcManager HTMLTagCloud ]; }; in 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 b336f72c7ac1..cf44cf5ef981 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -1,9 +1,9 @@ { fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio , gnugrep, gnused, gawk, coreutils # needed at runtime by git-filter-branch etc -, gzip, openssh, pcre2 +, openssh, pcre2 , asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45 , libxslt, tcl, tk, makeWrapper, libiconv -, svnSupport, subversionClient, perlLibs, smtpPerlLibs, gitwebPerlLibs +, svnSupport, subversionClient, perlLibs, smtpPerlLibs , guiSupport , withManual ? true , pythonSupport ? true @@ -25,6 +25,8 @@ stdenv.mkDerivation { sha256 = "0j1dwvg5llnj3g0fp8hdgpms4hp90qw9f6509vqw30dhwplrjpfn"; }; + outputs = [ "out" "gitweb" ]; + hardeningDisable = [ "format" ]; patches = [ @@ -131,15 +133,8 @@ stdenv.mkDerivation { substituteInPlace $out/libexec/git-core/git-sh-i18n \ --subst-var-by gettext ${gettext} - # 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/share/gitweb/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/share/gitweb/gitweb.cgi" - done + # put in separate package for simpler maintenance + mv $out/share/gitweb $gitweb/ # Also put git-http-backend into $PATH, so that we can use smart # HTTP(s) transports for pushing diff --git a/pkgs/applications/version-management/git-and-tools/gitweb/default.nix b/pkgs/applications/version-management/git-and-tools/gitweb/default.nix new file mode 100644 index 000000000000..0358f850c9ab --- /dev/null +++ b/pkgs/applications/version-management/git-and-tools/gitweb/default.nix @@ -0,0 +1,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 ]; + }; +} |