2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2023-07-15 17:15:38 +00:00
|
|
|
, rustPlatform
|
2021-05-28 09:39:13 +00:00
|
|
|
, fetchFromGitHub
|
2023-07-15 17:15:38 +00:00
|
|
|
, pkg-config
|
2021-05-28 09:39:13 +00:00
|
|
|
, installShellFiles
|
2023-07-15 17:15:38 +00:00
|
|
|
, makeWrapper
|
2021-05-28 09:39:13 +00:00
|
|
|
, asciidoc
|
|
|
|
, docbook_xsl
|
2021-10-01 09:20:50 +00:00
|
|
|
, docbook_xml_dtd_45
|
2023-07-15 17:15:38 +00:00
|
|
|
, xmlto
|
|
|
|
, curl
|
2021-05-28 09:39:13 +00:00
|
|
|
, git
|
|
|
|
, perl
|
2023-07-15 17:15:38 +00:00
|
|
|
, darwin
|
2023-10-09 19:29:22 +00:00
|
|
|
, libiconv
|
2021-05-28 09:39:13 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-07-18 16:06:22 +00:00
|
|
|
pname = "stgit";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.4.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-04-12 18:23:04 +00:00
|
|
|
owner = "stacked-git";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "stgit";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-Rdpi20FRtSYQtYfBvLr+2hghpHKSSDoUZBQqm2nxZxk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
cargoHash = "sha256-vd2y6XYBlFU9gxd8hNj0srWqEuJAuXTOzt9GPD9q0yc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config installShellFiles makeWrapper asciidoc xmlto docbook_xsl
|
|
|
|
docbook_xml_dtd_45 perl
|
|
|
|
];
|
|
|
|
buildInputs = [ curl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
git perl
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-10-09 19:29:22 +00:00
|
|
|
darwin.system_cmds libiconv
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
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
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
substituteInPlace Documentation/texi.xsl \
|
|
|
|
--replace http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd \
|
|
|
|
${docbook_xml_dtd_45}/xml/dtd/docbook/docbookx.dtd
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
makeFlags = [
|
2021-05-28 09:39:13 +00:00
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
"XMLTO_EXTRA=--skip-validation"
|
2023-07-15 17:15:38 +00:00
|
|
|
"PERL_PATH=${perl}/bin/perl"
|
2021-05-28 09:39:13 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
dontCargoBuild = true;
|
|
|
|
buildFlags = [ "all" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
dontCargoCheck = true;
|
|
|
|
checkTarget = "test";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
dontCargoInstall = true;
|
|
|
|
installTargets = [ "install" "install-man" "install-html" ];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postInstall = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
wrapProgram $out/bin/stg --prefix PATH : ${lib.makeBinPath [ git ]}
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
installShellCompletion --cmd stg \
|
2021-10-01 09:20:50 +00:00
|
|
|
--fish completion/stg.fish \
|
|
|
|
--bash completion/stgit.bash \
|
|
|
|
--zsh completion/stgit.zsh
|
|
|
|
'';
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A patch manager implemented on top of Git";
|
2021-04-12 18:23:04 +00:00
|
|
|
homepage = "https://stacked-git.github.io/";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ jshholland ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "stg";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|