Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from pkgforge-dev:main #14

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/Dolphin_sharun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Sharun CI
on:
# Build at 00:00 on every 12th day-of-month.
schedule:
- cron: "0 0 */6 * *"
- cron: "0 0 */10 * *"
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
Expand All @@ -31,6 +31,7 @@ jobs:
run: |
sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf
pacman -Syu --noconfirm base-devel \
cmake \
strace \
patchelf \
curl \
Expand All @@ -57,12 +58,33 @@ jobs:
pipewire-audio \
qt6ct

- name: Install debloated llvm-libs
run: |
LLVM="$(wget https://api.github.com/repos/Samueru-sama/llvm-libs-debloated/releases -O - \
| sed 's/[()",{} ]/\n/g' | grep -oi "https.*minimal.pkg.tar.zst$" | head -1)"
wget "$LLVM" -O ./llvm-libs.pkg.tar.zst
pacman -U --noconfirm ./llvm-libs.pkg.tar.zst

# Runs a set of commands using the runners shell
- name: Build appimage
- name: Build Dolphin
run: |
git clone https://github.com/dolphin-emu/dolphin.git dolphin
( cd dolphin && mkdir build && cd build
git submodule update --init --recursive
cmake .. -DLINUX_LOCAL_DEV=true
make -j $(nproc)
sudo make install
sudo cp -r ../Data/Sys /usr/local/bin
sudo cp -r ./Source/Core/DolphinQt /usr/local/bin
)

- name: Make AppImage
run: |
chmod +x ./dolphin-emu-appimage.sh
./dolphin-emu-appimage.sh
mkdir dist
echo "$PWD"
ls .
mv *.AppImage* dist/

- name: Check version file
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Github Action with a cronjob trigger
on:
schedule:
- cron: "0 0 * * *"
permissions:
actions: write
jobs:
cronjob-based-github-action:
name: Cronjob based github action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gautamkrishnar/keepalive-workflow@v2
116 changes: 51 additions & 65 deletions dolphin-emu-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ set -eu

export APPIMAGE_EXTRACT_AND_RUN=1
export ARCH="$(uname -m)"
APPIMAGETOOL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage"
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
#DESKTOP="https://raw.githubusercontent.com/dolphin-emu/dolphin/refs/heads/master/Data/dolphin-emu.desktop" @ This is insanely outdated lmao
#DESKTOP="https://raw.githubusercontent.com/dolphin-emu/dolphin/refs/heads/master/Data/dolphin-emu.desktop" # This is insanely outdated lmao
ICON="https://github.com/dolphin-emu/dolphin/blob/master/Data/dolphin-emu.png?raw=true"
UPINFO="gh-releases-zsync|$(echo "$GITHUB_REPOSITORY" | tr '/' '|')|latest|*$ARCH.AppImage.zsync"

export VERSION="$(pacman -Q dolphin-emu | awk 'NR==1 {print $2; exit}' | tr ':' '.')"
echo "$VERSION" > ~/version
URUNTIME=$(wget -q https://api.github.com/repos/VHSgunzo/uruntime/releases -O - \
| sed 's/[()",{} ]/\n/g' | grep -oi "https.*appimage.*dwarfs.*$ARCH$" | head -1)

# Prepare AppDir
mkdir -p ./AppDir && cd ./AppDir
Expand All @@ -34,71 +32,59 @@ wget --retry-connrefused --tries=30 "$ICON" -O ./dolphin-emu.png
# Bundle all libs
wget --retry-connrefused --tries=30 "$LIB4BN" -O ./lib4bin
chmod +x ./lib4bin

xvfb-run -a -- ./lib4bin -p -v -r -e -s -k /usr/bin/dolphin-*
xvfb-run -a -- ./lib4bin -p -v -r -e -s -k \
/usr/local/bin/dolphin-* \
/usr/lib/libGLX* \
/usr/lib/libEGL* \
/usr/lib/dri/* \
/usr/lib/libvulkan* \
/usr/lib/qt6/plugins/iconengines/* \
/usr/lib/qt6/plugins/imageformats/* \
/usr/lib/qt6/plugins/platforms/* \
/usr/lib/qt6/plugins/platformthemes/* \
/usr/lib/qt6/plugins/styles/* \
/usr/lib/qt6/plugins/xcbglintegrations/* \
/usr/lib/qt6/plugins/wayland-*/* \
/usr/lib/pipewire-0.3/* \
/usr/lib/spa-0.2/*/* \
/usr/lib/alsa-lib/*

# copy locales, the dolphin binary expects them here
mkdir -p ./Source/Core
cp -r /usr/local/bin/DolphinQt ./Source/Core
find ./Source/Core/DolphinQt -type f ! -name 'dolphin-emu.mo' -delete

# when compiled portable this directory needs a capital S
# this is not needed since we are not using a binary that was compiled portable
cp -r /usr/share/dolphin-emu/sys ./bin/Sys

# Deploy Qt manually xd
mkdir -p ./shared/lib/qt6/plugins
cp -vr /usr/lib/qt6/plugins/iconengines ./shared/lib/qt6/plugins
cp -vr /usr/lib/qt6/plugins/imageformats ./shared/lib/qt6/plugins
cp -vr /usr/lib/qt6/plugins/platforms ./shared/lib/qt6/plugins
cp -vr /usr/lib/qt6/plugins/platformthemes ./shared/lib/qt6/plugins || true
cp -vr /usr/lib/qt6/plugins/styles ./shared/lib/qt6/plugins
cp -vr /usr/lib/qt6/plugins/xcbglintegrations ./shared/lib/qt6/plugins
cp -vr /usr/lib/qt6/plugins/wayland-* ./shared/lib/qt6/plugins || true
ldd ./shared/lib/qt6/plugins/*/* 2>/dev/null \
| awk -F"[> ]" '{print $4}' | xargs -I {} cp -nv {} ./shared/lib || true

# Bundle pipewire and alsa
cp -vr /usr/lib/pipewire-0.3 ./shared/lib
cp -vr /usr/lib/spa-0.2 ./shared/lib
cp -vr /usr/lib/alsa-lib ./shared/lib

# add gpu libs
cp -vr /usr/lib/libGLX* ./shared/lib || true
cp -vr /usr/lib/libEGL* ./shared/lib || true
cp -vr /usr/lib/dri ./shared/lib
cp -vn /usr/lib/libvulkan* ./shared/lib
ldd ./shared/lib/dri/* \
./shared/lib/libvulkan* \
./shared/lib/libEGL* \
./shared/lib/libGLX* 2>/dev/null \
| awk -F"[> ]" '{print $4}' | xargs -I {} cp -nv {} ./shared/lib || true

# Bunble opengl and vulkan share files
mkdir -p ./share/vulkan
cp -vr /usr/share/glvnd ./share
cp -vr /usr/share/vulkan/icd.d ./share/vulkan
sed -i 's|/usr/lib||g;s|/.*-linux-gnu||g;s|"/|"|g' ./share/vulkan/icd.d/*

# Fix dolphin having a full hardcoded path /usr/share/dolphin-emu/sys
git clone https://github.com/fritzw/ld-preload-open.git preload.tmp
( cd preload.tmp && make all && mv ./path-mapping.so ../ )
rm -rf ./preload.tmp

echo 'PATH_MAPPING="/usr/share/dolphin-emu/sys:${SHARUN_DIR}/bin/Sys:/usr/share/dolphin-emu//../locale:${SHARUN_DIR}/share/locale"
LD_PRELOAD=${SHARUN_DIR}/path-mapping.so' > ./.env

# copy locales, for some reason the dolphin binary tries to look into an invalid /usr/share/dolphin-emu//../locale path
cp -r /usr/share/locale ./share
find ./share/locale -type f ! -name '*dolphin*' -delete
cp -rv /usr/local/bin/Sys ./bin/Sys

# Prepare sharun
ln ./sharun ./AppRun
./sharun -g
cd ..

# Make AppImage with the static appimage runtime (removes libfuse2 dependency).
wget --retry-connrefused --tries=30 "$APPIMAGETOOL" -O ./appimagetool
chmod +x ./appimagetool

./appimagetool -n -u "$UPINFO" AppDir/

echo "$PWD"
ls .
# get version from dolphin
export VERSION="$(xvfb-run -a -- ./AppRun --version 2>/dev/null | awk 'NR==1 {print $2; exit}')"
echo "$VERSION" > ~/version

echo "All done!"
# MAKE APPIMAGE WITH URUNTIME
cd ..
wget -q "$URUNTIME" -O ./uruntime
chmod +x ./uruntime

#Add udpate info to runtime
echo "Adding update information \"$UPINFO\" to runtime..."
printf "$UPINFO" > data.upd_info
llvm-objcopy --update-section=.upd_info=data.upd_info \
--set-section-flags=.upd_info=noload,readonly ./uruntime
printf 'AI\x02' | dd of=./uruntime bs=1 count=3 seek=8 conv=notrunc

echo "Generating AppImage..."
./uruntime --appimage-mkdwarfs -f \
--set-owner 0 --set-group 0 \
--no-history --no-create-timestamp \
--compression zstd:level=22 -S24 -B16 \
--header uruntime \
-i ./AppDir -o Dolphin_Emulator-"$VERSION"-anylinux-"$ARCH".AppImage

echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage
echo "All Done!"