From 03a19a19d9b72738d7b8885759875b2387e25245 Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Mon, 15 Oct 2018 17:16:23 -0400 Subject: [PATCH] pythonPackages.m2crypto: refactor move to python-modules --- .../python-modules/m2crypto/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 23 +------------- 2 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 pkgs/development/python-modules/m2crypto/default.nix diff --git a/pkgs/development/python-modules/m2crypto/default.nix b/pkgs/development/python-modules/m2crypto/default.nix new file mode 100644 index 000000000000..87a74c79f553 --- /dev/null +++ b/pkgs/development/python-modules/m2crypto/default.nix @@ -0,0 +1,31 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pkgs +}: + + +buildPythonPackage rec { + version = "0.24.0"; + pname = "M2Crypto"; + + src = fetchPypi { + inherit pname version; + sha256 = "1s2y0pf2zg7xf4nfwrw7zhwbk615r5a7bgi5wwkwzh6jl50n99c0"; + }; + + buildInputs = [ pkgs.swig2 pkgs.openssl ]; + + preConfigure = '' + substituteInPlace setup.py --replace "self.openssl = '/usr'" "self.openssl = '${pkgs.openssl.dev}'" + ''; + + doCheck = false; # another test that depends on the network. + + meta = with stdenv.lib; { + description = "A Python crypto and SSL toolkit"; + homepage = http://chandlerproject.org/Projects/MeTooCrypto; + license = licenses.mit; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 85082f28490e..34603d6d9b75 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5773,28 +5773,7 @@ in { magic = callPackage ../development/python-modules/magic { }; - m2crypto = buildPythonPackage rec { - version = "0.24.0"; - name = "m2crypto-${version}"; - - src = pkgs.fetchurl { - url = "mirror://pypi/M/M2Crypto/M2Crypto-${version}.tar.gz"; - sha256 = "1s2y0pf2zg7xf4nfwrw7zhwbk615r5a7bgi5wwkwzh6jl50n99c0"; - }; - - buildInputs = with self; [ pkgs.swig2 pkgs.openssl ]; - - preConfigure = '' - substituteInPlace setup.py --replace "self.openssl = '/usr'" "self.openssl = '${pkgs.openssl.dev}'" - ''; - - doCheck = false; # another test that depends on the network. - - meta = { - description = "A Python crypto and SSL toolkit"; - homepage = http://chandlerproject.org/Projects/MeTooCrypto; - }; - }; + m2crypto = callPackage ../development/python-modules/m2crypto { }; Mako = callPackage ../development/python-modules/Mako { };