summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c006651d36a7474b730287f9e1d81435f429674c (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
# Maintainer: japm48 <japm48gh@gmail.com>

pkgname=icotools-icoprog-usb

pkgver=r145.9c6185b
pkgrel=1
arch=('x86_64')

pkgdesc="Programmer and Debug Tool for the IcoBoard (USB Base Board variant)"
url="https://github.com/cliffordwolf/icotools"
license=('ISC')

makedepends=(git)
depends=(libftdi-compat)

_repo=cliffordwolf/icotools
source=("git+https://github.com/${_repo}.git")
sha512sums=('SKIP')

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


build() {
  cd "$srcdir/icotools"
  cd icoprog
  
  sed -i 's|/usr/local/|$(DESTDIR)/usr/|' Makefile
  sed -i 's|sudo ||' Makefile
  make USBMODE=1 icoprog
}

package() {
  cd "$srcdir/icotools"
  cd icoprog
  
  mkdir -p "${pkgdir}/usr/bin"
  make USBMODE=1 DESTDIR="$pkgdir" install
  
  # Get license
  head icoprog.cc -n17 | cut -d\* -f2 | awk '{$1=$1};1' >"LICENSE"
  install -Dm644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}