summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 82c6ec7891fb51e98a09cbe214e22e3b09e58012 (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
48
49
50
# Maintainer: Uffe Jakobsen <_uffe_|_at_|_uffe_|_dot_|_org_>
pkgname=stlink-tool-git
_pkgname=stlink-tool
pkgver=r57.dff59ad
pkgrel=1
pkgdesc="Tool for flashing chinese clone (STM32) ST-Link dongles"
arch=('i686' 'x86_64')
license=('GPL')
url="https://github.com/blackmagic-debug/stlink-tool"
source=('git+https://github.com/blackmagic-debug/stlink-tool.git')
#url="https://github.com/UweBonnes/stlink-tool"
#source=('git+https://github.com/UweBonnes/stlink-tool.git')
depends=('libusb')
makedepends=('git')
provides=('stlink-tool')
sha256sums=('SKIP')

pkgver()
{
  cd "${_pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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

build()
{
  cd "${srcdir}/${_pkgname}"
  make
}

package()
{
  cd "${srcdir}/${_pkgname}/"

  install -D -m755 stlink-tool "${pkgdir}/usr/bin/stlink-tool"

  # udev rules: trigger cheap (China) STLink v2 clones to leave bootloader upon insertion and start flashed BlackMagic firmware/app
  install -D -m644 "${startdir}/stlink-tool.rules" "${pkgdir}/usr/share/${_pkgname}/etc/udev/rules.d/stlink-tool.rules"
  ln -s stlink-tool.rules "${pkgdir}/usr/share/${_pkgname}/etc/udev/rules.d/98-stlink-tool.rules"
}

#
# EOF
#