kumquat-buildroot/package/python-m2crypto/python-m2crypto.mk
Thomas Petazzoni 539eabe594 python-m2crypto: different fix for the OpenSSL problem
m2crypto provides a --openssl option to specify the location of the
OpenSSL library, when not installed in /usr. However, this option does
not apply to the standard "build" command normally called by the
python-package infrastructure, but only to the "build_ext" command.

This already required to override the default python-package build
commands for this package. Moreover, this the last bump to version
0.22.5, things got even more complicated since calling just
"build_ext" does not work, and additional quirks are needed.

This commit proposes to get away with this by relying on the default
python-package behavior, and simply hardcoding the OpenSSL location by
patching the setup.py script in a post-patch hook.

This issue has also been reported upstream at
https://gitlab.com/m2crypto/m2crypto/issues/89.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-12-12 16:59:37 +01:00

29 lines
1.1 KiB
Makefile

################################################################################
#
# python-m2crypto
#
################################################################################
PYTHON_M2CRYPTO_VERSION = 0.22.5
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
# 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))