summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/stgit
diff options
context:
space:
mode:
authorJosh Holland <josh@inv.alid.pw>2021-05-25 01:01:03 +0100
committerGitHub <noreply@github.com>2021-05-25 02:01:03 +0200
commit6ce887b08348d2212cff01ed66f86087298d2261 (patch)
tree8c333b3a795dcc853bedde1b419feb1f1239af59 /pkgs/applications/version-management/git-and-tools/stgit
parent7cb8324a9124b0ee38c97d690e90d1ac571d8c69 (diff)
downloadnixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.tar
nixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.tar.gz
nixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.tar.bz2
nixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.tar.lz
nixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.tar.xz
nixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.tar.zst
nixpkgs-6ce887b08348d2212cff01ed66f86087298d2261.zip
stgit: enable tests and install documentation (#122370)
Diffstat (limited to 'pkgs/applications/version-management/git-and-tools/stgit')
-rw-r--r--pkgs/applications/version-management/git-and-tools/stgit/default.nix48
1 files changed, 41 insertions, 7 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/stgit/default.nix b/pkgs/applications/version-management/git-and-tools/stgit/default.nix
index 6f4173f30db..4393a9dc51c 100644
--- a/pkgs/applications/version-management/git-and-tools/stgit/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/stgit/default.nix
@@ -1,4 +1,13 @@
-{ lib, python3Packages, fetchFromGitHub, git, installShellFiles }:
+{ lib
+, fetchFromGitHub
+, installShellFiles
+, python3Packages
+, asciidoc
+, docbook_xsl
+, git
+, perl
+, xmlto
+}:
 
 python3Packages.buildPythonApplication rec {
   pname = "stgit";
@@ -11,16 +20,41 @@ python3Packages.buildPythonApplication rec {
     sha256 = "sha256-gfPf1yRmx1Mn1TyCBWmjQJBgXLlZrDcew32C9o6uNYk=";
   };
 
-  nativeBuildInputs = [ installShellFiles ];
+  nativeBuildInputs = [ installShellFiles asciidoc xmlto docbook_xsl ];
 
-  checkInputs = [ git ];
+  format = "other";
 
-  postInstall = ''
-    installShellCompletion $out/share/stgit/completion/stg.fish
-    installShellCompletion --name stg $out/share/stgit/completion/stgit.bash
-    installShellCompletion --name _stg $out/share/stgit/completion/stgit.zsh
+  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" "doc" ];
+
+  checkTarget = "test";
+  checkFlags = [ "PERL_PATH=${perl}/bin/perl" ];
+
+  installTargets = [ "install" "install-doc" ];
+  postInstall = ''
+    installShellCompletion --cmd stg \
+      --fish $out/share/stgit/completion/stg.fish \
+      --bash $out/share/stgit/completion/stgit.bash \
+      --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/";