1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-24 19:55:26 +03:00
aports/testing/openocd-git/APKBUILD
2023-06-12 14:48:56 +00:00

95 lines
2.5 KiB
Text

# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
_pkgname=openocd
_commit=63f4e7c72a27fb828fe1be3003be6a94519e1c12
pkgname=$_pkgname-git
pkgver=0_git20230610
pkgrel=0
pkgdesc="Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing"
url="http://openocd.org/"
arch="all"
license="GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only"
makedepends="
autoconf
automake
hidapi-dev
jimtcl-dev
libftdi1-dev
libjaylink-dev
libtool
libusb-dev
"
subpackages="
$pkgname-dev
$pkgname-doc
$pkgname-udev-rules:udev_rules:noarch
$pkgname-cmd-openocd:symlink:noarch
"
# Note: Using a github mirror here as sourceforge git snapshots have changing checksums
source="
$_pkgname-$_commit.tar.gz::https://github.com/openocd-org/openocd/archive/$_commit.tar.gz
fix-jimtcl-link.patch
"
builddir="$srcdir/$_pkgname-$_commit"
prepare() {
default_prepare
./bootstrap nosubmodule
}
build() {
# --datadir:
# avoid conflicts with release version of openocd to allow parallel
# installations
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--datadir=/usr/share/$pkgname \
--localstatedir=/var \
--disable-werror \
--enable-cmsis-dap \
--enable-sysfsgpio \
--enable-bcm2835gpio \
--disable-internal-jimtcl \
--disable-internal-libjaylink
make
}
check() {
make check
}
package() {
make DESTDIR="$pkgdir" install
install -Dm644 contrib/60-openocd.rules \
"$pkgdir"/lib/udev/rules.d/60-$pkgname.rules
# allow parallel install with release openocd
mv "$pkgdir"/usr/bin/openocd "$pkgdir"/usr/bin/$pkgname
mv "$pkgdir"/usr/share/man/man1/openocd.1 \
"$pkgdir"/usr/share/man/man1/openocd-git.1
sed -e 's/openocd/openocd-git/g' -i \
"$pkgdir"/usr/share/man/man1/openocd-git.1
}
udev_rules() {
pkgdesc="udev rules for $pkgname"
depends="!openocd-udev-rules"
amove lib/udev/rules.d/60-$pkgname.rules
}
symlink() {
pkgdesc="provide the 'openocd' cmd as symlink to 'openocd-git'"
depends="$pkgname=$pkgver-r$pkgrel"
mkdir -p "$subpkgdir"/usr/bin/
ln -s openocd-git "$subpkgdir"/usr/bin/openocd
}
sha512sums="
2d3bed1e959beccc0a72421c374c31c8500f6b7e9fae7533fc1cf6cc45e5db8cd7d748c5e9fa7dc009ebef3f97cab32eb401e5b076c61b03cea2d3f091645159 openocd-63f4e7c72a27fb828fe1be3003be6a94519e1c12.tar.gz
6fd2fbe11917bb7f181ba67812f63e75d51bcd19e4df6a7e22e1abb8f36a4f4bdc9202e815f560476ec184d54d84df8ae4dceb17f2429b9dc1d9503804dacb03 fix-jimtcl-link.patch
"