3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/version-management/gitstats/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

40 lines
1.1 KiB
Nix

{ lib, stdenv, fetchzip, perl, python, gnuplot, coreutils, gnugrep }:
stdenv.mkDerivation rec {
pname = "gitstats";
version = "2016-01-08";
# upstream does not make releases
src = fetchzip {
url = "https://github.com/hoxu/gitstats/archive/55c5c285558c410bb35ebf421245d320ab9ee9fa.zip";
sha256 = "1bfcwhksylrpm88vyp33qjby4js31zcxy7w368dzjv4il3fh2i59";
name = "${pname}-${version}" + "-src";
};
buildInputs = [ perl python ];
postPatch = ''
sed -e "s|gnuplot_cmd = .*|gnuplot_cmd = '${gnuplot}/bin/gnuplot'|" \
-e "s|\<wc\>|${coreutils}/bin/wc|g" \
-e "s|\<grep\>|${gnugrep}/bin/grep|g" \
-i gitstats
'';
buildPhase = ''
make man VERSION="${version}"
'';
installPhase = ''
make install PREFIX="$out" VERSION="${version}"
install -Dm644 doc/gitstats.1 "$out"/share/man/man1/gitstats.1
'';
meta = with lib; {
homepage = "http://gitstats.sourceforge.net/";
description = "Git history statistics generator";
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = [ maintainers.bjornfor ];
};
}