-
Notifications
You must be signed in to change notification settings - Fork 8
/
commit-patch.nix
39 lines (32 loc) · 1.09 KB
/
commit-patch.nix
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
38
39
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "commit-patch";
version = "2.6.2";
src = fetchurl {
url = "https://porkrind.org/commit-patch/commit-patch-${version}.tar.gz";
sha256 = "0v11vjyisk243zi0ym90bnqb229j7iaqx1lwqdkszxzn1yxwq4ck";
};
buildInputs = [ perl patchutils makeWrapper ];
phases = "unpackPhase installPhase postFixup";
installFlags = [ "PREFIX=$(out)" ];
# If it weren't fatpacked we could do this for IPC::Run:
# postFixup = ''
# wrapProgram $out/bin/commit-patch --set PERL5LIB \
# ${with perlPackages; makePerlPath ([
# IPCRun
# ])} \
# --prefix PATH ":" \
# "${lib.makeBinPath [ perl patchutils ]}"
# '';
postFixup = ''
perl -pi -e 's,#!/usr/bin/perl,#!${perl}/bin/perl,' $out/bin/commit-patch
wrapProgram $out/bin/commit-patch \
--prefix PATH ":" \
"${lib.makeBinPath [ perl patchutils ]}"
'';
meta = with lib; {
license = licenses.gpl2;
homepage = "https://porkrind.org/commit-patch";
description = "Commit patches to Darcs, Git, Mercurial, Bazaar, Monotone, Subversion, or CVS";
};
}