Skip to contentSkip to conversation

python-pycrypto: add host variant

PATCH New Gustavo Zacarias 2 participants 5 messages Mar 30, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 python-pycrypto: add host variant

Will be used by the crda python3-enabling patch.

---
 package/python-pycrypto/python-pycrypto.mk | 2 ++
 1 file changed, 2 insertions(+)
package/python-pycrypto/python-pycrypto.mk +2 -0
index bb69f41..20ff4a3 100644
@@ -22,6 +22,7 @@ define PYTHON_PYCRYPTO_RENAME_LICENSE
 	mv $(@D)/LEGAL/copy/LICENSE.orig $(@D)/LEGAL/copy/LICENSE.original
 endef
 PYTHON_PYCRYPTO_POST_EXTRACT_HOOKS += PYTHON_PYCRYPTO_RENAME_LICENSE
+HOST_PYTHON_PYCRYPTO_POST_EXTRACT_HOOKS += PYTHON_PYCRYPTO_RENAME_LICENSE
 PYTHON_PYCRYPTO_LICENSE_FILES += LEGAL/copy/LICENSE.original
 
 PYTHON_PYCRYPTO_DEPENDENCIES = gmp
@@ -44,3 +45,4 @@ define PYTHON_PYCRYPTO_CONFIGURE_CMDS
 endef
 
 $(eval $(python-package))
+$(eval $(host-python-package))
Signature · 1 line
2.7.3
#1 lore raw

PATCH 2/4 python-pycrypto: bump to version 2.6.1

---
 package/python-pycrypto/python-pycrypto.hash | 2 +-
 package/python-pycrypto/python-pycrypto.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/python-pycrypto/python-pycrypto.hash +1 -1
index e7f809a..4637894 100644
@@ -1,2 +1,2 @@
 # Locally calculated after checking pgp signature
-sha256	7293c9d7e8af2e44a82f86eb9c3b058880f4bcc884bf3ad6c8a34b64986edde8	pycrypto-2.6.tar.gz
+sha256	f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c	pycrypto-2.6.1.tar.gz
package/python-pycrypto/python-pycrypto.mk +1 -1
index 20ff4a3..71943fa 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-PYTHON_PYCRYPTO_VERSION = 2.6
+PYTHON_PYCRYPTO_VERSION = 2.6.1
 PYTHON_PYCRYPTO_SOURCE = pycrypto-$(PYTHON_PYCRYPTO_VERSION).tar.gz
 PYTHON_PYCRYPTO_SITE = http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto
 PYTHON_PYCRYPTO_SETUP_TYPE = distutils
Signature · 1 line
2.7.3
#2 lore raw

PATCH 3/4 crda: enable host-python3 build support

In reply to Gustavo Zacarias

Add an upstream-submitted (but not accepted) patch in order to allow crda to be built with python2 as well as python3.
This drops m2crypto usage (python2-only) in favour of pycrypto which can be built against both major versions.

---
 ...file-allow-to-override-python-interpreter.patch |  34 ---
 ...crda-support-python-3-in-utils-key2pub.py.patch | 271 +++++++++++++++++++++
 package/crda/crda.mk                               |   9 +-
 3 files changed, 272 insertions(+), 42 deletions(-)
 delete mode 100644 package/crda/0001-Makefile-allow-to-override-python-interpreter.patch
 create mode 100644 package/crda/0001-crda-support-python-3-in-utils-key2pub.py.patch
package/crda/0001-Makefile-allow-to-override-python-interpreter.patch deleted +0 -34
deleted file mode 100644
index 2481390..0000000
@@ -1,34 +0,0 @@
-From 6831024a247fd89c7f7adcbee8a0be991b3caaf4 Mon Sep 17 00:00:00 2001
-From: Samuel Martin <[email protected]>
-Date: Sun, 2 Mar 2014 23:45:44 +0100
-Subject: [PATCH] Makefile: allow to override python interpreter
-
-Signed-off-by: Samuel Martin <[email protected]>
----
- Makefile | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/Makefile b/Makefile
-index 1d34bde..d7134ff 100644
---- a/Makefile
-+++ b/Makefile
-@@ -42,6 +42,7 @@ LDLIBS += -lgcrypt
- reglib.o: keys-gcrypt.c
- 
- endif
-+PYTHON ?= python2
- MKDIR ?= mkdir -p
- INSTALL ?= install
- 
-@@ -103,7 +104,7 @@ $(REG_BIN):
- keys-%.c: utils/key2pub.py $(wildcard $(PUBKEY_DIR)/*.pem)
- 	$(NQ) '  GEN ' $@
- 	$(NQ) '  Trusted pubkeys:' $(wildcard $(PUBKEY_DIR)/*.pem)
--	$(Q)./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
-+	$(Q)$(PYTHON) ./utils/key2pub.py --$* $(wildcard $(PUBKEY_DIR)/*.pem) $@
- 
- %.o: %.c regdb.h reglib.h
- 	$(NQ) '  CC  ' $@
--- 
-1.9.0
-
package/crda/0001-crda-support-python-3-in-utils-key2pub.py.patch new file +271 -0

271 lines not on this page · raw message

package/crda/crda.mk +1 -8
index 24bfd5f..df879f6 100644
@@ -7,19 +7,12 @@
 CRDA_VERSION = 3.18
 CRDA_SOURCE = crda-$(CRDA_VERSION).tar.xz
 CRDA_SITE = $(BR2_KERNEL_MIRROR)/software/network/crda
-CRDA_DEPENDENCIES = host-pkgconf host-python-m2crypto \
-	libnl libgcrypt host-python
+CRDA_DEPENDENCIES = host-pkgconf host-python-pycrypto libnl libgcrypt
 CRDA_LICENSE = ISC
 CRDA_LICENSE_FILES = LICENSE
 
-# * key2pub.py currently is not python3 compliant (though python2/python3
-#   compliance could rather easily be achieved.
-# * key2pub.py uses M2Crypto python module, which is only available for
-#   python2, so we have to make sure this script is run using the python2
-#   interpreter, hence the host-python dependency and the PYTHON variable.
 define CRDA_BUILD_CMDS
 	$(TARGET_CONFIGURE_OPTS) \
-		PYTHON=$(HOST_DIR)/usr/bin/python2 \
 		$(MAKE) all_noverify -C $(@D)
 endef
 
Signature · 1 line
2.7.3
#3 lore raw

PATCH 4/4 python-m2crypto: remove

In reply to Gustavo Zacarias

It only provided the host variant, which was only used by crda (no longer necessary), and wasn't available as a host selection.

---
 package/python-m2crypto/python-m2crypto.hash |  3 ---
 package/python-m2crypto/python-m2crypto.mk   | 31 ----------------------------
 2 files changed, 34 deletions(-)
 delete mode 100644 package/python-m2crypto/python-m2crypto.hash
 delete mode 100644 package/python-m2crypto/python-m2crypto.mk
package/python-m2crypto/python-m2crypto.hash deleted +0 -3
deleted file mode 100644
index 4ac180f..0000000
@@ -1,3 +0,0 @@
-# md5 from https://pypi.python.org/pypi/M2Crypto/, sha256 locally computed
-md5 8e87235942c76d1ba9f999ee33764fdb M2Crypto-0.24.0.tar.gz
-sha256 80a56441a1d2c0cf27e725be7554c92598b938fc8767ee2c71fdbc2fdc055ee8 M2Crypto-0.24.0.tar.gz
package/python-m2crypto/python-m2crypto.mk deleted +0 -31
deleted file mode 100644
index 3d0e54e..0000000
@@ -1,31 +0,0 @@
-################################################################################
-#
-# python-m2crypto
-#
-################################################################################
-
-PYTHON_M2CRYPTO_VERSION = 0.24.0
-PYTHON_M2CRYPTO_SITE = http://pypi.python.org/packages/source/M/M2Crypto
-PYTHON_M2CRYPTO_SOURCE = M2Crypto-$(PYTHON_M2CRYPTO_VERSION).tar.gz
-PYTHON_M2CRYPTO_SETUP_TYPE = setuptools
-HOST_PYTHON_M2CRYPTO_DEPENDENCIES = host-openssl host-swig
-
-PYTHON_M2CRYPTO_LICENSE = MIT
-PYTHON_M2CRYPTO_LICENSE_FILES = LICENCE
-
-# We need to use python2 because m2crypto is not python3 compliant.
-HOST_PYTHON_M2CRYPTO_NEEDS_HOST_PYTHON = python2
-
-# The --openssl option that allows to specify a custom path to OpenSSL
-# can only be used with the non-default build_ext setup.py command,
-# and calling this command directly fails. To work around this, simply
-# hardcode the path to OpenSSL in setup.py.
-# Bug reported at https://gitlab.com/m2crypto/m2crypto/issues/89
-define HOST_PYTHON_M2CRYPTO_SET_OPENSSL_PATH
-	$(SED) "s%self.openssl = '/usr'%self.openssl = '$(HOST_DIR)/usr'%" \
-		$(@D)/setup.py
-endef
-
-HOST_PYTHON_M2CRYPTO_POST_PATCH_HOOKS += HOST_PYTHON_M2CRYPTO_SET_OPENSSL_PATH
-
-$(eval $(host-python-package))
Signature · 1 line
2.7.3
#4 lore raw

PATCH 1/4 python-pycrypto: add host variant

In reply to Gustavo Zacarias

Hello,

Quoted 6 lines · Gustavo Zacarias

Will be used by the crda python3-enabling patch.

---
 package/python-pycrypto/python-pycrypto.mk | 2 ++
 1 file changed, 2 insertions(+)

All four patches applied to master, thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com