1SUMMARY = "Linux Library for low speed I/O Communication"
2HOMEPAGE = "https://github.com/intel-iot-devkit/mraa"
3SECTION = "libs"
4
5LICENSE = "MIT"
6LIC_FILES_CHKSUM = "file://COPYING;md5=91e7de50a8d3cf01057f318d72460acd"
7
8SRCREV = "7786c7ded5c9ce7773890d0e3dc27632898fc6b1"
9PV = "2.2.0+git${SRCPV}"
10
11SRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=http \
12           file://0001-cmake-Use-a-regular-expression-to-match-x86-architec.patch \
13           file://0001-include-Declare-gVERSION-global-as-extern.patch \
14           "
15
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
25EXTRA_OECMAKE:append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=ON -DPYTHON2_LIBRARY=OFF \
26                         -DPYTHON3_PACKAGES_PATH:PATH=${baselib}/python${PYTHON_BASEVERSION}/site-packages \
27                         -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \
28                         -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \
29                       "
30
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.
41# 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"
48
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)}"
65
66TOOLCHAIN = "gcc"
67