diff options
author | Hekuran | 2020-05-13 00:10:40 +0200 |
---|---|---|
committer | Hekuran | 2020-05-13 00:10:40 +0200 |
commit | b9efcc9ab3f65cb4a7edf18f39a5372bfe87b7e7 (patch) | |
tree | a01df30fe00504f1ea9aa09464f28edc076fa967 | |
parent | 17ebddb36178b1baf1a30e4733ae722985690194 (diff) | |
download | aur-b9efcc9ab3f65cb4a7edf18f39a5372bfe87b7e7.tar.gz |
applying the suggestion of selurvedu
-rw-r--r-- | PKGBUILD | 29 | ||||
-rwxr-xr-x | sm64pc-xdg | 6 |
2 files changed, 22 insertions, 13 deletions
@@ -1,38 +1,43 @@ # Maintainer: Hekuran https://github.com/narukeh pkgname=sm64pc-git -pkgver=r71.b4626bf +pkgver=r118.0ec63e4 pkgrel=1 pkgdesc='Super Mario 64-PC - OpenGL adaptation of n64decomp/sm64' arch=('any') -url="https://github.com/sm64pc/sm64pc/" +url='https://github.com/sm64pc/sm64pc' license=('MIT') depends=('python' 'audiofile' 'sdl2' 'glew') provides=(sm64pc) _gitname=sm64pc +_region=us -source=("git+https://github.com/sm64pc/sm64pc.git") +source=('git+https://github.com/sm64pc/sm64pc.git') sha256sums=('SKIP') pkgver() { - cd "$srcdir/$_gitname" - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + cd "$srcdir/$_gitname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } prepare() { cd "$srcdir/$_gitname" - cp ../../baserom.us.z64 . || printf "$(printf "%"$(stty size | awk '{print $2}')"s\n" | sed "s/ /░/g" && printf "\\n%s\\n%s\\n\\n" "US by default, if you want JP or EU, edit the PKGBUILD." "NO ROM FOUND\!: Copy your sm64 rom to \"src/sm64pc/\", if using 'yay' then \"~/.cache/yay/sm64pc/\". And then rename it as \"baserom.us.z64\" or \"baserom.jp.z64\" or \"baserom.eu.z64\"." && printf "%"$(stty size | awk '{print $2}')"s\n" | sed "s/ /░/g")" + 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=us -j4 + cd "$srcdir/$_gitname" + make VERSION=$_region BETTERCAMERA=1 ${MAKEFLAGS:--j$(nproc)} } package() { - cd "$srcdir/$_gitname/build/us_pc" - install -Dm755 sm64.us* "${pkgdir}/usr/bin/sm64pc" - cd "$srcdir" - install -Dm755 ../sm64pc-xdg "${pkgdir}/usr/local/bin/sm64pc" + install -Dm755 "$srcdir/../sm64pc-xdg" "${pkgdir}/usr/bin/sm64pc" + install -Dm755 "$srcdir/$_gitname/build/${_region}_pc/sm64.${_region}".* "${pkgdir}/usr/bin/sm64pc.bin" } diff --git a/sm64pc-xdg b/sm64pc-xdg index 05e83df3f1c8..6afb76fd0526 100755 --- a/sm64pc-xdg +++ b/sm64pc-xdg @@ -1,2 +1,6 @@ #!/bin/sh -mkdir $XDG_DATA_HOME/sm64pc >/dev/null 2>&1 ; cd $XDG_DATA_HOME/sm64pc && /usr/bin/sm64pc >/dev/null 2>&1 & +set -e +XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" +[ -d "$XDG_DATA_HOME/sm64pc" ] || mkdir "$XDG_DATA_HOME/sm64pc" +cd "$XDG_DATA_HOME/sm64pc" +/usr/bin/sm64pc.bin |