Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / osc / default.nix
blobef96910759625b91e731f9b70d47087d812f91e9
1 { stdenv
2 , bashInteractive
3 , buildPythonPackage
4 , cryptography
5 , diffstat
6 , fetchFromGitHub
7 , lib
8 , rpm
9 , urllib3
10 , keyring
13 buildPythonPackage rec {
14   pname = "osc";
15   version = "1.6.1";
16   format = "setuptools";
18   src = fetchFromGitHub {
19     owner = "openSUSE";
20     repo = "osc";
21     rev = version;
22     hash = "sha256-U76nAE7NdLIdrKzRC0sP8hy6G6A8Tr4Qe2PGZI2xvyk=";
23   };
25   buildInputs = [ bashInteractive ]; # needed for bash-completion helper
26   nativeCheckInputs = [ rpm diffstat ];
27   propagatedBuildInputs = [ urllib3 cryptography keyring ];
29   postInstall = ''
30     install -D -m444 contrib/osc.fish $out/etc/fish/completions/osc.fish
31     install -D -m555 contrib/osc.complete $out/share/bash-completion/helpers/osc-helper
32     mkdir -p $out/share/bash-completion/completions
33     cat >>$out/share/bash-completion/completions/osc <<EOF
34     test -z "\$BASH_VERSION" && return
35     complete -o default _nullcommand >/dev/null 2>&1 || return
36     complete -r _nullcommand >/dev/null 2>&1         || return
37     complete -o default -C $out/share/bash-completion/helpers/osc-helper osc
38     EOF
39   '';
41   preCheck = "HOME=$TOP/tmp";
43   meta = with lib; {
44     broken = stdenv.isDarwin;
45     homepage = "https://github.com/openSUSE/osc";
46     description = "opensuse-commander with svn like handling";
47     mainProgram = "osc";
48     maintainers = with maintainers; [ peti saschagrunert ];
49     license = licenses.gpl2;
50   };