From 522a8a84d2b10cb3525f0552398a38754ebcc783 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 23:37:42 -0400 Subject: [PATCH] pythonPackages.gnutls: refactor move to python-modules --- .../python-modules/gnutls/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 17 +--------- 2 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 pkgs/development/python-modules/gnutls/default.nix diff --git a/pkgs/development/python-modules/gnutls/default.nix b/pkgs/development/python-modules/gnutls/default.nix new file mode 100644 index 000000000000..a58177e7544c --- /dev/null +++ b/pkgs/development/python-modules/gnutls/default.nix @@ -0,0 +1,31 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, isPy3k +, pkgs +}: + +buildPythonPackage rec { + pname = "python-gnutls"; + version = "3.0.0"; + + # https://github.com/AGProjects/python-gnutls/issues/2 + disabled = isPy3k; + + src = fetchPypi { + inherit pname version; + sha256 = "1yrdxcj5rzvz8iglircz6icvyggz5fmdcd010n6w3j60yp4p84kc"; + }; + + propagatedBuildInputs = [ pkgs.gnutls ]; + patchPhase = '' + substituteInPlace gnutls/library/__init__.py --replace "/usr/local/lib" "${pkgs.gnutls.out}/lib" + ''; + + meta = with stdenv.lib; { + description = "Python wrapper for the GnuTLS library"; + homepage = https://github.com/AGProjects/python-gnutls; + license = licenses.lgpl2; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 247bf21c694a..589694b441dd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1816,22 +1816,7 @@ in { gnureadline = callPackage ../development/python-modules/gnureadline { }; - gnutls = buildPythonPackage rec { - pname = "python-gnutls"; - version = "3.0.0"; - src = pkgs.fetchurl { - url = "mirror://pypi/p/python-gnutls/${pname}-${version}.tar.gz"; - sha256 = "1yrdxcj5rzvz8iglircz6icvyggz5fmdcd010n6w3j60yp4p84kc"; - }; - - # https://github.com/AGProjects/python-gnutls/issues/2 - disabled = isPy3k; - - propagatedBuildInputs = with self; [ pkgs.gnutls ]; - patchPhase = '' - substituteInPlace gnutls/library/__init__.py --replace "/usr/local/lib" "${pkgs.gnutls.out}/lib" - ''; - }; + gnutls = callPackage ../development/python-modules/gnutls { }; gpy = callPackage ../development/python-modules/gpy { };