blob: 403d641ee9834a5c13a2672d414eeb3ebf169e35 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "Linux Library for low speed I/O Communication"
2HOMEPAGE = "https://github.com/intel-iot-devkit/mraa"
3SECTION = "libs"
4
5LICENSE = "MIT"
Andrew Geissler82c905d2020-04-13 13:39:40 -05006LIC_FILES_CHKSUM = "file://COPYING;md5=91e7de50a8d3cf01057f318d72460acd"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007
Andrew Geissler82c905d2020-04-13 13:39:40 -05008SRCREV = "e15ce6fbc76148ba8835adc92196b0d0a3f245e7"
9PV = "2.1.0+git${SRCPV}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010
Andrew Geissler82c905d2020-04-13 13:39:40 -050011SRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=http \
12 file://0001-cmake-Use-a-regular-expression-to-match-x86-architec.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040013 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050014
15S = "${WORKDIR}/git"
16
17# CMakeLists.txt checks the architecture, only x86 and ARM supported for now
18COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
19
20inherit cmake distutils3-base
21
22DEPENDS += "json-c"
23
Andrew Geissler1548c072019-02-22 16:03:50 -060024EXTRA_OECMAKE_append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=ON \
25 -DPYTHON3_PACKAGES_PATH:PATH=${baselib}/python${PYTHON_BASEVERSION}/site-packages \
Brad Bishop2d39a062019-10-28 08:33:36 -040026 -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \
27 -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
Andrew Geissler1548c072019-02-22 16:03:50 -060028 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050029
Andrew Geissler82c905d2020-04-13 13:39:40 -050030CFLAGS += "-fcommon"
31
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032# Prepend mraa-utils to make sure bindir ends up in there
33PACKAGES =+ "${PN}-utils"
34
35FILES_${PN}-doc += "${datadir}/mraa/examples/"
36
37FILES_${PN}-utils = "${bindir}/"
38
39# override this in local.conf to get needed bindings.
40# BINDINGS_pn-mraa="python"
41# will result in only the python bindings being built/packaged.
Brad Bishop316dfdd2018-06-25 12:45:53 -040042# Note: 'nodejs' is disabled by default because the bindings
43# generation currently fails with nodejs (>v7.x).
44BINDINGS ??= "python"
45
46# nodejs isn't available for armv4/armv5 architectures
47BINDINGS_armv4 ??= "python"
48BINDINGS_armv5 ??= "python"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050049
50PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \
51 ${@bb.utils.contains('PACKAGES', '${PYTHON_PN}-${PN}', 'python', '', d)}"
52
53PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native ${PYTHON_PN},"
54PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native,"
55PACKAGECONFIG[ft4222] = "-DUSBPLAT=ON -DFTDI4222=ON, -DUSBPLAT=OFF -DFTDI4222=OFF,, libft4222"
56
57FILES_${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}/"
58RDEPENDS_${PYTHON_PN}-${PN} += "${PYTHON_PN}"
59
60FILES_node-${PN} = "${prefix}/lib/node_modules/"
61RDEPENDS_node-${PN} += "nodejs"
62
63### Include desired language bindings ###
64PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}"
65PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', '${PYTHON_PN}-${PN}', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050066
67TOOLCHAIN = "gcc"