Patchwork [PATCHv2,3/3] python-m2crypto: new package

login
register
mail settings
Submitter Gustavo Zacarias
Date April 10, 2013, 8:29 p.m.
Message ID <1365625766-11256-3-git-send-email-gustavo@zacarias.com.ar>
Download mbox | patch
Permalink /patch/235480/
State Superseded
Headers show

Comments

Gustavo Zacarias - April 10, 2013, 8:29 p.m.
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/Config.in                          |  1 +
 package/python-m2crypto/Config.in          | 10 ++++++++
 package/python-m2crypto/python-m2crypto.mk | 40 ++++++++++++++++++++++++++++++
 3 files changed, 51 insertions(+)
 create mode 100644 package/python-m2crypto/Config.in
 create mode 100644 package/python-m2crypto/python-m2crypto.mk
Peter Korsgaard - April 18, 2013, 8:09 p.m.
>>>>> "Gustavo" == Gustavo Zacarias <gustavo@zacarias.com.ar> writes:

 Gustavo> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
 Gustavo> ---
 Gustavo>  package/Config.in                          |  1 +
 Gustavo>  package/python-m2crypto/Config.in          | 10 ++++++++
 Gustavo>  package/python-m2crypto/python-m2crypto.mk | 40 ++++++++++++++++++++++++++++++
 Gustavo>  3 files changed, 51 insertions(+)
 Gustavo>  create mode 100644 package/python-m2crypto/Config.in
 Gustavo>  create mode 100644 package/python-m2crypto/python-m2crypto.mk

 Gustavo> diff --git a/package/Config.in b/package/Config.in
 Gustavo> index 2e7dc67..0537ffa 100644
 Gustavo> --- a/package/Config.in
 Gustavo> +++ b/package/Config.in
 Gustavo> @@ -327,6 +327,7 @@ menu "external python modules"
 Gustavo>  source "package/python-bottle/Config.in"
 Gustavo>  source "package/python-dpkt/Config.in"
 Gustavo>  source "package/python-id3/Config.in"
 Gustavo> +source "package/python-m2crypto/Config.in"
 Gustavo>  source "package/python-mad/Config.in"
 Gustavo>  source "package/python-meld3/Config.in"
 Gustavo>  source "package/python-netifaces/Config.in"
 Gustavo> diff --git a/package/python-m2crypto/Config.in b/package/python-m2crypto/Config.in
 Gustavo> new file mode 100644
 Gustavo> index 0000000..2ee4ab1
 Gustavo> --- /dev/null
 Gustavo> +++ b/package/python-m2crypto/Config.in
 Gustavo> @@ -0,0 +1,10 @@
 Gustavo> +config BR2_PACKAGE_PYTHON_M2CRYPTO
 Gustavo> +	bool "python-m2crypto"
 Gustavo> +	depends on BR2_PACKAGE_PYTHON
 Gustavo> +	select BR2_PACKAGE_OPENSSL
 Gustavo> +	select BR2_PACKAGE_PYTHON_ZLIB
 Gustavo> +	select BR2_PACKAGE_PYTHON_SETUPTOOLS
 Gustavo> +	help
 Gustavo> +	  M2Crypto is the most complete Python wrapper for OpenSSL.
 Gustavo> +
 Gustavo> +	  http://chandlerproject.org/Projects/MeTooCrypto

Thanks, but it doesn't seem to build here (arma8, internal toolchain):

creating build/temp.linux-x86_64-2.7/SWIG
/home/peko/source/buildroot/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC -I/home/peko/source/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/python2.7 -I/usr/include -I/home/peko/source/buildroot/output/build/python-m2crypto-0.21.1/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.linux-x86_64-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
In file included from /usr/include/limits.h:27:0,
                 from /home/peko/source/buildroot/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/python2.7/Python.h:19,
                 from SWIG/_m2crypto_wrap.c:126:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory

It ends up using host includes.

Patch

diff --git a/package/Config.in b/package/Config.in
index 2e7dc67..0537ffa 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -327,6 +327,7 @@  menu "external python modules"
 source "package/python-bottle/Config.in"
 source "package/python-dpkt/Config.in"
 source "package/python-id3/Config.in"
+source "package/python-m2crypto/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-netifaces/Config.in"
diff --git a/package/python-m2crypto/Config.in b/package/python-m2crypto/Config.in
new file mode 100644
index 0000000..2ee4ab1
--- /dev/null
+++ b/package/python-m2crypto/Config.in
@@ -0,0 +1,10 @@ 
+config BR2_PACKAGE_PYTHON_M2CRYPTO
+	bool "python-m2crypto"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_PYTHON_ZLIB
+	select BR2_PACKAGE_PYTHON_SETUPTOOLS
+	help
+	  M2Crypto is the most complete Python wrapper for OpenSSL.
+
+	  http://chandlerproject.org/Projects/MeTooCrypto
diff --git a/package/python-m2crypto/python-m2crypto.mk b/package/python-m2crypto/python-m2crypto.mk
new file mode 100644
index 0000000..8a8de84
--- /dev/null
+++ b/package/python-m2crypto/python-m2crypto.mk
@@ -0,0 +1,40 @@ 
+#############################################################
+#
+# python-m2crypto
+#
+#############################################################
+
+PYTHON_M2CRYPTO_VERSION = 0.21.1
+PYTHON_M2CRYPTO_SITE = http://pypi.python.org/packages/source/M/M2Crypto
+PYTHON_M2CRYPTO_SOURCE = M2Crypto-$(PYTHON_M2CRYPTO_VERSION).tar.gz
+PYTHON_M2CRYPTO_DEPENDENCIES = openssl python host-python-setuptools host-python-distutilscross host-swig
+HOST_PYTHON_M2CRYPTO_DEPENDENCIES = host-openssl host-python host-python-setuptools host-swig
+
+define HOST_PYTHON_M2CRYPTO_BUILD_CMDS
+	(cd $(@D); \
+		$(HOST_CONFIGURE_OPTS) \
+		PYTHONXCPREFIX="$(HOST_DIR)/usr/" \
+		LDFLAGS="-L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib" \
+	$(HOST_DIR)/usr/bin/python setup.py build_ext --openssl=$(HOST_DIR)/usr)
+endef
+
+define PYTHON_M2CRYPTO_BUILD_CMDS
+	(cd $(@D); \
+		$(TARGET_CONFIGURE_OPTS) \
+		PYTHONXCPREFIX="$(STAGING_DIR)/usr/" \
+		LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
+	$(HOST_DIR)/usr/bin/python setup.py build -x bdist_egg --exclude-source-files)
+endef
+
+define HOST_PYTHON_M2CRYPTO_INSTALL_CMDS
+	(cd $(@D); PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
+endef
+
+define PYTHON_M2CRYPTO_INSTALL_TARGET_CMDS
+	(cd $(@D); PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
+	$(HOST_DIR)/usr/bin/python setup.py install --single-version-externally-managed --root=/ --prefix=$(TARGET_DIR)/usr)
+endef
+
+$(eval $(generic-package))
+$(eval $(host-generic-package))