From 9c69f1790dba5a89d712ec45be5583aabb21a7cf Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 26 Oct 2018 09:06:08 -0400 Subject: [PATCH] pythonPackages.pycryptopp: refactor move to python-modules --- .../python-modules/pycryptopp/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 27 +-------------- 2 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 pkgs/development/python-modules/pycryptopp/default.nix diff --git a/pkgs/development/python-modules/pycryptopp/default.nix b/pkgs/development/python-modules/pycryptopp/default.nix new file mode 100644 index 00000000000..785da4f6dc8 --- /dev/null +++ b/pkgs/development/python-modules/pycryptopp/default.nix @@ -0,0 +1,34 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, isPy3k +, isPyPy +, setuptoolsDarcs +, darcsver +, pkgs +}: + +buildPythonPackage rec { + pname = "pycryptopp"; + version = "0.6.0.1206569328141510525648634803928199668821045408958"; + disabled = isPy3k || isPyPy; # see https://bitbucket.org/pypy/pypy/issue/1190/ + + src = fetchPypi { + inherit pname version; + sha256 = "0n90h1yg7bfvlbhnc54xb6dbqm286ykaksyg04kxlhyjgf8mhq8i"; + }; + + # Prefer crypto++ library from the Nix store over the one that's included + # in the pycryptopp distribution. + preConfigure = "export PYCRYPTOPP_DISABLE_EMBEDDED_CRYPTOPP=1"; + + buildInputs = [ setuptoolsDarcs darcsver pkgs.cryptopp ]; + + meta = with stdenv.lib; { + homepage = http://allmydata.org/trac/pycryptopp; + description = "Python wrappers for the Crypto++ library"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8c2868dea93..0ea08132bf9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3287,32 +3287,7 @@ in { pycosat = callPackage ../development/python-modules/pycosat { }; - pycryptopp = buildPythonPackage (rec { - name = "pycryptopp-0.6.0.1206569328141510525648634803928199668821045408958"; - disabled = isPy3k || isPyPy; # see https://bitbucket.org/pypy/pypy/issue/1190/ - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pycryptopp/${name}.tar.gz"; - sha256 = "0n90h1yg7bfvlbhnc54xb6dbqm286ykaksyg04kxlhyjgf8mhq8i"; - }; - - # Prefer crypto++ library from the Nix store over the one that's included - # in the pycryptopp distribution. - preConfigure = "export PYCRYPTOPP_DISABLE_EMBEDDED_CRYPTOPP=1"; - - buildInputs = with self; [ setuptoolsDarcs darcsver pkgs.cryptopp ]; - - meta = { - homepage = http://allmydata.org/trac/pycryptopp; - - description = "Python wrappers for the Crypto++ library"; - - license = licenses.gpl2Plus; - - maintainers = [ ]; - platforms = platforms.linux; - }; - }); + pycryptopp = callPackage ../development/python-modules/pycryptopp { }; pycups = callPackage ../development/python-modules/pycups { };