1{
2 bashInteractive,
3 buildPythonPackage,
4 cryptography,
5 diffstat,
6 fetchFromGitHub,
7 lib,
8 rpm,
9 urllib3,
10 keyring,
11}:
12
13buildPythonPackage rec {
14 pname = "osc";
15 version = "1.20.0";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "openSUSE";
20 repo = "osc";
21 rev = version;
22 hash = "sha256-00tS5iOnGkQ6XgROtY6cVU2ewIMtWVZSKobvB+FPPZM=";
23 };
24
25 buildInputs = [ bashInteractive ]; # needed for bash-completion helper
26 nativeCheckInputs = [
27 rpm
28 diffstat
29 ];
30 propagatedBuildInputs = [
31 urllib3
32 cryptography
33 keyring
34 ];
35
36 postInstall = ''
37 install -D -m444 contrib/osc.fish $out/etc/fish/completions/osc.fish
38 install -D -m555 contrib/osc.complete $out/share/bash-completion/helpers/osc-helper
39 mkdir -p $out/share/bash-completion/completions
40 cat >>$out/share/bash-completion/completions/osc <<EOF
41 test -z "\$BASH_VERSION" && return
42 complete -o default _nullcommand >/dev/null 2>&1 || return
43 complete -r _nullcommand >/dev/null 2>&1 || return
44 complete -o default -C $out/share/bash-completion/helpers/osc-helper osc
45 EOF
46 '';
47
48 preCheck = "HOME=$TOP/tmp";
49
50 meta = with lib; {
51 homepage = "https://github.com/openSUSE/osc";
52 description = "Opensuse-commander with svn like handling";
53 mainProgram = "osc";
54 maintainers = with maintainers; [
55 peti
56 saschagrunert
57 ];
58 license = licenses.gpl2;
59 };
60}