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

pkgname=sameboy-git
pkgdesc="An accuracy-focused Game Boy/Game Boy Color emulator"
pkgver=1452.ec2661ac
pkgrel=1
arch=(x86_64)
url="https://github.com/LIJI32/SameBoy"
license=(MIT)
provides=(sameboy)
depends=(sdl2 hicolor-icon-theme)
# 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+https://github.com/LIJI32/SameBoy)
sha1sums=('SKIP')

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

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

build(){
	make -C SameBoy sdl CONF=release PREFIX=/usr/
}

package(){
	cd SameBoy

	make install CONF=release PREFIX=/usr/ DESTDIR="${pkgdir}"
	# desktop file is missing from make install
	install -Dm644 FreeDesktop/${provides[0]}.desktop "${pkgdir}/usr/share/applications/${provides[0]}.desktop"
	# mimetype icons don't belong here
	# that could lead to file conflicts
	find "${pkgdir}" -name 'x-gameboy*-rom.png' -delete
	find "${pkgdir}" -name mimetypes -delete
	# move license to the correct path for arch
	install -d "${pkgdir}"/usr/share/licenses/${pkgname}/
	mv "${pkgdir}"/usr/share/${provides[0]}/LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/
}