summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 53b6460424b1abedd84dca2a8dd1cdbc6fb8514b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Maintainer: flashs <mafol002 at stud dot fh-dortmund dot de>
pkgname=openocd-zephyr-git
pkgver=0.10.0.1393
pkgrel=1
pkgdesc='Fork of OpenOCD with support for Zephyr RTOS'
arch=('i686' 'x86_64' 'arm')
url='https://github.com/zephyrproject-rtos/openocd'
license=('GPL')
depends=('libftdi' 'libftdi-compat' 'libusb' 'libusb-compat' 'hidapi' )
makedepends=('git' 'automake>=1.11' 'autoconf' 'libtool' 'tcl')
source=("$pkgname::git+https://github.com/zephyrproject-rtos/openocd.git")
sha1sums=('SKIP')

pkgver() {
  cd "$srcdir/$pkgname"
  local ver="$(git describe --tags)"
  ver="${ver%-*}"
  ver="${ver#v}"
  echo "${ver/-/.}"
}

prepare() {
  cd "$srcdir/$pkgname"
  git submodule init
  git submodule update
}

build() {
  cd "$srcdir/$pkgname"

  ./bootstrap
  ./configure \
    --prefix=/usr \
    --program-suffix="-zephyr" \
    --disable-werror \
    --with-gnu-ld

  make pkgdatadir="/usr/share/$pkgname"
}

package() {
  cd "$srcdir/$pkgname"

  make pkgdatadir="/usr/share/$pkgname" DESTDIR="$pkgdir" install

  rm -r "$pkgdir/usr/share/info"
}