about summary refs log tree commit diff
path: root/pkgs/applications/version-management/guilt/default.nix
blob: aeb0eaf43f11a5554fe5ed0953b6e42f4cc556e6 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ asciidoc
, docbook_xml_dtd_45
, docbook_xsl
, fetchFromGitHub
, gawk
, git
, gnused
, lib
, makeWrapper
, openssl
, perl
, stdenv
, xmlto
}:

stdenv.mkDerivation rec {
  pname = "guilt";
  version = "0.37-rc1";

  src = fetchFromGitHub {
    owner = "jeffpc";
    repo = "guilt";
    rev = "v${version}";
    sha256 = "sha256-7OgRbMGYWtGvrZxKfJe0CkpmU3AUkPebF5NyTsfXeGA=";
  };

  doCheck = true;

  patches = [
    ./guilt-help-mandir.patch
    ./darwin-fix.patch
  ];
  nativeBuildInputs = [
    asciidoc
    docbook_xml_dtd_45
    docbook_xsl
    makeWrapper
    perl
    xmlto
  ];
  buildInputs = [
    gawk
    git
    gnused
  ] ++ lib.optionals stdenv.isDarwin [ openssl ];
  makeFlags = [
    "PREFIX=$(out)"
  ];

  postBuild = ''
    make -j $NIX_BUILD_CORES doc
  '';

  preCheck = ''
    patchShebangs regression/run-tests regression/*.sh
  '';

  postInstall = ''
    make PREFIX=$out install-doc
  '';

  postFixup = ''
    wrapProgram $out/bin/guilt --prefix PATH : ${lib.makeBinPath buildInputs}
  '';

  meta = with lib; {
    description = "Manage patches like quilt, on top of a git repository";
    longDescription = ''
      Andrew Morton originally developed a set of scripts for
      maintaining kernel patches outside of any SCM tool. Others
      extended these into a suite called quilt]. The basic idea behind
      quilt is to maintain patches instead of maintaining source
      files. Patches can be added, removed or reordered, and they can
      be refreshed as you fix bugs or update to a new base
      revision. quilt is very powerful, but it is not integrated with
      the underlying SCM tools. This makes it difficult to visualize
      your changes.

      Guilt allows one to use quilt functionality on top of a Git
      repository. Changes are maintained as patches which are
      committed into Git. Commits can be removed or reordered, and the
      underlying patch can be refreshed based on changes made in the
      working directory. The patch directory can also be placed under
      revision control, so you can have a separate history of changes
      made to your patches.
    '';
    homepage = "https://github.com/jeffpc/guilt";
    maintainers = with lib.maintainers; [ javimerino ];
    license = [ licenses.gpl2 ];
    platforms = platforms.all;
    mainProgram = "guilt";
  };
}