Skip to content

Instantly share code, notes, and snippets.

@Mikael-Lovqvist
Created February 10, 2022 03:05
Show Gist options
  • Save Mikael-Lovqvist/bc3f91cb2ed8c47bd34deec7ef72e6e8 to your computer and use it in GitHub Desktop.
Save Mikael-Lovqvist/bc3f91cb2ed8c47bd34deec7ef72e6e8 to your computer and use it in GitHub Desktop.
openocd patch for building from upstream git repos
diff --unified --recursive --text openocd-git/.gitmodules openocd-git.new/.gitmodules
--- openocd-git/.gitmodules 2022-02-10 03:54:21.695465811 +0100
+++ openocd-git.new/.gitmodules 2022-02-10 03:55:42.416088291 +0100
@@ -1,9 +1,9 @@
[submodule "tools/git2cl"]
path = tools/git2cl
- url = https://repo.or.cz/git2cl.git
+ url = https://git.savannah.gnu.org/git/git2cl.git
[submodule "jimtcl"]
path = jimtcl
url = https://github.com/msteveb/jimtcl.git
[submodule "src/jtag/drivers/libjaylink"]
path = src/jtag/drivers/libjaylink
- url = https://repo.or.cz/libjaylink.git
+ url = https://gitlab.zapb.de/libjaylink/libjaylink.git
# Maintainer: Filipe Laíns (FFY00) <[email protected]>
# Contributor: Sergej Pupykin <[email protected]>
# Contributor: Bartłomiej Piotrowski <[email protected]>
# Contributor: Matthias Bauch <[email protected]>
# Contributor: Laszlo Papp <djszapi2 at gmail com>
# Contributor: Samuel Tardieu <[email protected]>
_features=(amtjtagaccel armjtagew buspirate ftdi gw16012 jlink oocd_trace opendous osbdm
parport presto_libftdi remote-bitbang rlink stlink ti-icdi ulink usbprog vsllink
aice cmsis-dap dummy jtag_vpi openjtag_ftdi usb-blaster-2 usb_blaster_libftdi)
pkgname=openocd-git
pkgver=0.11.1
pkgrel=1
epoch=1
pkgdesc='Debugging, in-system programming and boundary-scan testing for embedded target devices'
arch=('x86_64')
url='http://openocd.org'
license=('GPL')
depends=('libftdi-compat' 'libusb-compat' 'hidapi' 'libudev.so')
source=("${pkgname}::git+git://git.code.sf.net/p/openocd/code"
"gitmodules.patch"
)
sha512sums=('SKIP'
'eb6911f265641227a77296453abae49a5fd8b64a6b6cd4b8c1adcbb0eb8effeff11e1e25efaf06b673a5b1251d46fe016e979c0efc8e72619510d191336dda31'
)
prepare() {
cd $pkgname
patch --forward --strip=1 --input="${srcdir}/gitmodules.patch"
sed -i 's|GROUP="plugdev", ||g' contrib/60-openocd.rules
}
build() {
cd $pkgname
#libtoolize -vif
#autoreconf -vif
./bootstrap
./configure \
--prefix=/usr \
--disable-werror \
${_features[@]/#/--enable-}
make
}
package() {
cd $pkgname
make DESTDIR="$pkgdir" install
install -Dm 644 contrib/60-openocd.rules "$pkgdir"/usr/lib/udev/rules.d/60-openocd.rules
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment