nixpkgs/pkgs/applications/version-management/git-and-tools/gita/default.nix

58 lines
1.1 KiB
Nix
Raw Normal View History

2019-04-25 13:36:12 +00:00
{ lib
, buildPythonApplication
2020-05-28 06:56:10 +00:00
, fetchFromGitHub
2020-06-02 20:35:03 +00:00
, git
, pytest
2019-04-25 13:36:12 +00:00
, pyyaml
2019-10-12 12:47:43 +00:00
, setuptools
2020-05-28 06:56:10 +00:00
, installShellFiles
2019-04-25 13:36:12 +00:00
}:
2019-04-25 13:36:12 +00:00
buildPythonApplication rec {
2020-09-02 16:54:19 +00:00
version = "0.10.10";
pname = "gita";
2020-05-28 06:56:10 +00:00
src = fetchFromGitHub {
2020-09-02 16:54:19 +00:00
sha256 = "0k7hicncbrqvhmpq1w3v1309bqij6izw31xs8xcb8is85dvi754h";
2020-05-28 06:56:10 +00:00
rev = "v${version}";
repo = "gita";
owner = "nosarthur";
};
2019-04-25 13:36:12 +00:00
propagatedBuildInputs = [
pyyaml
2019-10-12 12:47:43 +00:00
setuptools
];
2020-05-28 06:56:10 +00:00
nativeBuildInputs = [ installShellFiles ];
2020-06-02 20:35:03 +00:00
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
'';
2020-05-28 06:56:10 +00:00
postInstall = ''
installShellCompletion --bash --name gita ${src}/.gita-completion.bash
2020-09-02 16:54:19 +00:00
installShellCompletion --zsh --name gita ${src}/.gita-completion.zsh
2020-05-28 06:56:10 +00:00
'';
meta = with lib; {
description = "A command-line tool to manage multiple git repos";
2020-03-31 04:20:27 +00:00
homepage = "https://github.com/nosarthur/gita";
license = licenses.mit;
maintainers = with maintainers; [ seqizz ];
};
}