diff options
author | Ming Liu <liu.ming50@gmail.com> | 2022-09-23 09:16:13 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-09-23 05:38:57 -0700 |
commit | ce62753e9ecc55ce0ae66fef08a2dbf5ade41d91 (patch) | |
tree | 29e746f23b61cf6de38c8bfcd8cb0e48b6d1afe8 /meta-oe/recipes-support | |
parent | b1a1d376bf7b5435dfb831c6bc384df29c434439 (diff) | |
download | meta-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.bb | 29 |
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" | |||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
4 | file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" | 4 | file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" |
5 | 5 | ||
6 | DEPENDS = "libconfig" | ||
7 | |||
8 | inherit autotools pkgconfig systemd update-rc.d update-alternatives | 6 | inherit autotools pkgconfig systemd update-rc.d update-alternatives |
9 | 7 | ||
10 | PV = "0.2.0+git${SRCPV}" | 8 | PV = "0.2.0+git${SRCPV}" |
@@ -19,27 +17,38 @@ SRC_URI = " \ | |||
19 | 17 | ||
20 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
21 | 19 | ||
22 | SYSTEMD_PACKAGES = "${PN}" | 20 | PACKAGECONFIG ??= "examples gadget-schemes libconfig" |
23 | SYSTEMD_SERVICE:${PN} = "usbgx.service" | 21 | PACKAGECONFIG[libconfig] = "--with-libconfig=yes,--without-libconfig,libconfig" |
22 | PACKAGECONFIG[examples] = "--enable-examples,--disable-examples" | ||
23 | PACKAGECONFIG[gadget-schemes] = "--enable-gadget-schemes,--disable-gadget-schemes" | ||
24 | PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,cmocka" | ||
25 | |||
26 | PACKAGE_BEFORE_PN = "${PN}-examples" | ||
27 | |||
28 | SYSTEMD_PACKAGES = "${PN}-examples" | ||
29 | SYSTEMD_SERVICE:${PN}-examples = "usbgx.service" | ||
30 | SYSTEMD_AUTO_ENABLE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'enable', 'disable', d)}" | ||
24 | 31 | ||
32 | INITSCRIPT_PACKAGES = "${PN}-examples" | ||
25 | INITSCRIPT_NAME = "usbgx" | 33 | INITSCRIPT_NAME = "usbgx" |
26 | INITSCRIPT_PARAMS = "defaults" | 34 | INITSCRIPT_PARAMS = "defaults" |
27 | 35 | INHIBIT_UPDATERCD_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '1', '0', d)}" | |
28 | EXTRA_OECONF = "--includedir=${includedir}/usbgx" | ||
29 | 36 | ||
30 | do_install:append() { | 37 | do_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 | ||
40 | RDEPENDS:${PN} += "libusbgx-config" | 48 | FILES:${PN}-examples = "${bindir}/* ${sysconfdir}/*" |
49 | RDEPENDS:${PN}-examples += "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'libusbgx-config', '', d)}" | ||
41 | 50 | ||
42 | ALTERNATIVE_PRIORITY = "90" | 51 | ALTERNATIVE_PRIORITY = "90" |
43 | ALTERNATIVE:${PN} = "gadget-acm-ecm show-gadgets" | 52 | ALTERNATIVE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'gadget-acm-ecm show-gadgets', '', d)}" |
44 | ALTERNATIVE_LINK_NAME[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm" | 53 | ALTERNATIVE_LINK_NAME[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm" |
45 | ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets" | 54 | ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets" |