blob: dcfbabc8a86e28c34378b5954ce568c830637eed [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 Geissler4b7c1152020-11-30 19:55:29 -06008SRCREV = "7786c7ded5c9ce7773890d0e3dc27632898fc6b1"
9PV = "2.2.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
Patrick Williams213cb262021-08-07 19:21:33 -050025EXTRA_OECMAKE:append = " -DINSTALLTOOLS:BOOL=ON -DFIRMATA=ON -DCMAKE_SKIP_RPATH=ON -DPYTHON2_LIBRARY=OFF \
Andrew Geissler1548c072019-02-22 16:03:50 -060026 -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
Patrick Williams213cb262021-08-07 19:21:33 -050034FILES:${PN}-doc += "${datadir}/mraa/examples/"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050035
Patrick Williams213cb262021-08-07 19:21:33 -050036FILES:${PN}-utils = "${bindir}/"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050037
38# override this in local.conf to get needed bindings.
Patrick Williams213cb262021-08-07 19:21:33 -050039# BINDINGS:pn-mraa="python"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050040# 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
Patrick Williams213cb262021-08-07 19:21:33 -050046BINDINGS: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
Patrick Williams213cb262021-08-07 19:21:33 -050056FILES:${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}/"
57RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_PN}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050058
Patrick Williams213cb262021-08-07 19:21:33 -050059FILES:node-${PN} = "${prefix}/lib/node_modules/"
60RDEPENDS:node-${PN} += "nodejs"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050061
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"