blob: 1d8c22d19658e49b38ac8724f51d118b5d93c1cc [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001SUMMARY = "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://avoid-host-contamination.patch \
12 file://0001-setup.py-address-openssl-3.x-build-issue.patch \
13 "
14SRC_URI[sha256sum] = "bbfd113ec55708c05816252a4f09e4237df4f3bbfc8171cbbc33057d257bbb30"
15
16PYPI_PACKAGE = "M2Crypto"
17inherit pypi siteinfo setuptools3
18
19DEPENDS += "openssl swig-native"
20RDEPENDS:${PN} += "\
Patrick Williams39653562024-03-01 08:54:02 -060021 python3-datetime \
22 python3-setuptools \
23 python3-logging \
24 python3-netclient \
25 python3-netserver \
26 python3-numbers \
27 python3-xmlrpc \
Patrick Williamsac13d5f2023-11-24 18:59:46 -060028"
29
30DISTUTILS_BUILD_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR} -I${STAGING_INCDIR}"
31DISTUTILS_INSTALL_ARGS += "build_ext --openssl=${STAGING_EXECPREFIXDIR}"
32
33SWIG_FEATURES ?= "-D__${HOST_ARCH}__ ${@['-D__ILP32__','-D__LP64__'][d.getVar('SITEINFO_BITS') != '32']} -DOPENSSL_NO_FILENAMES"
34
35SWIG_FEATURES:append:riscv64 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}"
36SWIG_FEATURES:append:riscv32 = " -D__SIZEOF_POINTER__=${SITEINFO_BITS}/8 -D__riscv_xlen=${SITEINFO_BITS}"
37SWIG_FEATURES:append:mipsarch = " -D_MIPS_SZPTR=${SITEINFO_BITS}"
38SWIG_FEATURES:append:powerpc64le = " -D__powerpc64__"
39SWIG_FEATURES:append:x86 = " -D__i386__"
40SWIG_FEATURES:append:x32 = " -D__ILP32__"
41
42export SWIG_FEATURES
43
44export STAGING_DIR
45
46do_install:append() {
47 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/M2Crypto/SSL/__pycache__/*.cpython-*.pyc
48 rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/M2Crypto/__pycache__/*.cpython-*.pyc
49}
50
51BBCLASSEXTEND = "native"