summaryrefslogtreecommitdiff
path: root/pcr/icestorm-git/PKGBUILD
blob: 8c86279a3385edead9afc97ec72cc3c84566c5d8 (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
56
57
58
# Maintainer (AUR): Sebastian Bøe <sebastianbooe@gmail.com>
# parabola changes and rationale:
# - Added armv7h and i686 architectures support
# - Modified to use a fixed git revision
# TODO: Bugreport about the broken build with
#       c1d7ef8b529953bb38f575930eca662d714385abx
pkgname=icestorm-git
pkgver=r546.4cdf41c
# c1d7ef8b529953bb38f575930eca662d714385ab broke the build with the following
# error, so we use the commit right before it:
# icetime.cc: In function ‘std::string ecnetname_to_vlog(std::string)’:
# icetime.cc:1313:15: error: ‘invalid_argument’ in namespace ‘std’ does not name a type
#  1313 |  } catch(std::invalid_argument &e) { // Not numeric and stoi throws exception
#       |               ^~~~~~~~~~~~~~~~
_commit=4cdf41c8408c092e69b819bdbad5a39c1e43943b
pkgrel=1
pkgdesc="Lattice iCE40 FPGAs Bitstream Documentation (Reverse Engineered)"
arch=('armv7h' 'i686' 'x86_64')
url="http://www.clifford.at/icestorm/"
license=('custom:ISC')
depends=('python' 'libftdi-compat')
makedepends=('git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://github.com/cliffordwolf/icestorm.git#commit=${_commit}")
md5sums=('SKIP')
_prefix="/usr"

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

build() {
	cd "$srcdir/${pkgname%-git}"

    # Icestorm defaults to clang. We prefer to use gcc because it is
    # more widespread on Arch (gcc is in base-devel).
    CXX=gcc

    make \
        CXX=$CXX \
        PREFIX=$_prefix
}

package() {
	cd "$srcdir/${pkgname%-git}"

	# Move the license file into place
	install -dm 755        "$pkgdir/usr/share/licenses/$pkgname"
	install -m  644 README "$pkgdir/usr/share/licenses/$pkgname"

	# Install the package
	make \
      DESTDIR="$pkgdir" \
      PREFIX=$_prefix \
      install
}