blob: 272c76ca17e3c89b179bfcfc5c59c7e9b932dcab [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "A Python crypto and SSL toolkit"
2HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto"
3
4LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e"
6
7SRC_URI += "file://0001-setup.py-link-in-sysroot-not-in-host-directories.patch \
8 file://cross-compile-platform.patch \
9 file://m2crypto-0.26.4-gcc_macros.patch \
10 "
11SRC_URI[md5sum] = "5c74c25ba8b45122318a165a3a2059ad"
12SRC_URI[sha256sum] = "5cae7acc0b34821f8c0ddf6665e482893fe1f198ad6379e61ffa9d8e65f5c199"
13
14PYPI_PACKAGE = "M2Crypto"
15inherit pypi setuptools siteinfo
16
17DEPENDS += "openssl swig-native"
18RDEPENDS_${PN} += "python-typing"
19
20DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_DIR_HOST} -I${STAGING_INCDIR}"
21DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_DIR_HOST}"
22
23SWIG_FEATURES_x86 = "-D__i386__"
24SWIG_FEATURES ?= "-D__${HOST_ARCH}__"
25export SWIG_FEATURES
26
27# Get around a problem with swig, but only if the
28# multilib header file exists.
29#
30do_compile_prepend() {
31 ${CPP} -dM - < /dev/null | grep -v __STDC__ | grep -v __REGISTER_PREFIX__ | grep -v __GNUC__ \
32 | sed 's/^\(#define \([^ ]*\) .*\)$/#undef \2\n\1/' > SWIG/gcc_macros.h
33 if [ "${SITEINFO_BITS}" = "64" ];then
34 bit="64"
35 else
36 bit="32"
37 fi
38
39 if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then
40 for i in SWIG/_ec.i SWIG/_evp.i; do
41 sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "$i"
42 done
43 elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then
44 for i in SWIG/_ec.i SWIG/_evp.i; do
45 sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "$i"
46 done
47 fi
48}
49
50BBCLASSEXTEND = "native"