summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d84a3431bcd6c31586c90d8363cc23f4290f6d52 (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
51
52
53
54
55
# Maintainer: japm48 <japm48gh@gmail.com>

_pkgname=open-fpga-loader
pkgname=$_pkgname-git

provides=($_pkgname openfpgaloader)
conflicts=($_pkgname openfpgaloader openfpgaloader-git)

pkgver=r585.3ea05cc
pkgrel=1
arch=('x86_64')

pkgdesc="Universal utility for programming FPGA"
url="https://github.com/trabucayre/openFPGALoader"
license=('custom')

makedepends=(git cmake)
depends=(libftdi)

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

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


build() {
  cd "$srcdir/$_src_pkgname"
  mkdir -p build
  cd build

  # Workaround!
  # This should have been included via /usr/lib/pkgconfig/libftdi1.pc
  FIX_CXXFLAGS="-isystem /usr/include/libftdi1"

  CXXFLAGS="$CXXFLAGS $FIX_CXXFLAGS" \
  cmake -DCMAKE_INSTALL_PREFIX=/usr ..

  cmake --build .
}

package() {
  cd "$srcdir/$_src_pkgname"
  cd build
  
  make DESTDIR="${pkgdir}" install
  install -Dm644 "../LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}