Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythonPackages.pycrypto: dummy depending on pycryptodome, closes #21671
- Loading branch information
Showing
1 changed file
with
17 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
{ stdenv, fetchurl, fetchpatch, python, buildPythonPackage, gmp }: | ||
{ stdenv, fetchurl, buildPythonPackage, pycryptodome }: | ||
|
||
buildPythonPackage rec { | ||
name = "pycrypto-2.6.1"; | ||
namePrefix = ""; | ||
# This is a dummy package providing the drop-in replacement pycryptodome. | ||
# https://github.com/NixOS/nixpkgs/issues/21671 | ||
|
||
src = fetchurl { | ||
url = "mirror://pypi/p/pycrypto/${name}.tar.gz"; | ||
sha256 = "0g0ayql5b9mkjam8hym6zyg6bv77lbh66rv1fyvgqb17kfc1xkpj"; | ||
}; | ||
let | ||
version = pycryptodome.version; | ||
pname = "pycrypto"; | ||
in buildPythonPackage rec { | ||
name = "${pname}-${version}"; | ||
|
||
patches = [ | ||
(fetchpatch { | ||
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"; | ||
}) | ||
]; | ||
# Cannot build wheel otherwise (zip 1980 issue) | ||
SOURCE_DATE_EPOCH=315532800; | ||
|
||
preConfigure = '' | ||
sed -i 's,/usr/include,/no-such-dir,' configure | ||
sed -i "s!,'/usr/include/'!!" setup.py | ||
# We need to have a dist-info folder, so let's create one with setuptools | ||
unpackPhase = '' | ||
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 = { | ||
homepage = "http://www.pycrypto.org/"; | ||
description = "Python Cryptography Toolkit"; | ||
platforms = stdenv.lib.platforms.unix; | ||
platforms = pycryptodome.meta.platforms; | ||
}; | ||
} |
3b71936
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the homepage and description be updated as well? I guess homepage should point to either pycryptodome or the github issue and decsription should mention that it is a fake.
3b71936
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow this doesn't work now...investigating
3b71936
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it does work correctly, I was looking at the wrong Hydra and branch :-P