summarylogtreecommitdiffstats
path: root/PKGBUILD.in
blob: f95cabbb0dadfe0d6f121d94d5c76820204ace09 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Maintainer: Aki-nyan <aur@catgirl.link>

pkgname=nextpnr-all-nightly
pkgver=@EDA_VER@
pkgrel=1
epoch=1
pkgdesc="nextpnr portable FPGA place and route tool - ice40, ecp5, machxo2, nexus, and generic"
arch=("x86_64")
url="https://github.com/YosysHQ/nextpnr"
license=("custom:ISC")
groups=()
options=("!strip")
depends=(
	"yosys-nightly"
	"prjtrellis-nightly"
	"icestorm-nightly"
	"prjoxide-nightly"
	"python"
	"boost-libs"
	"qt5-base"
)
optdepends=()
makedepends=("git" "gcc" "cmake" "ninja" "pkgconf" "gawk" "eigen" "boost")
conflicts=(
	"nextpnr-git"
	"nextpnr-ice40-nightly"
	"nextpnr-ecp5-nightly"
	"nextpnr-machxo2-nightly"
	"nextpnr-nexus-nightly"
	"nextpnr-generic-nightly"
)
replaces=()
provides=(
	"nextpnr-ecp5=$(cut -d _ -f 3 <<< "${pkgver}")"
	"nextpnr-generic=$(cut -d _ -f 3 <<< "${pkgver}")"
	"nextpnr-ice40=$(cut -d _ -f 3 <<< "${pkgver}")"
	"nextpnr-machxo2=$(cut -d _ -f 3 <<< "${pkgver}")"
	"nextpnr-nexus=$(cut -d _ -f 3 <<< "${pkgver}")"
)
source=(
	"nextpnr::git+https://github.com/YosysHQ/nextpnr.git#commit=@EDA_HASH@"
)
sha256sums=(
	"SKIP"
)

_PREFIX="/usr"
prepare() {
	cd "${srcdir}/nextpnr"
	[ ! -d "${srcdir}/nextpnr/build-ice40" ] && mkdir build-ice40
	[ ! -d "${srcdir}/nextpnr/build-ecp5" ] && mkdir build-ecp5
	[ ! -d "${srcdir}/nextpnr/build-machxo2" ] && mkdir build-machxo2
	[ ! -d "${srcdir}/nextpnr/build-nexus" ] && mkdir build-nexus
	[ ! -d "${srcdir}/nextpnr/build-generic" ] && mkdir build-generic
}

build() {
	cd "${srcdir}/nextpnr/build-ice40"
	cmake -G Ninja        \
		-DARCH=ice40      \
		-DBUILD_PYTHON=ON \
		-DBUILD_GUI=ON    \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=${_PREFIX} \
		-DUSE_OPENMP=ON	\
		..
	ninja

	cd "${srcdir}/nextpnr/build-ecp5"
	cmake -G Ninja        \
		-DARCH=ecp5       \
		-DBUILD_PYTHON=ON \
		-DBUILD_GUI=ON    \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=${_PREFIX} \
		-DUSE_OPENMP=ON	\
		..
	ninja

	cd "${srcdir}/nextpnr/build-machxo2"
	cmake -G Ninja        \
		-DARCH=machxo2     \
		-DBUILD_PYTHON=ON \
		-DBUILD_GUI=ON    \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=${_PREFIX} \
		-DUSE_OPENMP=ON	\
		..
	ninja

	cd "${srcdir}/nextpnr/build-nexus"
	cmake -G Ninja        \
		-DARCH=nexus      \
		-DBUILD_PYTHON=ON \
		-DBUILD_GUI=ON    \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=${_PREFIX} \
		-DUSE_OPENMP=ON	\
		..
	ninja


	cd "${srcdir}/nextpnr/build-generic"
	cmake -G Ninja        \
		-DARCH=generic    \
		-DBUILD_PYTHON=ON \
		-DBUILD_GUI=ON    \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=${_PREFIX} \
		-DUSE_OPENMP=ON	\
		..
	ninja

}

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

	DESTDIR="${pkgdir}" PREFIX="${_PREFIX}" ninja -C build-ice40 install
	DESTDIR="${pkgdir}" PREFIX="${_PREFIX}" ninja -C build-ecp5 install
	DESTDIR="${pkgdir}" PREFIX="${_PREFIX}" ninja -C build-machxo2 install
	DESTDIR="${pkgdir}" PREFIX="${_PREFIX}" ninja -C build-nexus install
	DESTDIR="${pkgdir}" PREFIX="${_PREFIX}" ninja -C build-generic install

	install -Dm644 "${srcdir}/nextpnr/COPYING" "${pkgdir}${_PREFIX}/share/licenses/nextpnr/COPYING"
}