summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2022-09-23 09:16:13 +0200
committerKhem Raj <raj.khem@gmail.com>2022-09-23 05:38:57 -0700
commitce62753e9ecc55ce0ae66fef08a2dbf5ade41d91 (patch)
tree29e746f23b61cf6de38c8bfcd8cb0e48b6d1afe8 /meta-oe/recipes-support
parentb1a1d376bf7b5435dfb831c6bc384df29c434439 (diff)
downloadmeta-openembedded-ce62753e9ecc55ce0ae66fef08a2dbf5ade41d91.tar.gz
libusbgx: add PACKAGECONFIG to make build predicable
Also introduce a ${PN}-examples subpackage since all binaries get built only when --enable-examples is set to true, move them into ${PN}-examples package. Another advantage of this change is that now libusbgx only contains a .so library so the recipes DEPENDs on it wont involve in unnecessary binaries or systemd/sysvinit scripts. Also uprev to the latest git hash in master and fix some inconsistent coding style and an invalid EXTRA_OECONF. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support')
-rw-r--r--meta-oe/recipes-support/libusbgx/libusbgx_git.bb29
1 files changed, 19 insertions, 10 deletions
diff --git a/meta-oe/recipes-support/libusbgx/libusbgx_git.bb b/meta-oe/recipes-support/libusbgx/libusbgx_git.bb
index 023f7bfa6..16552fd3b 100644
--- a/meta-oe/recipes-support/libusbgx/libusbgx_git.bb
+++ b/meta-oe/recipes-support/libusbgx/libusbgx_git.bb
@@ -3,8 +3,6 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ 3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
4 file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" 4 file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c"
5 5
6DEPENDS = "libconfig"
7
8inherit autotools pkgconfig systemd update-rc.d update-alternatives 6inherit autotools pkgconfig systemd update-rc.d update-alternatives
9 7
10PV = "0.2.0+git${SRCPV}" 8PV = "0.2.0+git${SRCPV}"
@@ -19,27 +17,38 @@ SRC_URI = " \
19 17
20S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
21 19
22SYSTEMD_PACKAGES = "${PN}" 20PACKAGECONFIG ??= "examples gadget-schemes libconfig"
23SYSTEMD_SERVICE:${PN} = "usbgx.service" 21PACKAGECONFIG[libconfig] = "--with-libconfig=yes,--without-libconfig,libconfig"
22PACKAGECONFIG[examples] = "--enable-examples,--disable-examples"
23PACKAGECONFIG[gadget-schemes] = "--enable-gadget-schemes,--disable-gadget-schemes"
24PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,cmocka"
25
26PACKAGE_BEFORE_PN = "${PN}-examples"
27
28SYSTEMD_PACKAGES = "${PN}-examples"
29SYSTEMD_SERVICE:${PN}-examples = "usbgx.service"
30SYSTEMD_AUTO_ENABLE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'enable', 'disable', d)}"
24 31
32INITSCRIPT_PACKAGES = "${PN}-examples"
25INITSCRIPT_NAME = "usbgx" 33INITSCRIPT_NAME = "usbgx"
26INITSCRIPT_PARAMS = "defaults" 34INITSCRIPT_PARAMS = "defaults"
27 35INHIBIT_UPDATERCD_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '1', '0', d)}"
28EXTRA_OECONF = "--includedir=${includedir}/usbgx"
29 36
30do_install:append() { 37do_install:append() {
31 install -Dm 0755 ${WORKDIR}/gadget-start ${D}/${bindir}/gadget-start 38 install -Dm 0755 ${WORKDIR}/gadget-start ${D}/${bindir}/gadget-start
32 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 39 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
33 install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service 40 install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service
34 fi 41 fi
42
35 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then 43 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
36 install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx 44 install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx
37 fi 45 fi
38} 46}
39 47
40RDEPENDS:${PN} += "libusbgx-config" 48FILES:${PN}-examples = "${bindir}/* ${sysconfdir}/*"
49RDEPENDS:${PN}-examples += "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'libusbgx-config', '', d)}"
41 50
42ALTERNATIVE_PRIORITY = "90" 51ALTERNATIVE_PRIORITY = "90"
43ALTERNATIVE:${PN} = "gadget-acm-ecm show-gadgets" 52ALTERNATIVE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'gadget-acm-ecm show-gadgets', '', d)}"
44ALTERNATIVE_LINK_NAME[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm" 53ALTERNATIVE_LINK_NAME[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm"
45ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets" 54ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets"