This commit is contained in:
xiota 2024-10-28 07:04:44 +00:00
parent dc4b75aca7
commit b19293ec93
3 changed files with 23 additions and 66 deletions

View file

@ -1,9 +1,8 @@
pkgbase = ryujinx
pkgdesc = Experimental Nintendo Switch Emulator written in C#
pkgver = 1.2.59
pkgrel = 1
pkgrel = 2
url = https://github.com/GreemDev/Ryujinx
install = ryujinx.install
arch = x86_64
license = MIT
makedepends = desktop-file-utils
@ -12,7 +11,6 @@ pkgbase = ryujinx
depends = zlib
options = !strip
options = !debug
options = emptydirs
source = ryujinx-1.2.59.tar.gz::https://github.com/GreemDev/Ryujinx/archive/1.2.59.tar.gz
sha256sums = SKIP

View file

@ -7,11 +7,13 @@ if [ -z "$_srcinfo" ] && [ -z "$_pkgver" ]; then
: ${_autoupdate:=true}
fi
: ${_install_path:=usr/lib}
## basic info
_pkgname="ryujinx"
pkgname="$_pkgname"
pkgver=1.2.59
pkgrel=1
pkgrel=2
pkgdesc="Experimental Nintendo Switch Emulator written in C#"
url="https://github.com/GreemDev/Ryujinx"
license=('MIT')
@ -26,8 +28,7 @@ makedepends=(
'dotnet-sdk-bin' # aur/dotnet-core-bin
)
options=('!strip' '!debug' 'emptydirs')
install="$_pkgname.install"
options=('!strip' '!debug')
_source_ryujinx() {
_pkgsrc="Ryujinx-$_pkgver"
@ -40,14 +41,10 @@ pkgver() {
echo "${_pkgver:?}"
}
build() {
cd "$_pkgsrc"
build() (
export HOME="$SRCDEST/nuget-home"
export DOTNET_CLI_TELEMETRY_OPTOUT=1
dotnet clean
dotnet nuget locals all -c
local _args=(
-c Release
-r linux-x64
@ -59,49 +56,47 @@ build() {
)
echo "Building AVA Interface..."
dotnet publish "${_args[@]}" -o publish_ava src/Ryujinx
dotnet publish "${_args[@]}" -o publish_ava "$_pkgsrc/src/Ryujinx"
echo "Building SDL2 Headless..."
dotnet publish "${_args[@]}" -o publish_sdl src/Ryujinx.Headless.SDL2
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() {
cd "$_pkgsrc"
# program
install -dm755 "$pkgdir/opt/ryujinx"
cp -a --update=none --reflink=auto publish_ava/* "$pkgdir/opt/ryujinx/"
cp -a --update=none --reflink=auto publish_sdl/* "$pkgdir/opt/ryujinx/"
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 "/opt/ryujinx/Ryujinx" "$pkgdir/usr/bin/ryujinx"
ln -s "/opt/ryujinx/Ryujinx.Headless.SDL2" "$pkgdir/usr/bin/ryujinx.sdl"
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 distribution/linux/Ryujinx.desktop "$pkgdir/usr/share/applications/ryujinx.desktop"
install -Dm644 "$_pkgsrc"/distribution/linux/Ryujinx.desktop "$pkgdir/usr/share/applications/ryujinx.desktop"
# icon
install -Dm644 distribution/misc/Logo.svg "$pkgdir/usr/share/pixmaps/ryujinx.svg"
install -Dm644 "$_pkgsrc"/distribution/misc/Logo.svg "$pkgdir/usr/share/pixmaps/ryujinx.svg"
# mimetype
install -Dm644 distribution/linux/mime/Ryujinx.xml "$pkgdir/usr/share/mime/packages/ryujinx.xml"
install -Dm644 "$_pkgsrc"/distribution/linux/mime/Ryujinx.xml "$pkgdir/usr/share/mime/packages/ryujinx.xml"
# license
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/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/opt/ryujinx/Ryujinx"
chmod 755 "$pkgdir/opt/ryujinx/Ryujinx.Headless.SDL2"
chmod 755 "$pkgdir/opt/ryujinx/Ryujinx.sh"
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/opt/ryujinx/Logs"
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"

View file

@ -1,36 +0,0 @@
note() {
printf "${BLUE}==>${YELLOW} $1 ${WHITE}$2${ALL_OFF}\n"
}
msg1() {
printf "${BLUE}==>${WHITE} $1${ALL_OFF}\n"
}
msg2() {
printf " ${WHITE} $1${ALL_OFF}\n"
}
ALL_OFF="$(tput sgr0)"
BOLD="${ALL_OFF}$(tput bold)"
BLACK="${BOLD}$(tput setaf 0)"
RED="${BOLD}$(tput setaf 1)"
GREEN="${BOLD}$(tput setaf 2)"
YELLOW="${BOLD}$(tput setaf 3)"
BLUE="${BOLD}$(tput setaf 4)"
MAGENTA="${BOLD}$(tput setaf 5)"
CYAN="${BOLD}$(tput setaf 6)"
WHITE="${BOLD}$(tput setaf 7)"
post_install() {
note 'Warning:' "Contents of '/opt/ryujinx/Logs' will be deleted on uninstall."
}
post_upgrade() {
post_install
}
pre_remove() {
if [ -d "/opt/ryujinx/Logs" ]; then
rm -rf /opt/ryujinx/Logs/*
fi
}