1{ lib, stdenv, fetchFromGitHub, perl, python2, gnuplot, coreutils, gnugrep }:
2
3stdenv.mkDerivation rec {
4 pname = "gitstats";
5 version = "2016-01-08";
6
7 # upstream does not make releases
8 src = fetchFromGitHub {
9 owner = "hoxu";
10 repo = "gitstats";
11 rev = "55c5c285558c410bb35ebf421245d320ab9ee9fa";
12 sha256 = "sha256-qUQB3aCRbPkbMoMf39kPQ0vil8RjXL8RqjdTryfkzK0=";
13 };
14
15 nativeBuildInputs = [ perl ];
16
17 buildInputs = [ python2 ];
18
19 strictDeps = true;
20
21 postPatch = ''
22 sed -e "s|gnuplot_cmd = .*|gnuplot_cmd = '${gnuplot}/bin/gnuplot'|" \
23 -e "s|\<wc\>|${coreutils}/bin/wc|g" \
24 -e "s|\<grep\>|${gnugrep}/bin/grep|g" \
25 -i gitstats
26 '';
27
28 buildPhase = ''
29 make man VERSION="${version}"
30 '';
31
32 installPhase = ''
33 make install PREFIX="$out" VERSION="${version}"
34 install -Dm644 doc/gitstats.1 "$out"/share/man/man1/gitstats.1
35 '';
36
37 meta = with lib; {
38 homepage = "http://gitstats.sourceforge.net/";
39 description = "Git history statistics generator";
40 license = licenses.gpl2Plus;
41 platforms = platforms.all;
42 maintainers = [ maintainers.bjornfor ];
43 };
44}