summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a80220cbc592329a2c6a87e3b82caec559b99256 (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
# Maintainer: xiretza <xiretza+aur@xiretza.xyz>

_pkgname=f4pga
pkgname="$_pkgname-git"
pkgver=r765.42fc3f8
pkgrel=2
pkgdesc="F4PGA tools"
arch=(any)
url="https://github.com/chipsalliance/$_pkgname"
license=('Apache')
depends=('python' 'python-colorama')
makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest')
provides=("$_pkgname=$pkgver")
conflicts=("$_pkgname" "symbiflow-arch-defs-toolchain")
source=(
	"git+$url.git"
)
sha256sums=('SKIP')

pkgver() {
	cd "$_pkgname"

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

prepare() {
	cd "$_pkgname"

	find f4pga/wrappers/sh -type f | xargs sed -i -e 's#\$F4PGA_ENV_SHARE#/usr/share/symbiflow#g'
}

build() {
	cd "$_pkgname/f4pga"

	python -m build --wheel --no-isolation
}

check() {
	cd "$_pkgname"

	pytest
}

package() {
	cd "$_pkgname/f4pga"

	python -m installer --destdir="$pkgdir" dist/*.whl

	cd "$srcdir/$_pkgname"

	install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}