Files
eden/.ci/linux/package.sh
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

153 lines
3.7 KiB
Bash
Raw Normal View History

2025-06-28 22:11:38 -04:00
#!/bin/sh -e
2025-04-01 18:49:53 +02:00
2025-09-21 21:58:59 +02:00
# SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
2025-04-13 19:35:59 -04:00
# This script assumes you're in the source directory
2025-04-01 18:49:53 +02:00
2025-04-13 19:35:59 -04:00
export APPIMAGE_EXTRACT_AND_RUN=1
2025-04-20 22:09:44 +00:00
export BASE_ARCH="$(uname -m)"
2025-06-16 03:27:06 +00:00
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio"
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}"
2025-04-01 18:49:53 +02:00
2025-06-28 22:11:38 -04:00
case "$1" in
amd64|"")
echo "Packaging amd64-v3 optimized build of Eden"
ARCH="amd64_v3"
;;
steamdeck|zen2)
2025-06-28 22:11:38 -04:00
echo "Packaging Steam Deck (Zen 2) optimized build of Eden"
ARCH="steamdeck"
;;
rog-ally|allyx|zen4)
2025-06-28 22:11:38 -04:00
echo "Packaging ROG Ally X (Zen 4) optimized build of Eden"
ARCH="rog-ally-x"
;;
legacy)
echo "Packaging amd64 generic build of Eden"
ARCH=amd64
;;
aarch64)
echo "Packaging armv8-a build of Eden"
ARCH=aarch64
;;
armv9)
echo "Packaging armv9-a build of Eden"
ARCH=armv9
;;
native)
echo "Packaging native build of Eden"
ARCH="$BASE_ARCH"
;;
2025-06-28 22:11:38 -04:00
esac
export BUILDDIR="$2"
2025-04-01 18:49:53 +02:00
if [ "$BUILDDIR" = '' ]
then
BUILDDIR=build
fi
2025-05-10 11:49:25 -04:00
EDEN_TAG=$(git describe --tags --abbrev=0)
2025-06-28 22:11:38 -04:00
echo "Making \"$EDEN_TAG\" build"
# git checkout "$EDEN_TAG"
2025-05-10 11:49:25 -04:00
VERSION="$(echo "$EDEN_TAG")"
2025-04-13 19:35:59 -04:00
# NOW MAKE APPIMAGE
mkdir -p ./AppDir
cd ./AppDir
cp ../dist/dev.eden_emu.eden.desktop .
cp ../dist/dev.eden_emu.eden.svg .
2025-04-12 23:33:35 -04:00
ln -sf ./dev.eden_emu.eden.svg ./.DirIcon
2025-04-12 23:33:35 -04:00
2025-06-28 22:11:38 -04:00
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
2025-06-11 15:05:03 +00:00
if [ "$DEVEL" = 'true' ]; then
sed -i 's|Name=Eden|Name=Eden Nightly|' ./dev.eden_emu.eden.desktop
2025-06-28 22:11:38 -04:00
UPINFO="$(echo "$UPINFO" | sed 's|Releases|nightly|')"
2025-06-11 15:05:03 +00:00
fi
2025-04-20 22:09:44 +00:00
LIBDIR="/usr/lib"
2025-06-16 03:27:06 +00:00
# Workaround for Gentoo
if [ ! -d "$LIBDIR/qt6" ]
then
LIBDIR="/usr/lib64"
fi
# Workaround for Debian
if [ ! -d "$LIBDIR/qt6" ]
2025-04-20 22:09:44 +00:00
then
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
fi
2025-04-13 19:35:59 -04:00
# Bundle all libs
2025-06-11 15:05:03 +00:00
2025-06-16 03:27:06 +00:00
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
chmod +x ./sharun-aio
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
../$BUILDDIR/bin/eden* \
2025-04-20 22:09:44 +00:00
$LIBDIR/lib*GL*.so* \
$LIBDIR/dri/* \
$LIBDIR/vdpau/* \
$LIBDIR/libvulkan* \
$LIBDIR/libXss.so* \
$LIBDIR/libdecor-0.so* \
$LIBDIR/libgamemode.so* \
$LIBDIR/qt6/plugins/audio/* \
$LIBDIR/qt6/plugins/bearer/* \
$LIBDIR/qt6/plugins/imageformats/* \
$LIBDIR/qt6/plugins/iconengines/* \
$LIBDIR/qt6/plugins/platforms/* \
$LIBDIR/qt6/plugins/platformthemes/* \
$LIBDIR/qt6/plugins/platforminputcontexts/* \
$LIBDIR/qt6/plugins/styles/* \
$LIBDIR/qt6/plugins/xcbglintegrations/* \
$LIBDIR/qt6/plugins/wayland-*/* \
$LIBDIR/pulseaudio/* \
$LIBDIR/pipewire-0.3/* \
$LIBDIR/spa-0.2/*/* \
$LIBDIR/alsa-lib/*
2025-04-13 19:35:59 -04:00
2025-06-16 03:27:06 +00:00
rm -f ./sharun-aio
2025-04-13 19:35:59 -04:00
# Prepare sharun
if [ "$ARCH" = 'aarch64' ]; then
2025-06-16 03:27:06 +00:00
# allow the host vulkan to be used for aarch64 given the sad situation
2025-04-13 19:35:59 -04:00
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
fi
2025-04-12 23:33:35 -04:00
2025-06-16 03:27:06 +00:00
# Workaround for Gentoo
if [ -d "shared/libproxy" ]; then
cp shared/libproxy/* lib/
fi
2025-04-12 23:33:35 -04:00
2025-04-13 19:35:59 -04:00
ln -f ./sharun ./AppRun
./sharun -g
2025-04-12 23:33:35 -04:00
2025-04-13 19:35:59 -04:00
# turn appdir into appimage
cd ..
wget -q "$URUNTIME" -O ./uruntime
chmod +x ./uruntime
2025-04-12 23:33:35 -04:00
2025-04-13 19:35:59 -04:00
#Add udpate info to runtime
echo "Adding update information \"$UPINFO\" to runtime..."
./uruntime --appimage-addupdinfo "$UPINFO"
2025-04-12 23:33:35 -04:00
2025-04-13 19:35:59 -04:00
echo "Generating AppImage..."
./uruntime --appimage-mkdwarfs -f \
--set-owner 0 --set-group 0 \
--no-history --no-create-timestamp \
--categorize=hotness --hotness-list=.ci/linux/eden.dwfsprof \
2025-04-13 19:35:59 -04:00
--compression zstd:level=22 -S26 -B32 \
--header uruntime \
2025-04-20 22:09:44 +00:00
-N 4 \
2025-04-13 19:35:59 -04:00
-i ./AppDir -o Eden-"$VERSION"-"$ARCH".AppImage
2025-04-01 18:49:53 +02:00
2025-04-13 19:35:59 -04:00
echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage
2025-06-16 03:27:06 +00:00
echo "All Done!"