aboutsummaryrefslogtreecommitdiff
path: root/pkgs/stgit/default.nix
blob: da4f7ecf780e53e6c579089618e731cf77f97ce5 (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
# Taken from nixpkgs repository
{ lib
, fetchFromGitHub
, installShellFiles
, python3Packages
, asciidoc
, docbook_xsl
, git
, perl
, xmlto
}:

python3Packages.buildPythonApplication rec {
  pname = "stgit";
  version = "1.1";

  src = fetchFromGitHub {
    owner = "stacked-git";
    repo = "stgit";
    rev = "v${version}";
    sha256 = "sha256-gfPf1yRmx1Mn1TyCBWmjQJBgXLlZrDcew32C9o6uNYk=";
  };

  nativeBuildInputs = [ installShellFiles asciidoc xmlto docbook_xsl ];

  format = "other";

  checkInputs = [ git perl ];

  postPatch = ''
    for f in Documentation/*.xsl; do
      substituteInPlace $f \
        --replace http://docbook.sourceforge.net/release/xsl-ns/current/manpages/docbook.xsl \
                  ${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
        --replace http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
                  ${docbook_xsl}/xml/xsl/docbook/html/docbook.xsl
    done
  '';

  makeFlags = [
    "prefix=${placeholder "out"}"
    "MAN_BASE_URL=${placeholder "out"}/share/man"
    "XMLTO_EXTRA=--skip-validation"
  ];

  buildFlags = [ "all" ];

  checkTarget = "test";
  checkFlags = [ "PERL_PATH=${perl}/bin/perl" ];

  installTargets = [ "install" ];
  postInstall = ''
    installShellCompletion \
      --zsh $out/share/stgit/completion/stgit.zsh
    '';

  meta = with lib; {
    description = "A patch manager implemented on top of Git";
    homepage = "https://stacked-git.github.io/";
    license = licenses.gpl2Only;
    platforms = platforms.unix;
    maintainers = with maintainers; [ jshholland ];
  };
}