summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 510832c633713acbbceeb6557bb7ff3bcc2cf7c3 (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
# Maintainer: PAPPY <pappy _AT_ a s c e l i o n _DOT_ com>

pkgbase=simavr
pkgname=(simavr-asc simavr-asc-examples)
pkgver=1.5
pkgrel=1
pkgdesc='A lean, mean and hackable AVR simulator'
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/buserror/simavr"
license=('GPL3')
depends=('elfutils')
makedepends=('avr-libc' 'git' 'freeglut' 'glu')
source=("${pkgbase}::git+https://github.com/buserror/simavr.git")
options=(!strip)
md5sums=('SKIP')
provides=(simavr)
conflicts=(simavr)
replaces=(simavr)

pkgver()
{
	cd "$srcdir/$pkgbase"
	git log -1 --tags --simplify-by-decoration --pretty="format:%d"|sed 's/[\(\) ]//g; s/.*tag:v//'
}

prepare()
{
	cd "$srcdir/$pkgbase"

	cat <<-EOF > .make.options
	V=1
	RELEASE=1
	CPPFLAGS=-DCONFIG_SIMAVR_TRACE=1
	EOF
}

build() {
	cd "$srcdir/$pkgbase"

	make AVR_ROOT=/usr/avr RELEASE=1 \
		CFLAGS="-Wall -Wextra -fPIC -O2 -std=gnu99 -Wno-sign-compare -Wno-unused-parameter" \
		build-simavr build-examples
}

package_simavr-asc() {
	cd "$srcdir/$pkgbase"
	make PREFIX="/usr" DESTDIR="$pkgdir/usr" RELEASE=1 install
}

package_simavr-asc-examples() {
	depends=(simavr-asc=$pkgver freeglut glu)
	provides=(simavr-examples)
	conflicts=(simavr-examples)
	replaces=(simavr-examples)
	cd "$srcdir/$pkgbase"
	install -d $pkgdir/usr/share/doc
	cp -r examples $pkgdir/usr/share/doc/$pkgbase
}