]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Upgrade stgit
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 5 Aug 2021 23:39:21 +0000 (01:39 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 5 Aug 2021 23:42:02 +0000 (01:42 +0200)
environments/immae-eu.nix
pkgs/default.nix
pkgs/stgit/default.nix [new file with mode: 0644]

index df57e55b65462e0edfaaec21c2eed0c54624840d..84d8ea08102745af4505a21abba2f12c1e9f2498 100644 (file)
@@ -36,7 +36,7 @@ let
     sieve-connect
 
     # git
-    vcsh gitRepo gitAndTools.stgit tig ripgrep mr
+    vcsh gitRepo stgit tig ripgrep mr
 
     # graphical tools
     nextcloud-client firefox
index 603d12e213dc04bbd314939b53685415869e958c..2f5f5290cd22d7c84954f5be36cc2a5a3b0d9a09 100644 (file)
@@ -31,6 +31,7 @@ rec {
   rrsync_sudo = callPackage ./rrsync_sudo {};
   signald = callPackage ./signald {};
   signaldctl = callPackage ./signaldctl {};
+  stgit = callPackage ./stgit {};
   telegram-cli = callPackage ./telegram-cli { inherit mylibs; };
   telegram-history-dump = callPackage ./telegram-history-dump { inherit mylibs; };
   telegramircd = callPackage ./telegramircd { inherit mylibs; telethon = callPackage ./telethon_sync {}; };
diff --git a/pkgs/stgit/default.nix b/pkgs/stgit/default.nix
new file mode 100644 (file)
index 0000000..da4f7ec
--- /dev/null
@@ -0,0 +1,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 ];
+  };
+}