Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "USB Gadget neXt Configfs Library" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 2 | LICENSE = "GPL-2.0-only & LGPL-2.1-only" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 3 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 4 | file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c" |
| 5 | |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 6 | inherit autotools pkgconfig systemd update-rc.d update-alternatives |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 7 | |
| 8 | PV = "0.2.0+git${SRCPV}" |
| 9 | SRCREV = "45c14ef4d5d7ced0fbf984208de44ced6d5ed898" |
| 10 | SRCBRANCH = "master" |
| 11 | SRC_URI = " \ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 12 | git://github.com/libusbgx/libusbgx.git;branch=${SRCBRANCH};protocol=https \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 13 | file://gadget-start \ |
| 14 | file://usbgx.initd \ |
| 15 | file://usbgx.service \ |
| 16 | " |
| 17 | |
| 18 | S = "${WORKDIR}/git" |
| 19 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 20 | PACKAGECONFIG ??= "examples gadget-schemes libconfig" |
| 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" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 25 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 26 | PACKAGE_BEFORE_PN = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '${PN}-examples', '', d)}" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 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)}" |
| 31 | |
Patrick Williams | 975a06f | 2022-10-21 14:42:47 -0500 | [diff] [blame] | 32 | INITSCRIPT_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '${PN}-examples', '', d)}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 33 | INITSCRIPT_NAME = "usbgx" |
| 34 | INITSCRIPT_PARAMS = "defaults" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 35 | INHIBIT_UPDATERCD_BBCLASS = "${@bb.utils.contains('PACKAGECONFIG', 'examples', '1', '0', d)}" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 36 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 37 | do_install:append() { |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | install -Dm 0755 ${WORKDIR}/gadget-start ${D}/${bindir}/gadget-start |
| 39 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 40 | install -Dm 0644 ${WORKDIR}/usbgx.service ${D}${systemd_system_unitdir}/usbgx.service |
| 41 | fi |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 42 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 43 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 44 | install -Dm 0755 ${WORKDIR}/usbgx.initd ${D}${sysconfdir}/init.d/usbgx |
| 45 | fi |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 46 | } |
| 47 | |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 48 | FILES:${PN}-examples = "${bindir}/* ${sysconfdir}/*" |
| 49 | RDEPENDS:${PN}-examples += "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'libusbgx-config', '', d)}" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 50 | |
| 51 | ALTERNATIVE_PRIORITY = "90" |
Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame] | 52 | ALTERNATIVE:${PN}-examples = "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'gadget-acm-ecm show-gadgets', '', d)}" |
Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame] | 53 | ALTERNATIVE_LINK_NAME[gadget-acm-ecm] = "${bindir}/gadget-acm-ecm" |
| 54 | ALTERNATIVE_LINK_NAME[show-gadgets] = "${bindir}/show-gadgets" |