xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-extended/upm/upm_git.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Sensor/Actuator repository for Mraa"
2*4882a593SmuzhiyunHOMEPAGE = "https://github.com/intel-iot-devkit/upm"
3*4882a593SmuzhiyunSECTION = "libs"
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunLICENSE = "MIT"
6*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=66493d54e65bfc12c7983ff2e884f37f"
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunDEPENDS = "libjpeg-turbo mraa"
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunSRCREV = "5cf20df96c6b35c19d5b871ba4e319e96b4df72d"
11*4882a593SmuzhiyunPV = "2.0.0+git${SRCPV}"
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunSRC_URI = "git://github.com/eclipse/${BPN}.git;protocol=http;branch=master;protocol=https \
14*4882a593Smuzhiyun           file://0001-CMakeLists.txt-Use-SWIG_SUPPORT_FILES-to-find-the-li.patch \
15*4882a593Smuzhiyun           file://0001-Use-stdint-types.patch \
16*4882a593Smuzhiyun           file://0001-initialize-local-variables-before-use.patch \
17*4882a593Smuzhiyun           file://0001-cmake-Disable-Wno-misleading-indentation-with-clang-.patch \
18*4882a593Smuzhiyun           file://0001-cmake-Disable-using-Wno-maybe-uninitialized.patch \
19*4882a593Smuzhiyun           "
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunSRC_URI:append:toolchain-clang:x86 = " file://0001-nmea_gps-Link-with-latomic.patch "
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunS = "${WORKDIR}/git"
24*4882a593Smuzhiyun
25*4882a593Smuzhiyun# Depends on mraa which only supports x86 and ARM for now
26*4882a593SmuzhiyunCOMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
27*4882a593Smuzhiyun
28*4882a593Smuzhiyuninherit setuptools3-base cmake pkgconfig
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunEXTRA_OECMAKE += "-UPYTHON_EXECUTABLE -DWERROR=off"
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun# override this in local.conf to get needed bindings.
33*4882a593Smuzhiyun# BINDINGS:pn-upm="python"
34*4882a593Smuzhiyun# will result in only the python bindings being built/packaged.
35*4882a593Smuzhiyun# Note: 'nodejs' is disabled by default because the bindings
36*4882a593Smuzhiyun# generation currently fails with nodejs (>v7.x).
37*4882a593SmuzhiyunBINDINGS ??= "python"
38*4882a593Smuzhiyun
39*4882a593Smuzhiyun# nodejs isn't available for armv4/armv5 architectures
40*4882a593SmuzhiyunBINDINGS:armv4 ??= "python"
41*4882a593SmuzhiyunBINDINGS:armv5 ??= "python"
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunPACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \
44*4882a593Smuzhiyun ${@bb.utils.contains('PACKAGES', '${PYTHON_PN}-${PN}', 'python', '', d)}"
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunPACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}, -DBUILDSWIGPYTHON=OFF, swig-native ${PYTHON_PN},"
47*4882a593SmuzhiyunPACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native,"
48*4882a593Smuzhiyun
49*4882a593Smuzhiyundo_configure:prepend() {
50*4882a593Smuzhiyun    sed -i s:\"lib/${_packages_path}:\"${baselib}/${_packages_path}:g ${S}/cmake/modules/OpenCVDetectPython.cmake
51*4882a593Smuzhiyun}
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunFILES:${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}"
54*4882a593SmuzhiyunRDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_PN}"
55*4882a593Smuzhiyun
56*4882a593SmuzhiyunFILES:node-${PN} = "${prefix}/lib/node_modules/"
57*4882a593SmuzhiyunRDEPENDS:node-${PN} += "nodejs"
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun### Include desired language bindings ###
60*4882a593SmuzhiyunPACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}"
61*4882a593SmuzhiyunPACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', '${PYTHON_PN}-${PN}', '', d)}"
62