mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-08 03:49: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:
@@ -3,8 +3,6 @@ LICENSE = "GPL-2.0-only & LGPL-2.1-only"
|
|||||||
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||||
file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c"
|
file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c"
|
||||||
|
|
||||||
DEPENDS = "libconfig"
|
|
||||||
|
|
||||||
inherit autotools pkgconfig systemd update-rc.d update-alternatives
|
inherit autotools pkgconfig systemd update-rc.d update-alternatives
|
||||||
|
|
||||||
PV = "0.2.0+git${SRCPV}"
|
PV = "0.2.0+git${SRCPV}"
|
||||||
@@ -19,27 +17,38 @@ SRC_URI = " \
|
|||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
SYSTEMD_PACKAGES = "${PN}"
|
PACKAGECONFIG ??= "examples gadget-schemes libconfig"
|
||||||
SYSTEMD_SERVICE:${PN} = "usbgx.service"
|
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_NAME = "usbgx"
|
||||||
INITSCRIPT_PARAMS = "defaults"
|
INITSCRIPT_PARAMS = "defaults"
|
||||||
|
INHIBIT_UPDATERCD_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '1', '0', d)}"
|
||||||
EXTRA_OECONF = "--includedir=${includedir}/usbgx"
|
|
||||||
|
|
||||||
do_install:append() {
|
do_install:append() {
|
||||||
install -Dm 0755 ${WORKDIR}/gadget-start ${D}/${bindir}/gadget-start
|
install -Dm 0755 ${WORKDIR}/gadget-start ${D}/${bindir}/gadget-start
|
||||||
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
|
||||||
install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service
|
install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
|
if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
|
||||||
install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx
|
install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx
|
||||||
fi
|
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_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[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm"
|
||||||
ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets"
|
ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets"
|
||||||
|
|||||||
Reference in New Issue
Block a user