diff options
author | Yixun Lan <dlan@gentoo.org> | 2024-02-17 02:09:57 +0000 |
---|---|---|
committer | Yixun Lan <dlan@gentoo.org> | 2024-02-17 02:12:12 +0000 |
commit | 9ec1edb1acb503243d4f3ea1474298b0b39f7d51 (patch) | |
tree | e96d448e0da1091b9cb8338bdf9eb9cc73edd41b /dev-embedded/openocd | |
parent | sys-devel/gcc: add 12.3.1_p20240216 (diff) | |
download | gentoo-9ec1edb1acb503243d4f3ea1474298b0b39f7d51.tar.gz gentoo-9ec1edb1acb503243d4f3ea1474298b0b39f7d51.tar.bz2 gentoo-9ec1edb1acb503243d4f3ea1474298b0b39f7d51.zip |
dev-embedded/openocd: make libgpiod optional
Closes: https://bugs.gentoo.org/917547
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'dev-embedded/openocd')
-rw-r--r-- | dev-embedded/openocd/metadata.xml | 1 | ||||
-rw-r--r-- | dev-embedded/openocd/openocd-0.12.0-r2.ebuild | 111 | ||||
-rw-r--r-- | dev-embedded/openocd/openocd-9999.ebuild | 7 |
3 files changed, 116 insertions, 3 deletions
diff --git a/dev-embedded/openocd/metadata.xml b/dev-embedded/openocd/metadata.xml index b9dbe67059b7..358a9c0a93c5 100644 --- a/dev-embedded/openocd/metadata.xml +++ b/dev-embedded/openocd/metadata.xml @@ -17,6 +17,7 @@ <flag name="capstone">Use <pkg>dev-libs/capstone</pkg> for disassembly support</flag> <flag name="cmsis-dap">Support for CMSIS-DAP compliant adapters</flag> <flag name="dummy">Build the dummy port driver</flag> + <flag name="gpiod">Enable Linux GPIO bitbang support via libgpiod</flag> <flag name="jlink"> Build the SEGGER J-Link driver</flag> <flag name="ftdi">Enable support for USB FTDI chips via <pkg>dev-embedded/libftdi</pkg></flag> <flag name="parport">Enable support for parport JTAG devices</flag> diff --git a/dev-embedded/openocd/openocd-0.12.0-r2.ebuild b/dev-embedded/openocd/openocd-0.12.0-r2.ebuild new file mode 100644 index 000000000000..698978b49848 --- /dev/null +++ b/dev-embedded/openocd/openocd-0.12.0-r2.ebuild @@ -0,0 +1,111 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools udev + +if [[ ${PV} == *9999 ]] ; then + inherit git-r3 + EGIT_REPO_URI=" https://repo.or.cz/openocd.git" +else + MY_PV="${PV/_/-}" + MY_P="${PN}-${MY_PV}" + S="${WORKDIR}"/${MY_P} + KEYWORDS="~amd64 ~arm ~x86" + SRC_URI="mirror://sourceforge/project/${PN}/${PN}/${MY_PV}/${MY_P}.tar.gz" +fi + +DESCRIPTION="OpenOCD - Open On-Chip Debugger" +HOMEPAGE="https://openocd.sourceforge.io" + +LICENSE="GPL-2+" +SLOT="0" +IUSE="capstone +cmsis-dap dummy +ftdi gpiod +jlink parport +usb verbose-io" +RESTRICT="strip" # includes non-native binaries + +RDEPEND=" + acct-group/plugdev + >=dev-lang/jimtcl-0.81:= + gpiod? ( dev-libs/libgpiod:0/2 ) + capstone? ( dev-libs/capstone ) + cmsis-dap? ( dev-libs/hidapi ) + jlink? ( >=dev-embedded/libjaylink-0.2.0 ) + usb? ( virtual/libusb:1 ) + ftdi? ( dev-embedded/libftdi:= )" + +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}/${PN}-0.12.0-capstone-includedir.patch" +) + +src_prepare() { + default + + AT_NO_RECURSIVE=yes eautoreconf +} + +src_configure() { + local myconf=( + --enable-amtjtagaccel + --enable-am335xgpio + --enable-arm-jtag-ew + --enable-at91rm9200 + --enable-bcm2835gpio + --enable-buspirate + --enable-ep93xx + --enable-gw16012 + --enable-jtag_dpi + --enable-sysfsgpio + --enable-vdebug + --disable-internal-jimtcl + --disable-internal-libjaylink + --disable-parport-giveio + --disable-werror + $(use_with capstone) + $(use_enable cmsis-dap) + $(use_enable dummy) + $(use_enable ftdi openjtag) + $(use_enable ftdi presto) + $(use_enable ftdi usb-blaster) + $(use_enable gpiod linuxgpiod) + $(use_enable jlink) + $(use_enable parport) + $(use_enable parport parport_ppdev) + $(use_enable usb aice) + $(use_enable usb armjtagew) + $(use_enable usb ftdi) + $(use_enable usb osbdm) + $(use_enable usb opendous) + $(use_enable usb rlink) + $(use_enable usb stlink) + $(use_enable usb ti-icdi) + $(use_enable usb usbprog) + $(use_enable usb usb-blaster-2) + $(use_enable usb ulink) + $(use_enable usb vsllink) + $(use_enable verbose-io verbose-jtag-io) + $(use_enable verbose-io verbose-usb-io) + $(use_enable verbose-io verbose_usb_comms) + ) + + econf "${myconf[@]}" +} + +src_install() { + default + dostrip /usr/bin + udev_dorules "${ED}"/usr/share/${PN}/contrib/*.rules +} + +pkg_postinst() { + udev_reload + + elog "To access openocd devices as user you must be in the plugdev group" +} + +pkg_postrm() { + udev_reload +} diff --git a/dev-embedded/openocd/openocd-9999.ebuild b/dev-embedded/openocd/openocd-9999.ebuild index 669feebd09f8..bf5127f94e2c 100644 --- a/dev-embedded/openocd/openocd-9999.ebuild +++ b/dev-embedded/openocd/openocd-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -21,13 +21,13 @@ HOMEPAGE="https://openocd.sourceforge.io" LICENSE="GPL-2+" SLOT="0" -IUSE="capstone +cmsis-dap dummy +ftdi +jlink parport +usb verbose-io" +IUSE="capstone +cmsis-dap dummy +ftdi gpiod +jlink parport +usb verbose-io" RESTRICT="strip" # includes non-native binaries RDEPEND=" acct-group/plugdev >=dev-lang/jimtcl-0.81:= - dev-libs/libgpiod:0/2 + gpiod? ( dev-libs/libgpiod:0/2 ) capstone? ( dev-libs/capstone ) cmsis-dap? ( dev-libs/hidapi ) jlink? ( >=dev-embedded/libjaylink-0.2.0 ) @@ -66,6 +66,7 @@ src_configure() { $(use_enable ftdi openjtag) $(use_enable ftdi presto) $(use_enable ftdi usb-blaster) + $(use_enable gpiod linuxgpiod) $(use_enable jlink) $(use_enable parport) $(use_enable parport parport_ppdev) |