commit c19dfc3c24c7bbd4e71089e47ac3eddbbd6d9ec6 Author: xiota Date: Fri Dec 27 17:09:47 2024 +0000 1.2.146 diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000000000..a658ff0920214 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,21 @@ +pkgbase = ryujinx-canary + pkgdesc = Experimental Nintendo Switch Emulator written in C# + pkgver = 1.2.146 + pkgrel = 1 + url = https://github.com/Ryubing/Ryujinx + arch = x86_64 + license = MIT + makedepends = desktop-file-utils + makedepends = dotnet-sdk-bin + depends = gcc-libs + depends = zlib + options = !strip + options = !debug + source = ryujinx-canary-1.2.146.tar.gz::https://github.com/Ryubing/Ryujinx/archive/refs/tags/Canary-1.2.146.tar.gz + source = PKGBUILD.canary + source = PKGBUILD.common + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + +pkgname = ryujinx-canary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000..018a3de081444 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +* +!PKGBUILD +!.SRCINFO +!.gitignore diff --git a/.nvchecker.toml b/.nvchecker.toml new file mode 100644 index 0000000000000..0156a11e3672a --- /dev/null +++ b/.nvchecker.toml @@ -0,0 +1,4 @@ +[ryujinx-canary] +source = "git" +git = "https://github.com/Ryubing/Ryujinx.git" +prefix = "v" diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000000000..2016a4c09be80 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,33 @@ +# Maintainer: + +## options +if [[ (-z "$_srcinfo" && -z "$_pkgver") ]]; then + : ${_autoupdate:=true} +fi + +: ${_install_path:=usr/lib} +: ${startdir:=.} + +_pkgname="ryujinx" +pkgname="$_pkgname-canary" +pkgver=1.2.146 +pkgrel=1 +pkgdesc="Experimental Nintendo Switch Emulator written in C#" +url="https://github.com/Ryubing/Ryujinx" +license=('MIT') +arch=('x86_64') + +source "$startdir"/PKGBUILD.common +source "$startdir"/PKGBUILD.canary + +_update_version +_source_ryujinx + +source+=( + PKGBUILD.canary + PKGBUILD.common +) +sha256sums+=( + 'SKIP' + 'SKIP' +) diff --git a/PKGBUILD.canary b/PKGBUILD.canary new file mode 100644 index 0000000000000..47900b299d6dd --- /dev/null +++ b/PKGBUILD.canary @@ -0,0 +1,28 @@ +_source_ryujinx() { + _pkgsrc="${_pkgname^}-Canary-${_pkgver%.Canary}" + _pkgext="tar.gz" + source=("${_pkgsrc,,}.$_pkgext"::"$url/archive/refs/tags/Canary-$_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 0000000000000..e865faf67e9da --- /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%%.[A-Za-z]*}" + ) + + 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" +}