From: lars Date: Mon, 22 Mar 2010 18:49:35 +0000 (+0000) Subject: [packages] python: Force usage of internal modules for hashlib instead of openssl X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=c14f4648e25be5cc39a9ae4df9d55fc67d1491f6;p=packages.git [packages] python: Force usage of internal modules for hashlib instead of openssl Python can either use it's own implementation for the hashlib functions or it can use openssl. If openssl is installed it will choose the openssl based variant. But since openssl is not a dependency, but could have been build before python we'll have to force the python build to choose the internal variant. Fixes #6883 git-svn-id: svn://svn.openwrt.org/openwrt/packages@20372 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/lang/python/Makefile b/lang/python/Makefile index ac1962f86..d441c3de5 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -299,9 +299,13 @@ define PyPackage/python-mini/filespec +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_md5.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha256.so ++|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sha512.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so +|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so diff --git a/lang/python/patches/120-force-internal-modules-for-hashlib.patch b/lang/python/patches/120-force-internal-modules-for-hashlib.patch new file mode 100644 index 000000000..eae7de821 --- /dev/null +++ b/lang/python/patches/120-force-internal-modules-for-hashlib.patch @@ -0,0 +1,28 @@ +diff --git a/setup.py b/setup.py +index 0e08e74..65161db 100644 +--- a/setup.py ++++ b/setup.py +@@ -622,9 +622,10 @@ class PyBuildExt(build_ext): + + #print 'openssl_ver = 0x%08x' % openssl_ver + +- if (ssl_incs is not None and +- ssl_libs is not None and +- openssl_ver >= 0x00907000): ++# if (ssl_incs is not None and ++# ssl_libs is not None and ++# openssl_ver >= 0x00907000): ++ if False: + # The _hashlib module wraps optimized implementations + # of hash functions from the OpenSSL library. + exts.append( Extension('_hashlib', ['_hashopenssl.c'], +@@ -644,7 +645,8 @@ class PyBuildExt(build_ext): + depends = ['md5.h']) ) + missing.append('_hashlib') + +- if (openssl_ver < 0x00908000): ++# if (openssl_ver < 0x00908000): ++ if True: + # OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash + exts.append( Extension('_sha256', ['sha256module.c']) ) + exts.append( Extension('_sha512', ['sha512module.c']) )