summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7ee61da1c9ff42ef99099b30855ec1181bcbc8b7 (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
# Maintainer: Jakub Kądziołka <kuba@kadziolka.net>

pkgname=sameboy-git
pkgdesc="An accuracy-focused Game Boy/Game Boy Color emulator"
pkgver=903.9e44306
pkgrel=1
arch=(x86_64)
url="https://github.com/LIJI32/SameBoy"
license=(MIT)
depends=(sdl2)
# Upstream suggests using clang, but gcc is supported on Linux: https://github.com/LIJI32/SameBoy/issues/164#issuecomment-486464194
makedepends=(rgbds make git)
source=(git+ssh://git@github.com/LIJI32/SameBoy.git)
sha1sums=(SKIP)

prepare(){
	sed -i 's/-Werror //' SameBoy/Makefile
}

pkgver(){
	cd SameBoy
	echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build(){
	cd SameBoy
	make sdl CONF=release DATA_DIR=/usr/share/games/sameboy/
}

package(){
	cd SameBoy
	install -Dm755 build/bin/SDL/sameboy "$pkgdir/usr/bin/sameboy"
	find build/bin/SDL -type f -not -executable | while read f; do
		install -Dm644 "$f" "$pkgdir/usr/share/games/sameboy/${f#build/bin/SDL/}"
	done
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/sameboy-git/LICENSE"
}