stgit: enable tests and install documentation (#122370)

This commit is contained in:
Josh Holland 2021-05-25 01:01:03 +01:00 committed by GitHub
parent 7cb8324a91
commit 6ce887b083
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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/";