blob: 6d42c677194d3bf3317f33b57245e82ac6442631 [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"
Brad Bishop316dfdd2018-06-25 12:45:53 -04006LIC_FILES_CHKSUM = "file://COPYING;md5=4b92a3b497d7943042a6db40c088c3f2"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05007
Brad Bishop26bdd442019-08-16 17:08:17 -04008SRCREV = "967585c9ea0e1a8818d2172d2395d8502f6180a2"
9PV = "2.0.0+git${SRCPV}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010
Brad Bishop316dfdd2018-06-25 12:45:53 -040011SRC_URI = "git://github.com/intel-iot-devkit/${BPN}.git;protocol=http \
12 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050013
14S = "${WORKDIR}/git"
15
16# CMakeLists.txt checks the architecture, only x86 and ARM supported for now
17COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
18
19inherit cmake distutils3-base
20
21DEPENDS += "json-c"
22
Andrew Geissler1548c072019-02-22 16:03:50 -060023EXTRA_OECMAKE_append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=ON \
24 -DPYTHON3_PACKAGES_PATH:PATH=${baselib}/python${PYTHON_BASEVERSION}/site-packages \
Brad Bishop2d39a062019-10-28 08:33:36 -040025 -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \
26 -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
Andrew Geissler1548c072019-02-22 16:03:50 -060027 "
Brad Bishopd7bf8c12018-02-25 22:55:05 -050028
29# Prepend mraa-utils to make sure bindir ends up in there
30PACKAGES =+ "${PN}-utils"
31
32FILES_${PN}-doc += "${datadir}/mraa/examples/"
33
34FILES_${PN}-utils = "${bindir}/"
35
36# override this in local.conf to get needed bindings.
37# BINDINGS_pn-mraa="python"
38# will result in only the python bindings being built/packaged.
Brad Bishop316dfdd2018-06-25 12:45:53 -040039# Note: 'nodejs' is disabled by default because the bindings
40# generation currently fails with nodejs (>v7.x).
41BINDINGS ??= "python"
42
43# nodejs isn't available for armv4/armv5 architectures
44BINDINGS_armv4 ??= "python"
45BINDINGS_armv5 ??= "python"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050046
47PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \
48 ${@bb.utils.contains('PACKAGES', '${PYTHON_PN}-${PN}', 'python', '', d)}"
49
50PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native ${PYTHON_PN},"
51PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native,"
52PACKAGECONFIG[ft4222] = "-DUSBPLAT=ON -DFTDI4222=ON, -DUSBPLAT=OFF -DFTDI4222=OFF,, libft4222"
53
54FILES_${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}/"
55RDEPENDS_${PYTHON_PN}-${PN} += "${PYTHON_PN}"
56
57FILES_node-${PN} = "${prefix}/lib/node_modules/"
58RDEPENDS_node-${PN} += "nodejs"
59
60### Include desired language bindings ###
61PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}"
62PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', '${PYTHON_PN}-${PN}', '', d)}"