mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 09:25:45 +00:00
Signed-off-by: crueter <swurl@swurl.xyz> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/192 Co-authored-by: crueter <swurl@swurl.xyz> Co-committed-by: crueter <swurl@swurl.xyz>
130 lines
No EOL
3.1 KiB
Bash
Executable file
130 lines
No EOL
3.1 KiB
Bash
Executable file
#!/bin/sh -ex
|
|
|
|
# SPDX-FileCopyrightText: 2025 eden Emulator Project
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
# This script assumes you're in the source directory
|
|
|
|
export APPIMAGE_EXTRACT_AND_RUN=1
|
|
export BASE_ARCH="$(uname -m)"
|
|
export ARCH="$BASE_ARCH"
|
|
|
|
export BUILDDIR="$2"
|
|
|
|
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}"
|
|
|
|
if [ "$ARCH" = 'x86_64' ]; then
|
|
if [ "$1" = 'v3' ]; then
|
|
ARCH="${ARCH}_v3"
|
|
fi
|
|
fi
|
|
|
|
if [ "$BUILDDIR" = '' ]
|
|
then
|
|
BUILDDIR=build
|
|
fi
|
|
|
|
EDEN_TAG=$(git describe --tags --abbrev=0)
|
|
echo "Making stable \"$EDEN_TAG\" build"
|
|
# git checkout "$EDEN_TAG"
|
|
VERSION="$(echo "$EDEN_TAG")"
|
|
|
|
# NOW MAKE APPIMAGE
|
|
mkdir -p ./AppDir
|
|
cd ./AppDir
|
|
|
|
cp ../dist/org.eden_emu.eden.desktop .
|
|
cp ../dist/org.eden_emu.eden.svg .
|
|
|
|
ln -sf ./org.eden_emu.eden.svg ./.DirIcon
|
|
|
|
# TODO(crueter): Nightly
|
|
if [ "$DEVEL" = 'true' ]; then
|
|
sed -i 's|Name=Eden|Name=Eden Nightly|' ./org.eden_emu.eden.desktop
|
|
UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
|
|
fi
|
|
|
|
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
|
|
|
|
LIBDIR="/usr/lib"
|
|
|
|
# Workaround for Gentoo
|
|
if [ ! -d "$LIBDIR/qt6" ]
|
|
then
|
|
LIBDIR="/usr/lib64"
|
|
fi
|
|
|
|
# Workaround for Debian
|
|
if [ ! -d "$LIBDIR/qt6" ]
|
|
then
|
|
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
|
|
fi
|
|
|
|
# Bundle all libs
|
|
|
|
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* \
|
|
$LIBDIR/lib*GL*.so* \
|
|
$LIBDIR/libSDL2*.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/*
|
|
|
|
rm -f ./sharun-aio
|
|
|
|
# Prepare sharun
|
|
if [ "$ARCH" = 'aarch64' ]; then
|
|
# allow the host vulkan to be used for aarch64 given the sad situation
|
|
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
|
|
fi
|
|
|
|
# Workaround for Gentoo
|
|
if [ -d "shared/libproxy" ]; then
|
|
cp shared/libproxy/* lib/
|
|
fi
|
|
|
|
ln -f ./sharun ./AppRun
|
|
./sharun -g
|
|
|
|
# turn appdir into appimage
|
|
cd ..
|
|
wget -q "$URUNTIME" -O ./uruntime
|
|
chmod +x ./uruntime
|
|
|
|
#Add udpate info to runtime
|
|
echo "Adding update information \"$UPINFO\" to runtime..."
|
|
./uruntime --appimage-addupdinfo "$UPINFO"
|
|
|
|
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 \
|
|
--compression zstd:level=22 -S26 -B32 \
|
|
--header uruntime \
|
|
-N 4 \
|
|
-i ./AppDir -o Eden-"$VERSION"-"$ARCH".AppImage
|
|
|
|
echo "Generating zsync file..."
|
|
zsyncmake *.AppImage -u *.AppImage
|
|
echo "All Done!" |