diff --git a/.SRCINFO b/.SRCINFO index 703246ade40d..12ed69d7dbf4 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = ryujinx pkgdesc = Experimental Nintendo Switch Emulator written in C# - pkgver = 1.2.72 + pkgver = 1.2.76 pkgrel = 1 url = https://github.com/GreemDev/Ryujinx arch = x86_64 @@ -11,7 +11,7 @@ pkgbase = ryujinx depends = zlib options = !strip options = !debug - source = ryujinx-1.2.72.tar.gz::https://github.com/GreemDev/Ryujinx/archive/1.2.72.tar.gz + source = ryujinx-1.2.76.tar.gz::https://github.com/GreemDev/Ryujinx/archive/refs/tags/1.2.76.tar.gz sha256sums = SKIP pkgname = ryujinx diff --git a/PKGBUILD b/PKGBUILD index c2d8d6e32648..57b58cc1a091 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,129 +1,41 @@ # Maintainer: -# Contributor: HurricanePootis -# Contributor: Marco Rubin ## options -if [ -z "$_srcinfo" ] && [ -z "$_pkgver" ]; then +if [[ (-z "$_srcinfo" && -z "$_pkgver") ]]; then : ${_autoupdate:=true} fi : ${_install_path:=usr/lib} +: ${_canary:=false} +: ${startdir:=.} -## basic info _pkgname="ryujinx" -pkgname="$_pkgname" -pkgver=1.2.72 +pkgver=1.2.76 pkgrel=1 pkgdesc="Experimental Nintendo Switch Emulator written in C#" url="https://github.com/GreemDev/Ryujinx" license=('MIT') arch=('x86_64') -depends=( - 'gcc-libs' - 'zlib' +if [[ "${_canary::1}" == "t" ]]; then + _autoupdate=true + source "$startdir"/PKGBUILD.canary +else + source "$startdir"/PKGBUILD.release +fi + +source "$startdir"/PKGBUILD.common + +source+=( + PKGBUILD.canary + PKGBUILD.common + PKGBUILD.release ) -makedepends=( - 'desktop-file-utils' - 'dotnet-sdk-bin' # aur/dotnet-core-bin +sha256sums+=( + 'SKIP' + 'SKIP' + 'SKIP' ) -options=('!strip' '!debug') - -_source_ryujinx() { - _pkgsrc="Ryujinx-$_pkgver" - _pkgext="tar.gz" - source=("${_pkgsrc,}.$_pkgext"::"$url/archive/$_pkgver.$_pkgext") - sha256sums=('SKIP') -} - -pkgver() { - echo "${_pkgver:?}" -} - -build() ( - export HOME="$SRCDEST/nuget-home" - export DOTNET_CLI_TELEMETRY_OPTOUT=1 - - local _args=( - -c Release - -r linux-x64 - --nologo - --self-contained true - -p:DebugType=none - -p:ExtraDefineConstants=DISABLE_UPDATER - -p:Version="$pkgver" - ) - - echo "Building AVA Interface..." - dotnet publish "${_args[@]}" -o publish_ava "$_pkgsrc/src/Ryujinx" - - echo "Building SDL2 Headless..." - dotnet publish "${_args[@]}" -o publish_sdl "$_pkgsrc/src/Ryujinx.Headless.SDL2" - - echo "Shutting down dotnet build server in background." - (timeout -k 45 30 dotnet build-server shutdown) > /dev/null 2>&1 & -) - -package() { - # program - install -dm755 "$pkgdir/$_install_path/ryujinx" - cp -a --update=none --reflink=auto publish_ava/* "$pkgdir/$_install_path/ryujinx/" - cp -a --update=none --reflink=auto publish_sdl/* "$pkgdir/$_install_path/ryujinx/" - - # symlinks - install -dm755 "$pkgdir/usr/bin" - ln -s "/$_install_path/ryujinx/Ryujinx" "$pkgdir/usr/bin/ryujinx" - ln -s "/$_install_path/ryujinx/Ryujinx.Headless.SDL2" "$pkgdir/usr/bin/ryujinx.sdl" - - # .desktop - install -Dm644 "$_pkgsrc"/distribution/linux/Ryujinx.desktop "$pkgdir/usr/share/applications/ryujinx.desktop" - - # icon - install -Dm644 "$_pkgsrc"/distribution/misc/Logo.svg "$pkgdir/usr/share/pixmaps/ryujinx.svg" - - # mimetype - install -Dm644 "$_pkgsrc"/distribution/linux/mime/Ryujinx.xml "$pkgdir/usr/share/mime/packages/ryujinx.xml" - - # license - install -Dm644 "$_pkgsrc"/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" - - # fix permissions - find "$pkgdir" -type d -exec chmod 755 {} \; - find "$pkgdir" -type f -exec chmod 644 {} \; - chmod 755 "$pkgdir/$_install_path/ryujinx/Ryujinx" - chmod 755 "$pkgdir/$_install_path/ryujinx/Ryujinx.Headless.SDL2" - chmod 755 "$pkgdir/$_install_path/ryujinx/Ryujinx.sh" - - # writable log directory - install -dm777 "$pkgdir/$_install_path/ryujinx/Logs" - - # fix desktop file - desktop-file-edit --set-key="Exec" --set-value="ryujinx %f" "$pkgdir/usr/share/applications/ryujinx.desktop" - desktop-file-edit --set-icon="ryujinx" "$pkgdir/usr/share/applications/ryujinx.desktop" -} - -_update_version() { - : ${_pkgver:=$pkgver} - - if [[ "${_autoupdate::1}" != "t" ]]; then - return - fi - - local _response _tag _pkgver_new - _response=$(curl -Ssf "$url/releases") - _tag=$( - printf '%s' "$_response" \ - | grep -E '/tree/([0-9\.]+)"' \ - | sed -E 's&^.*/tree/([0-9\.]+)".*$&\1&' \ - | sort -rV | head -1 - ) - _pkgver_new="${_tag#v}" - - if [ "$_pkgver" != "${_pkgver_new:?}" ]; then - _pkgver="${_pkgver_new:?}" - fi -} - _update_version _source_ryujinx diff --git a/PKGBUILD.canary b/PKGBUILD.canary new file mode 100644 index 000000000000..ac3e1cfee3a1 --- /dev/null +++ b/PKGBUILD.canary @@ -0,0 +1,30 @@ +pkgname="$_pkgname-canary" + +_source_ryujinx() { + _pkgsrc="${_pkgname^}-Canary-$_pkgver" + _pkgext="tar.gz" + source=("${_pkgsrc,,}.$_pkgext"::"$url/archive/refs/tags/${_tag:-$_pkgver}.$_pkgext") + sha256sums=('SKIP') +} + +_update_version() { + : ${_pkgver:=$pkgver} + + if [[ "${_autoupdate::1}" != "t" ]]; then + return + fi + + local _response _pkgver_new + _response=$(curl -Ssf "$url/tags") + _tag=$( + printf '%s' "$_response" \ + | grep -E '/tag/Canary-([0-9\.]+)"' \ + | sed -E 's&^.*/tag/(Canary-[0-9\.]+)".*$&\1&' \ + | sort -rV | head -1 + ) + _pkgver_new="${_tag#Canary-}" + + if [ "$_pkgver" != "${_pkgver_new:?}" ]; then + _pkgver="${_pkgver_new:?}" + fi +} diff --git a/PKGBUILD.common b/PKGBUILD.common new file mode 100644 index 000000000000..a8a067b97f69 --- /dev/null +++ b/PKGBUILD.common @@ -0,0 +1,73 @@ +depends=( + 'gcc-libs' + 'zlib' +) +makedepends=( + 'desktop-file-utils' + 'dotnet-sdk-bin' # aur/dotnet-core-bin +) + +options=('!strip' '!debug') + +pkgver() { + echo "${_pkgver:?}" +} + +build() ( + export HOME="$SRCDEST/nuget-home" + export DOTNET_CLI_TELEMETRY_OPTOUT=1 + + local _args=( + -c Release + -r linux-x64 + --nologo + --self-contained true + -p:DebugType=none + -p:ExtraDefineConstants=DISABLE_UPDATER + -p:Version="$pkgver" + ) + + echo "Building AVA Interface..." + dotnet publish "${_args[@]}" -o publish_ava "$_pkgsrc/src/Ryujinx" + + echo "Building SDL2 Headless..." + dotnet publish "${_args[@]}" -o publish_sdl "$_pkgsrc/src/Ryujinx.Headless.SDL2" + + echo "Shutting down dotnet build server in background." + (timeout -k 45 30 dotnet build-server shutdown) > /dev/null 2>&1 & +) + +package() { + # program + install -dm755 "$pkgdir/$_install_path/ryujinx" + cp -a --update=none --reflink=auto publish_ava/* "$pkgdir/$_install_path/ryujinx/" + cp -a --update=none --reflink=auto publish_sdl/* "$pkgdir/$_install_path/ryujinx/" + + # symlinks + install -dm755 "$pkgdir/usr/bin" + ln -s "/$_install_path/ryujinx/Ryujinx" "$pkgdir/usr/bin/ryujinx" + ln -s "/$_install_path/ryujinx/Ryujinx.Headless.SDL2" "$pkgdir/usr/bin/ryujinx.sdl" + + # .desktop + install -Dm644 "$_pkgsrc"/distribution/linux/Ryujinx.desktop "$pkgdir/usr/share/applications/ryujinx.desktop" + + # icon + install -Dm644 "$_pkgsrc"/distribution/misc/Logo.svg "$pkgdir/usr/share/pixmaps/ryujinx.svg" + + # mimetype + install -Dm644 "$_pkgsrc"/distribution/linux/mime/Ryujinx.xml "$pkgdir/usr/share/mime/packages/ryujinx.xml" + + # license + install -Dm644 "$_pkgsrc"/LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE" + + # fix permissions + find "$pkgdir" -type d -exec chmod 755 {} \; + find "$pkgdir" -type f -exec chmod 644 {} \; + chmod 755 "$pkgdir/$_install_path/ryujinx/Ryujinx" + chmod 755 "$pkgdir/$_install_path/ryujinx/Ryujinx.Headless.SDL2" + chmod 755 "$pkgdir/$_install_path/ryujinx/Ryujinx.sh" + + # fix desktop file + desktop-file-edit --set-key="Exec" --set-value="ryujinx %f" "$pkgdir/usr/share/applications/ryujinx.desktop" + desktop-file-edit --set-icon="ryujinx" "$pkgdir/usr/share/applications/ryujinx.desktop" +} diff --git a/PKGBUILD.release b/PKGBUILD.release new file mode 100644 index 000000000000..c97057c0efa8 --- /dev/null +++ b/PKGBUILD.release @@ -0,0 +1,30 @@ +pkgname="$_pkgname" + +_source_ryujinx() { + _pkgsrc="${_pkgname^}-$_pkgver" + _pkgext="tar.gz" + source=("${_pkgsrc,,}.$_pkgext"::"$url/archive/refs/tags/${_tag:-$_pkgver}.$_pkgext") + sha256sums=('SKIP') +} + +_update_version() { + : ${_pkgver:=$pkgver} + + if [[ "${_autoupdate::1}" != "t" ]]; then + return + fi + + local _response _pkgver_new + _response=$(curl -Ssf "$url/releases") + _tag=$( + printf '%s' "$_response" \ + | grep -E '/tree/([0-9\.]+)"' \ + | sed -E 's&^.*/tree/([0-9\.]+)".*$&\1&' \ + | sort -rV | head -1 + ) + _pkgver_new="${_tag:?}" + + if [ "$_pkgver" != "${_pkgver_new:?}" ]; then + _pkgver="${_pkgver_new:?}" + fi +}