diff options
-rw-r--r-- | .SRCINFO | 23 | ||||
-rwxr-xr-x | NanoBoyAdvance.sh | 17 | ||||
-rw-r--r-- | PKGBUILD | 52 |
3 files changed, 92 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..5c52f8c8f985 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = nanoboyadvance-git + pkgdesc = Accuracy-focused Game Boy Advance emulator. + pkgver = 1.3.r57.g6299f4b + pkgrel = 1 + url = https://github.com/fleroviux/NanoboyAdvance + arch = x86_64 + license = GPL3 + makedepends = cmake + makedepends = make + makedepends = gcc + depends = sdl + depends = glew + source = git+https://github.com/fleroviux/NanoBoyAdvance.git + source = git+https://github.com/fmtlib/fmt.git + source = git+https://github.com/ToruNiina/toml11.git + source = NanoBoyAdvance.sh + md5sums = SKIP + md5sums = SKIP + md5sums = SKIP + md5sums = 3a61b7b4cbece463119ea84a54293ba4 + +pkgname = nanoboyadvance-git + diff --git a/NanoBoyAdvance.sh b/NanoBoyAdvance.sh new file mode 100755 index 000000000000..56bcf3b0dc84 --- /dev/null +++ b/NanoBoyAdvance.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +confdir=. + +if [[ ! -z "$XDG_CONFIG_HOME" ]]; then + confdir="${XDG_CONFIG_HOME}/NanoBoyAdvance" +elif [[ ! -z "$HOME" ]]; then + confdir="${HOME}/.config/NanoBoyAdvance" +fi + +mkdir -p "$confdir" +cd "$confdir" + +[[ ! -f config.toml ]] && cp /usr/share/NanoBoyAdvance/config.toml . +[[ ! -f keymap.toml ]] && cp /usr/share/NanoBoyAdvance/keymap.toml . + +exec /usr/lib/ld-linux-x86-64.so.2 --argv0 "$confdir/NanoBoyAdvance" /usr/lib/NanoBoyAdvance "$@" diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..482b64774c19 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Nadia Holmquist Pedersen <nadia@nhp.sh> + +_pkgbase=nanoboyadvance +pkgname=${_pkgbase}-git +pkgdesc="Accuracy-focused Game Boy Advance emulator." +pkgver=1.3.r57.g6299f4b +pkgrel=1 +arch=(x86_64) +url="https://github.com/fleroviux/NanoboyAdvance" +license=(GPL3) +depends=(sdl glew) +makedepends=(cmake make gcc) +source=( + "git+https://github.com/fleroviux/NanoBoyAdvance.git" + "git+https://github.com/fmtlib/fmt.git" + "git+https://github.com/ToruNiina/toml11.git" + NanoBoyAdvance.sh +) +md5sums=('SKIP' + 'SKIP' + 'SKIP' + '3a61b7b4cbece463119ea84a54293ba4') + +pkgver() { + cd NanoBoyAdvance + git describe --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +prepare() { + cd NanoBoyAdvance + git submodule init + git submodule set-url external/fmtlib "${srcdir}/fmt" + git submodule set-url external/toml11 "${srcdir}/toml11" + git submodule update +} + +build(){ + cd "$srcdir/NanoBoyAdvance" + cmake -B build -DCMAKE_BUILD_TYPE=Release + make -C build +} + +package(){ + cd "$srcdir/NanoBoyAdvance" + install -Dm755 build/src/platform/sdl/NanoBoyAdvance -t "${pkgdir}/usr/lib" + install -Dm755 "${srcdir}/../NanoBoyAdvance.sh" "${pkgdir}/usr/bin/NanoBoyAdvance" + + mkdir -p "${pkgdir}/usr/share/NanoBoyAdvance" + cp -r src/platform/sdl/resource/. "${pkgdir}/usr/share/NanoBoyAdvance" + rm "${pkgdir}/usr/share/NanoBoyAdvance/shader.cmake" + sed -i -E 's@^shader_(.s) = "(.*)"$@shader_\1 = "/usr/share/NanoBoyAdvance/\2"@' "${pkgdir}/usr/share/NanoBoyAdvance/config.toml" +} |