blob: 81c81645af240b1d98a2276afb816d867ac79741 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001SUMMARY = "A Python crypto and SSL toolkit"
2HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto"
3
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e"
6
7FILESEXTRAPATHS_prepend := "${THISDIR}/python-m2crypto:"
8
9SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch \
10 file://cross-compile-platform.patch \
11 file://m2crypto-0.26.4-gcc_macros.patch \
12 "
13SRC_URI[md5sum] = "7fce3cbf85eb84a669682892b935746b"
14SRC_URI[sha256sum] = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6"
15
16PYPI_PACKAGE = "M2Crypto"
17inherit pypi siteinfo
18
19DEPENDS += "openssl swig-native"
Andrew Geissler89770b02020-06-13 10:40:47 -050020RDEPENDS_${PN} += "\
21 ${PYTHON_PN}-datetime \
22 ${PYTHON_PN}-distutils \
23 ${PYTHON_PN}-logging \
24 ${PYTHON_PN}-netclient \
25 ${PYTHON_PN}-netserver \
26 ${PYTHON_PN}-numbers \
27 ${PYTHON_PN}-smtpd \
28 ${PYTHON_PN}-typing \
29 ${PYTHON_PN}-xmlrpc \
30"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080031
32DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR} -I${STAGING_INCDIR}"
33DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}"
34
35SWIG_FEATURES_x86 = "-D__i386__"
36SWIG_FEATURES_x32 = "-D__ILP32__"
37SWIG_FEATURES ?= "-D__${HOST_ARCH}__"
38export SWIG_FEATURES
39
40# Get around a problem with swig, but only if the
41# multilib header file exists.
42#
43do_configure_prepend() {
44 ${CPP} -dM - < /dev/null | grep -v '__\(STDC\|REGISTER_PREFIX\|GNUC\|STDC_HOSTED\)__' \
Brad Bishope42b3e32020-01-15 22:08:42 -050045 | sed 's/^\(#define \([^ ]*\) .*\)$/#undef \2\n\1/' > ${S}/SWIG/gcc_macros.h
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080046
47 if [ "${SITEINFO_BITS}" = "64" ];then
48 bit="64"
49 else
50 bit="32"
51 fi
52
53 if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then
54 for i in SWIG/_ec.i SWIG/_evp.i; do
Brad Bishope42b3e32020-01-15 22:08:42 -050055 sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "${S}/$i"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080056 done
57 elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then
58 for i in SWIG/_ec.i SWIG/_evp.i; do
Brad Bishope42b3e32020-01-15 22:08:42 -050059 sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "${S}/$i"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080060 done
61 fi
62}
63
64BBCLASSEXTEND = "native"