mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-05-18 07:04:57 +00:00
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>
This commit is contained in:
parent
b1a1d376bf
commit
ce62753e9e
@ -3,8 +3,6 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c"
|
||||
|
||||
DEPENDS = "libconfig"
|
||||
|
||||
inherit autotools pkgconfig systemd update-rc.d update-alternatives
|
||||
|
||||
PV = "0.2.0+git${SRCPV}"
|
||||
@ -19,27 +17,38 @@ SRC_URI = " \
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}"
|
||||
SYSTEMD_SERVICE:${PN} = "usbgx.service"
|
||||
PACKAGECONFIG ??= "examples gadget-schemes libconfig"
|
||||
PACKAGECONFIG[libconfig] = "--with-libconfig=yes,--without-libconfig,libconfig"
|
||||
PACKAGECONFIG[examples] = "--enable-examples,--disable-examples"
|
||||
PACKAGECONFIG[gadget-schemes] = "--enable-gadget-schemes,--disable-gadget-schemes"
|
||||
PACKAGECONFIG[tests] = "--enable-tests,--disable-tests,cmocka"
|
||||
|
||||
PACKAGE_BEFORE_PN = "${PN}-examples"
|
||||
|
||||
SYSTEMD_PACKAGES = "${PN}-examples"
|
||||
SYSTEMD_SERVICE:${PN}-examples = "usbgx.service"
|
||||
SYSTEMD_AUTO_ENABLE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'enable', 'disable', d)}"
|
||||
|
||||
INITSCRIPT_PACKAGES = "${PN}-examples"
|
||||
INITSCRIPT_NAME = "usbgx"
|
||||
INITSCRIPT_PARAMS = "defaults"
|
||||
|
||||
EXTRA_OECONF = "--includedir=${includedir}/usbgx"
|
||||
INHIBIT_UPDATERCD_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '1', '0', d)}"
|
||||
|
||||
do_install:append() {
|
||||
install -Dm 0755 ${WORKDIR}/gadget-start ${D}/${bindir}/gadget-start
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||
install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service
|
||||
fi
|
||||
|
||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
|
||||
install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx
|
||||
fi
|
||||
install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx
|
||||
fi
|
||||
}
|
||||
|
||||
RDEPENDS:${PN} += "libusbgx-config"
|
||||
FILES:${PN}-examples = "${bindir}/* ${sysconfdir}/*"
|
||||
RDEPENDS:${PN}-examples += "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'libusbgx-config', '', d)}"
|
||||
|
||||
ALTERNATIVE_PRIORITY = "90"
|
||||
ALTERNATIVE:${PN} = "gadget-acm-ecm show-gadgets"
|
||||
ALTERNATIVE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'gadget-acm-ecm show-gadgets', '', d)}"
|
||||
ALTERNATIVE_LINK_NAME[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm"
|
||||
ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user