depot/third_party/nixpkgs/pkgs/development/python-modules/osc/default.nix
Default email fa5436e0a7 Project import generated by Copybara.
GitOrigin-RevId: e8057b67ebf307f01bdcc8fba94d94f75039d1f6
2024-06-05 17:53:02 +02:00

62 lines
1.4 KiB
Nix

{
stdenv,
bashInteractive,
buildPythonPackage,
cryptography,
diffstat,
fetchFromGitHub,
lib,
rpm,
urllib3,
keyring,
}:
buildPythonPackage rec {
pname = "osc";
version = "1.7.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "openSUSE";
repo = "osc";
rev = version;
hash = "sha256-ze5mgFU3jc+hB1W2ayj4i2dBFJ0CXsZULzbdFMz3G3Y=";
};
buildInputs = [ bashInteractive ]; # needed for bash-completion helper
nativeCheckInputs = [
rpm
diffstat
];
propagatedBuildInputs = [
urllib3
cryptography
keyring
];
postInstall = ''
install -D -m444 contrib/osc.fish $out/etc/fish/completions/osc.fish
install -D -m555 contrib/osc.complete $out/share/bash-completion/helpers/osc-helper
mkdir -p $out/share/bash-completion/completions
cat >>$out/share/bash-completion/completions/osc <<EOF
test -z "\$BASH_VERSION" && return
complete -o default _nullcommand >/dev/null 2>&1 || return
complete -r _nullcommand >/dev/null 2>&1 || return
complete -o default -C $out/share/bash-completion/helpers/osc-helper osc
EOF
'';
preCheck = "HOME=$TOP/tmp";
meta = with lib; {
broken = stdenv.isDarwin;
homepage = "https://github.com/openSUSE/osc";
description = "opensuse-commander with svn like handling";
mainProgram = "osc";
maintainers = with maintainers; [
peti
saschagrunert
];
license = licenses.gpl2;
};
}