Skip to content

Commit

Permalink
pythonPackages.pycrypto: dummy depending on pycryptodome, closes #21671
Browse files Browse the repository at this point in the history
  • Loading branch information
FRidh committed Jan 5, 2017
1 parent 0be446f commit 3b71936
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions pkgs/development/python-modules/pycrypto/default.nix
@@ -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;
};
}

3 comments on commit 3b71936

@phanimahesh
Copy link
Contributor

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.

@FRidh
Copy link
Member Author

@FRidh FRidh commented on 3b71936 Jan 7, 2017

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

@FRidh
Copy link
Member Author

@FRidh FRidh commented on 3b71936 Jan 7, 2017

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

Please sign in to comment.