Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | SUMMARY = "A Python crypto and SSL toolkit" |
| 2 | HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" |
| 3 | |
| 4 | LICENSE = "BSD" |
| 5 | LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e" |
| 6 | |
| 7 | SRC_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 | " |
| 11 | SRC_URI[md5sum] = "5c74c25ba8b45122318a165a3a2059ad" |
| 12 | SRC_URI[sha256sum] = "5cae7acc0b34821f8c0ddf6665e482893fe1f198ad6379e61ffa9d8e65f5c199" |
| 13 | |
| 14 | PYPI_PACKAGE = "M2Crypto" |
| 15 | inherit pypi setuptools siteinfo |
| 16 | |
| 17 | DEPENDS += "openssl swig-native" |
| 18 | RDEPENDS_${PN} += "python-typing" |
| 19 | |
| 20 | DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_DIR_HOST} -I${STAGING_INCDIR}" |
| 21 | DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_DIR_HOST}" |
| 22 | |
| 23 | SWIG_FEATURES_x86 = "-D__i386__" |
| 24 | SWIG_FEATURES ?= "-D__${HOST_ARCH}__" |
| 25 | export SWIG_FEATURES |
| 26 | |
| 27 | # Get around a problem with swig, but only if the |
| 28 | # multilib header file exists. |
| 29 | # |
| 30 | do_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 | |
| 50 | BBCLASSEXTEND = "native" |