From 4156569b54d974f23beab6846e54c651d3bc8716 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Wed, 17 Oct 2018 14:57:51 -0400 Subject: [PATCH] pythonPackages.osc: refactor move to python-modules --- .../python-modules/osc/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 30 +----------- 2 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 pkgs/development/python-modules/osc/default.nix diff --git a/pkgs/development/python-modules/osc/default.nix b/pkgs/development/python-modules/osc/default.nix new file mode 100644 index 000000000000..87bd6ee258c0 --- /dev/null +++ b/pkgs/development/python-modules/osc/default.nix @@ -0,0 +1,46 @@ +{ stdenv +, buildPythonPackage +, fetchFromGitHub +, isPy3k +, pkgs +, urlgrabber +, m2crypto +, pyyaml +, lxml +}: + +buildPythonPackage { + pname = "osc"; + version = "0.162.0-55-gb730f88"; + disabled = isPy3k; + + src = fetchFromGitHub { + owner = "openSUSE"; + repo = "osc"; + rev = "b730f880cfe85a8547f569355a21706f27ebfa78"; + sha256 = "0hh9j5zd2kc0804d2jmf1q3w5xm9l9s69hhgysbncrv5fw0414lh"; + }; + + buildInputs = [ pkgs.bashInteractive ]; # needed for bash-completion helper + propagatedBuildInputs = [ urlgrabber m2crypto pyyaml lxml ]; + + postInstall = '' + ln -s $out/bin/osc-wrapper.py $out/bin/osc + install -D -m444 osc.fish $out/etc/fish/completions/osc.fish + install -D -m555 dist/osc.complete $out/share/bash-completion/helpers/osc-helper + mkdir -p $out/share/bash-completion/completions + cat >>$out/share/bash-completion/completions/osc </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 + ''; + + meta = with stdenv.lib; { + description = "opensuse-commander with svn like handling"; + maintainers = [ maintainers.peti ]; + license = licenses.gpl2; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dc6d8732f108..0c0877779df5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3008,35 +3008,7 @@ in { plyvel = callPackage ../development/python-modules/plyvel { }; - osc = buildPythonPackage { - name = "osc-0.162.0-55-gb730f88"; - disabled = isPy3k; - src = pkgs.fetchFromGitHub { - owner = "openSUSE"; - repo = "osc"; - rev = "b730f880cfe85a8547f569355a21706f27ebfa78"; - sha256 = "0hh9j5zd2kc0804d2jmf1q3w5xm9l9s69hhgysbncrv5fw0414lh"; - }; - buildInputs = with pkgs; [ bashInteractive ]; # needed for bash-completion helper - propagatedBuildInputs = with self; [ urlgrabber m2crypto pyyaml lxml ]; - postInstall = '' - ln -s $out/bin/osc-wrapper.py $out/bin/osc - install -D -m444 osc.fish $out/etc/fish/completions/osc.fish - install -D -m555 dist/osc.complete $out/share/bash-completion/helpers/osc-helper - mkdir -p $out/share/bash-completion/completions - cat >>$out/share/bash-completion/completions/osc </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 - ''; - meta = { - description = "opensuse-commander with svn like handling"; - maintainers = [ maintainers.peti ]; - license = licenses.gpl2; - }; - }; + osc = callPackage ../development/python-modules/osc { }; rfc3986 = callPackage ../development/python-modules/rfc3986 { };