summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f77abb22001f3b94e35ab3bd7efd6a8911adcc9f (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: Tobias Frisch <thejackimonster@gmail.com>

pkgname=funemustation-git
_name=funemustation
_export=FunEmuStation_Launcher
pkgver=2.0.2
pkgrel=1
pkgdesc="A simple but elegant launcher of emulators and pc games"
url="https://dannygaray60.itch.io/funemustation-launcher"
depends=('libxcursor' 'libxinerama' 'freetype2' 'alsa-lib' 'libxrandr' 'libxi' 'libglvnd')
makedepends=('godot' 'git')
optdepends=()
license=('GPL3')
arch=('any')
source=("git+https://github.com/dannygaray60/${_name}.git")
sha256sums=('SKIP')
provides=('funemustation')

pkgver() {
	cd ${srcdir}/${_name}

	cat 'export_presets.cfg' | grep "application/product_version" | cut -c 29- | tr '"' ' ' | awk '{ print $1 }'
}

build() {
	cd ${srcdir}/${_name}
	
	mkdir -p "bin"
	echo "#!/bin/sh" > "bin/${_name}"
	echo "mkdir -p ~/.local/share/${_name}/fes_data" >> "bin/${_name}"
	echo "cp /usr/share/${_name}/${_export}.x86_64 ~/.local/share/${_name}/${_export}.x86_64" >> "bin/${_name}"
	echo "if [ ! -h test ]; then ln -s /usr/share/${_name}/${_export}.pck ~/.local/share/${_name}/${_export}.pck; fi" >> "bin/${_name}"
	echo "cd ~/.local/share/${_name}" >> "bin/${_name}"
	echo "./${_export}.x86_64" >> "bin/${_name}"

	godot --no-window --path "." --export-release "Linux/X11" "bin/${_export}.x86_64"
}

package() {
	cd ${srcdir}/${_name}
	
	install -Dm755 "bin/${_export}.x86_64" "$pkgdir/usr/share/$_name/${_export}.x86_64"
	install -Dm644 "bin/${_export}.pck" "$pkgdir/usr/share/$_name/${_export}.pck"
	install -Dm755 "bin/${_name}" "$pkgdir/usr/bin/${_name}"
}