about summary refs log tree commit diff
path: root/pkgs/applications/version-management/gita/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/version-management/gita/default.nix')
-rw-r--r--pkgs/applications/version-management/gita/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/gita/default.nix b/pkgs/applications/version-management/gita/default.nix
new file mode 100644
index 0000000000000..6f20e4a44c6fe
--- /dev/null
+++ b/pkgs/applications/version-management/gita/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, buildPythonApplication
+, fetchFromGitHub
+, git
+, pytest
+, pyyaml
+, setuptools
+, installShellFiles
+}:
+
+buildPythonApplication rec {
+  version = "0.11.9";
+  pname = "gita";
+
+  src = fetchFromGitHub {
+    sha256 = "9+zuLAx9lMfltsBqjvsivJ5wPnStPfq11XgGMv/JDpY=";
+    rev = version;
+    repo = "gita";
+    owner = "nosarthur";
+  };
+
+  propagatedBuildInputs = [
+    pyyaml
+    setuptools
+  ];
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  postUnpack = ''
+    for case in "\n" ""; do
+        substituteInPlace source/tests/test_main.py \
+         --replace "'gita$case'" "'source$case'"
+    done
+  '';
+
+  checkInputs = [
+    git
+    pytest
+  ];
+
+  checkPhase = ''
+    git init
+    pytest tests
+  '';
+
+  postInstall = ''
+    installShellCompletion --bash --name gita ${src}/.gita-completion.bash
+    installShellCompletion --zsh --name gita ${src}/.gita-completion.zsh
+  '';
+
+  meta = with lib; {
+    description = "A command-line tool to manage multiple git repos";
+    homepage = "https://github.com/nosarthur/gita";
+    license = licenses.mit;
+    maintainers = with maintainers; [ seqizz ];
+  };
+}