Alper Ak ad2a75a0ac
mraa: Add patch for CMake 4+ compatibility
Fix:

| CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
|   Compatibility with CMake < 3.5 has been removed from CMake.
|
|   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
|   to tell CMake that the project requires at least <min> but has been updated
|   to work with policies introduced by <max> or earlier.
|
|   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
|
|
| -- Configuring incomplete, errors occurred!

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-07-09 13:35:17 -07:00

68 lines
2.6 KiB
BlitzBasic

SUMMARY = "Linux Library for low speed I/O Communication"
HOMEPAGE = "https://github.com/intel-iot-devkit/mraa"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=91e7de50a8d3cf01057f318d72460acd"
SRCREV = "3c288a09109969eef9c2da7d92d3c62f92a015cc"
PV = "2.2.0+git"
SRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=https;branch=master \
file://0001-cmake-Use-a-regular-expression-to-match-x86-architec.patch \
file://0001-mraa-Use-posix-basename.patch \
file://0002-gpio-Include-limits.h-for-PATH_MAX.patch \
file://0003-allow-build-with-cmake-4.patch \
"
# CMakeLists.txt checks the architecture, only x86 and ARM supported for now
COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
inherit cmake setuptools3-base
DEPENDS += "json-c"
EXTRA_OECMAKE:append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=ON -DPYTHON2_LIBRARY=OFF \
-DPYTHON3_PACKAGES_PATH:PATH=${baselib}/python${PYTHON_BASEVERSION}/site-packages \
-DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \
-DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
"
# Prepend mraa-utils to make sure bindir ends up in there
PACKAGES =+ "${PN}-utils"
FILES:${PN}-doc += "${datadir}/mraa/examples/"
FILES:${PN}-utils = "${bindir}/"
# override this in local.conf to get needed bindings.
# BINDINGS:pn-mraa="python"
# will result in only the python bindings being built/packaged.
# Note: 'nodejs' is disabled by default because the bindings
# generation currently fails with nodejs (>v7.x).
BINDINGS ??= ""
# nodejs isn't available for armv4/armv5 architectures
BINDINGS:armv4 ??= ""
BINDINGS:armv5 ??= ""
PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \
${@bb.utils.contains('PACKAGES', 'python3-${PN}', 'python', '', d)}"
PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native python3,"
PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native,"
PACKAGECONFIG[ft4222] = "-DUSBPLAT=ON -DFTDI4222=ON, -DUSBPLAT=OFF -DFTDI4222=OFF,, libft4222"
FILES:python3-${PN} = "${PYTHON_SITEPACKAGES_DIR}/"
RDEPENDS:python3-${PN} += "python3"
FILES:node-${PN} = "${prefix}/lib/node_modules/"
RDEPENDS:node-${PN} += "nodejs"
### Include desired language bindings ###
PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}"
PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', 'python3-${PN}', '', d)}"
TOOLCHAIN = "gcc"