blob: 7c2441632e7c098ba8ae6aab5fd19266bc2feaf8 [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 \
Andrew Geissler7f40b712020-05-15 14:09:53 -050013 file://0001-include-Declare-gVERSION-global-as-extern.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040014 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050015
16S = "${WORKDIR}/git"
17
18# CMakeLists.txt checks the architecture, only x86 and ARM supported for now
19COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
20
21inherit cmake distutils3-base
22
23DEPENDS += "json-c"
24
Andrew Geissler1548c072019-02-22 16:03:50 -060025EXTRA_OECMAKE_append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=ON \
26 -DPYTHON3_PACKAGES_PATH:PATH=${baselib}/python${PYTHON_BASEVERSION}/site-packages \
Brad Bishop2d39a062019-10-28 08:33:36 -040027 -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \
28 -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
Andrew Geissler1548c072019-02-22 16:03:50 -060029 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050030
31# Prepend mraa-utils to make sure bindir ends up in there
32PACKAGES =+ "${PN}-utils"
33
34FILES_${PN}-doc += "${datadir}/mraa/examples/"
35
36FILES_${PN}-utils = "${bindir}/"
37
38# override this in local.conf to get needed bindings.
39# BINDINGS_pn-mraa="python"
40# will result in only the python bindings being built/packaged.
Brad Bishop316dfdd2018-06-25 12:45:53 -040041# Note: 'nodejs' is disabled by default because the bindings
42# generation currently fails with nodejs (>v7.x).
43BINDINGS ??= "python"
44
45# nodejs isn't available for armv4/armv5 architectures
46BINDINGS_armv4 ??= "python"
47BINDINGS_armv5 ??= "python"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050048
49PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \
50 ${@bb.utils.contains('PACKAGES', '${PYTHON_PN}-${PN}', 'python', '', d)}"
51
52PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native ${PYTHON_PN},"
53PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native,"
54PACKAGECONFIG[ft4222] = "-DUSBPLAT=ON -DFTDI4222=ON, -DUSBPLAT=OFF -DFTDI4222=OFF,, libft4222"
55
56FILES_${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}/"
57RDEPENDS_${PYTHON_PN}-${PN} += "${PYTHON_PN}"
58
59FILES_node-${PN} = "${prefix}/lib/node_modules/"
60RDEPENDS_node-${PN} += "nodejs"
61
62### Include desired language bindings ###
63PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}"
64PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', '${PYTHON_PN}-${PN}', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050065
66TOOLCHAIN = "gcc"