pythonPackages.pycrypto: dummy depending on pycryptodome, closes #21671
This commit is contained in:
parent
0be446fbfa
commit
3b7193604f
@ -1,34 +1,30 @@
|
|||||||
{ stdenv, fetchurl, fetchpatch, python, buildPythonPackage, gmp }:
|
{ stdenv, fetchurl, buildPythonPackage, pycryptodome }:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
# This is a dummy package providing the drop-in replacement pycryptodome.
|
||||||
name = "pycrypto-2.6.1";
|
# https://github.com/NixOS/nixpkgs/issues/21671
|
||||||
namePrefix = "";
|
|
||||||
|
|
||||||
src = fetchurl {
|
let
|
||||||
url = "mirror://pypi/p/pycrypto/${name}.tar.gz";
|
version = pycryptodome.version;
|
||||||
sha256 = "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj";
|
pname = "pycrypto";
|
||||||
};
|
in buildPythonPackage rec {
|
||||||
|
name = "${pname}-${version}";
|
||||||
|
|
||||||
patches = [
|
# Cannot build wheel otherwise (zip 1980 issue)
|
||||||
(fetchpatch {
|
SOURCE_DATE_EPOCH=315532800;
|
||||||
name = "CVE-2013-7459.patch";
|
|
||||||
url = "https://anonscm.debian.org/cgit/collab-maint/python-crypto.git/plain/debian/patches/CVE-2013-7459.patch?h=debian/2.6.1-7";
|
|
||||||
sha256 = "01r7aghnchc1bpxgdv58qyi2085gh34bxini973xhy3ks7fq3ir9";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
preConfigure = ''
|
# We need to have a dist-info folder, so let's create one with setuptools
|
||||||
sed -i 's,/usr/include,/no-such-dir,' configure
|
unpackPhase = ''
|
||||||
sed -i "s!,'/usr/include/'!!" setup.py
|
echo "from setuptools import setup; setup(name='${pname}', version='${version}', install_requires=['pycryptodome'])" > setup.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = stdenv.lib.optional (!python.isPypy or false) gmp; # optional for pypy
|
propagatedBuildInputs = [ pycryptodome ];
|
||||||
|
|
||||||
doCheck = !(python.isPypy or stdenv.isDarwin); # error: AF_UNIX path too long
|
# Our dummy has no tests
|
||||||
|
doCheck = false;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "http://www.pycrypto.org/";
|
homepage = "http://www.pycrypto.org/";
|
||||||
description = "Python Cryptography Toolkit";
|
description = "Python Cryptography Toolkit";
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = pycryptodome.meta.platforms;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user