summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ce05c08a38a22282e0373ae8037b2a699821f1a4 (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
# Maintainer: CrankySupertoon <crankysupertoon@gmail.com.com>
# Contributor: Andrew O'Neill <andrew at meanjollies dot com>
# Contributor: John Jenkins <twodopeshaggy@gmail.com>
# Contributor: Tony Lambiris <tony@criticalstack.com>

pkgname=mesen-s-git
_pkgname=Mesen-S
pkgver=0.4.0.r146.g89199f2
pkgrel=1
pkgdesc='A cross-platform Super Nintendo emulator'
arch=('x86_64')
makedepends=('clang' 'gendesk' 'zip')
depends=('mono' 'sdl2')
url='https://github.com/SourMesen/Mesen-S'
conflicts=('mesen-s' 'mesen-s-bin')
license=('GPL3')
source=("${_pkgname}::git+https://github.com/SourMesen/Mesen-S.git")
sha256sums=('SKIP')

pkgver() {
	cd "${srcdir}/${_pkgname}"

	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd "${srcdir}/${_pkgname}"

	# Prevent duplicate .desktop from getting created
	sed -i 's/CreateShortcutFile(desktopFile, mimeTypes);//' UI/Config/FileAssociationHelper.cs

	gendesk --pkgname "${_pkgname}" --pkgdesc "${pkgdesc}" --exec "/usr/bin/mesen-s" -n -f

	# Invoke using mono in a wrapper, since wine (if installed) would open it otherwise
	cat > "${pkgname}" <<-EOT
	#!/bin/sh
	/usr/bin/mono /opt/Mesen-S/Mesen-S "\$@"
	EOT
}

build() {
	cd "${srcdir}/${_pkgname}"

	mkdir -p bin
	make
}

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

	install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname%%-git}"
	install -Dm644 "${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

	cd "${srcdir}/${_pkgname}/UI/Resources"
	install -Dm644 "MesenSIcon.png" "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"

	cd "${srcdir}/${_pkgname}/bin/x64/Release"
	install -Dm755 "${_pkgname}.exe" "${pkgdir}/opt/${_pkgname}/${_pkgname}"

	cd "${srcdir}/${_pkgname}/InteropDLL/obj.x64"
	install -Dm644 "libMesenSCore.x64.dll" "${pkgdir}/usr/lib/libMesenSCore.dll"
}