This commit is contained in:
xiota 2024-12-27 17:09:47 +00:00
commit c19dfc3c24
6 changed files with 163 additions and 0 deletions

21
.SRCINFO Normal file
View file

@ -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

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
*
!PKGBUILD
!.SRCINFO
!.gitignore

4
.nvchecker.toml Normal file
View file

@ -0,0 +1,4 @@
[ryujinx-canary]
source = "git"
git = "https://github.com/Ryubing/Ryujinx.git"
prefix = "v"

33
PKGBUILD Normal file
View file

@ -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'
)

28
PKGBUILD.canary Normal file
View file

@ -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
}

73
PKGBUILD.common Normal file
View file

@ -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"
}