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

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

137 lines
3.2 KiB
Bash
Raw Normal View History

2025-04-13 19:35:59 -04:00
#!/bin/sh
2025-04-01 18:49:53 +02:00
# SPDX-FileCopyrightText: 2025 eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
# TODO: create a lighter version based on pflyly's script
2025-04-13 19:35:59 -04:00
# This script assumes you're in the source directory
set -ex
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)"
export ARCH="$BASE_ARCH"
2025-04-01 18:49:53 +02:00
export BUILDDIR="$2"
2025-04-13 19:35:59 -04:00
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-$ARCH"
2025-04-01 18:49:53 +02:00
2025-04-13 19:35:59 -04:00
if [ "$ARCH" = 'x86_64' ]; then
if [ "$1" = 'v3' ]; then
ARCH="${ARCH}_v3"
fi
2025-04-01 18:49:53 +02:00
fi
if [ "$BUILDDIR" = '' ]
then
BUILDDIR=build
fi
2025-05-10 11:49:25 -04:00
EDEN_TAG=$(git describe --tags --abbrev=0)
echo "Making stable \"$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
2025-05-11 23:58:25 +00:00
cat > eden.desktop << EOL
2025-04-01 18:49:53 +02:00
[Desktop Entry]
Type=Application
2025-04-13 19:35:59 -04:00
Name=Eden
2025-05-11 23:58:25 +00:00
Icon=eden
StartupWMClass=eden
2025-04-13 19:35:59 -04:00
Exec=eden
2025-04-01 18:49:53 +02:00
Categories=Game;Emulator;
EOL
2025-04-12 23:33:35 -04:00
2025-05-11 23:58:25 +00:00
cp ../dist/eden.svg ./eden.svg
2025-04-12 23:33:35 -04:00
2025-05-11 23:58:25 +00:00
ln -sf ./eden.svg ./.DirIcon
2025-04-12 23:33:35 -04:00
# TODO(crueter): Nightly
# if [ "$DEVEL" = 'true' ]; then
# sed -i 's|Name=Eden|Name=Eden Nightly|' ./eden.desktop
# UPINFO="$(echo "$UPINFO" | sed 's|latest|nightly|')"
# fi
UPINFO='gh-releases-zsync|eden-emulator|Releases|latest|*.AppImage.zsync'
2025-04-12 23:33:35 -04:00
2025-04-20 22:09:44 +00:00
LIBDIR="/usr/lib"
# some distros are weird and use a subdir
if [ ! -f "/usr/lib/libGL.so" ]
then
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
fi
2025-04-13 19:35:59 -04:00
# Bundle all libs
wget --retry-connrefused --tries=30 "$LIB4BN" -O ./lib4bin
chmod +x ./lib4bin
xvfb-run -a -- ./lib4bin -p -v -e -s -k \
../$BUILDDIR/bin/eden* \
2025-04-20 22:09:44 +00:00
$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/*
2025-04-13 19:35:59 -04:00
# Prepare sharun
if [ "$ARCH" = 'aarch64' ]; then
# allow the host vulkan to be used for aarch64 given the sed situation
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
fi
2025-04-12 23:33:35 -04:00
2025-04-13 19:35:59 -04:00
wget https://github.com/VHSgunzo/sharun/releases/download/v0.6.3/sharun-x86_64 -O sharun
chmod a+x sharun
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
echo "All Done!"
2025-04-01 18:49:53 +02:00
2025-04-13 19:35:59 -04:00
# Cleanup
2025-04-01 18:49:53 +02:00
2025-04-13 19:35:59 -04:00
rm -rf AppDir
rm uruntime