summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 56ae2636aa178dc850d95fdaca966fd2f6f61fb8 (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
# Maintainer: Hekuran https://github.com/narukeh

pkgname=sm64pc-git
pkgver=r513.57c20346
pkgrel=1
pkgdesc='Super Mario 64 PC (sm64ex aka. sm64pc) - OpenGL adaptation of n64decomp/sm64'
arch=('any')
url='https://github.com/sm64pc/sm64ex'
license=('reverse-engineered and unlicensed')
makedepends=('git' 'python' 'libglvnd' 'audiofile')
depends=('sdl2')
provides=(sm64ex)

_gitname=sm64ex
_region=us

source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/$_gitname"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd "$srcdir/$_gitname"
	cp "../../baserom.${_region}.z64" . || {
		printf "%$(stty size | awk '{print $2}')s\n" | sed "s/ /░/g"
		printf "\\n%s\\n%s\\n\\n" \
			"NO ROM FOUND! Copy your sm64 ROM to \"$(realpath ../../)\" and rename it to \"baserom.${_region}.z64\"." \
			"The default ROM region is US. You have to edit the PKGBUILD if you would like to use a JP or EU version."
		printf "%$(stty size | awk '{print $2}')s\n" | sed "s/ /░/g"
	}
}

build() {
	cd "$srcdir/$_gitname"
	make VERSION=$_region BETTERCAMERA=1 ${MAKEFLAGS:--j$(nproc)}
}

package() {
	install -Dm755 "$srcdir/$_gitname/build/${_region}_pc/sm64.${_region}".* "${pkgdir}/usr/bin/sm64ex"
	ln -sf "/usr/bin/sm64ex" "${pkgdir}/usr/bin/sm64pc"
	install -Dm755 "$srcdir/../sm64ex.desktop" "${pkgdir}/usr/share/applications/sm64ex.desktop"
	install -Dm755 "$srcdir/../SuperMario64.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/SuperMario64.png"
}