Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | SUMMARY = "A Python crypto and SSL toolkit" |
| 2 | HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto" |
| 3 | |
| 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://LICENCE;md5=b0e1f0b7d0ce8a62c18b1287b991800e" |
| 6 | |
| 7 | FILESEXTRAPATHS_prepend := "${THISDIR}/python-m2crypto:" |
| 8 | |
| 9 | SRC_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 | " |
| 13 | SRC_URI[md5sum] = "7fce3cbf85eb84a669682892b935746b" |
| 14 | SRC_URI[sha256sum] = "a1b2751cdadc6afac3df8a5799676b7b7c67a6ad144bb62d38563062e7cd3fc6" |
| 15 | |
| 16 | PYPI_PACKAGE = "M2Crypto" |
| 17 | inherit pypi siteinfo |
| 18 | |
| 19 | DEPENDS += "openssl swig-native" |
| 20 | RDEPENDS_${PN} += "python-typing" |
| 21 | |
| 22 | DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR} -I${STAGING_INCDIR}" |
| 23 | DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}" |
| 24 | |
| 25 | SWIG_FEATURES_x86 = "-D__i386__" |
| 26 | SWIG_FEATURES_x32 = "-D__ILP32__" |
| 27 | SWIG_FEATURES ?= "-D__${HOST_ARCH}__" |
| 28 | export SWIG_FEATURES |
| 29 | |
| 30 | # Get around a problem with swig, but only if the |
| 31 | # multilib header file exists. |
| 32 | # |
| 33 | do_configure_prepend() { |
| 34 | ${CPP} -dM - < /dev/null | grep -v '__\(STDC\|REGISTER_PREFIX\|GNUC\|STDC_HOSTED\)__' \ |
| 35 | | sed 's/^\(#define \([^ ]*\) .*\)$/#undef \2\n\1/' > SWIG/gcc_macros.h |
| 36 | |
| 37 | if [ "${SITEINFO_BITS}" = "64" ];then |
| 38 | bit="64" |
| 39 | else |
| 40 | bit="32" |
| 41 | fi |
| 42 | |
| 43 | if [ -e ${STAGING_INCDIR}/openssl/opensslconf-${bit}.h ] ;then |
| 44 | for i in SWIG/_ec.i SWIG/_evp.i; do |
| 45 | sed -i -e "s/opensslconf.*\./opensslconf-${bit}\./" "$i" |
| 46 | done |
| 47 | elif [ -e ${STAGING_INCDIR}/openssl/opensslconf-n${bit}.h ] ;then |
| 48 | for i in SWIG/_ec.i SWIG/_evp.i; do |
| 49 | sed -i -e "s/opensslconf.*\./opensslconf-n${bit}\./" "$i" |
| 50 | done |
| 51 | fi |
| 52 | } |
| 53 | |
| 54 | BBCLASSEXTEND = "native" |