[packages] python: Force usage of internal modules for hashlib instead of openssl
[packages.git] / lang / python / patches / 120-force-internal-modules-for-hashlib.patch
1 diff --git a/setup.py b/setup.py
2 index 0e08e74..65161db 100644
3 --- a/setup.py
4 +++ b/setup.py
5 @@ -622,9 +622,10 @@ class PyBuildExt(build_ext):
6  
7          #print 'openssl_ver = 0x%08x' % openssl_ver
8  
9 -        if (ssl_incs is not None and
10 -            ssl_libs is not None and
11 -            openssl_ver >= 0x00907000):
12 +#        if (ssl_incs is not None and
13 +#            ssl_libs is not None and
14 +#            openssl_ver >= 0x00907000):
15 +        if False:
16              # The _hashlib module wraps optimized implementations
17              # of hash functions from the OpenSSL library.
18              exts.append( Extension('_hashlib', ['_hashopenssl.c'],
19 @@ -644,7 +645,8 @@ class PyBuildExt(build_ext):
20                              depends = ['md5.h']) )
21              missing.append('_hashlib')
22  
23 -        if (openssl_ver < 0x00908000):
24 +#        if (openssl_ver < 0x00908000):
25 +        if True:
26              # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
27              exts.append( Extension('_sha256', ['sha256module.c']) )
28              exts.append( Extension('_sha512', ['sha512module.c']) )