Skip to content

Commit

Permalink
Bundle all libs, use Artix linux as base (#7)
Browse files Browse the repository at this point in the history
* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Delete libunionpreload.so

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Delete AppRun

* Delete files directory

* explain code

* kek

* use upstream icon and .desktop

* Delete dolphin-emu.desktop since we pull it from upstream

* Update Dolphin_sharun.yml

* make .zsync file

* oops

* no idea what this is xd

* Update Dolphin_sharun.yml

* bundle pipewire

* debian is cursed

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* remove duplicates

* add alsa libs

* add vulkan and opengl loaders

* Update Dolphin_sharun.yml

* mmmmm

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* deploy vulkan

* Update Dolphin_sharun.yml

* weird

* Update Dolphin_sharun.yml

* Add files via upload

* Update Dolphin_sharun.yml

* Update dolphin-emu-appimage.sh

* kek

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update dolphin-emu-appimage.sh

* Update Dolphin_sharun.yml

* Update dolphin-emu-appimage.sh

* Update dolphin-emu-appimage.sh

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update dolphin-emu-appimage.sh

* Update dolphin-emu-appimage.sh

* Update Dolphin_sharun.yml

* Update dolphin-emu-appimage.sh

* Update Dolphin_sharun.yml

* Update Dolphin_sharun.yml

* Update dolphin-emu-appimage.sh
  • Loading branch information
Samueru-sama authored Jan 13, 2025
1 parent b89874e commit 2cbb9da
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 315 deletions.
180 changes: 29 additions & 151 deletions .github/workflows/Dolphin_sharun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,173 +20,51 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build-stable"
build-stable:
# The type of runner that the job will run on
build:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
container: artixlinux/artixlinux:latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Prerequisites
run: |
sudo apt update && sudo apt install -y \
build-essential \
ca-certificates \
ccache \
cmake \
curl \
desktop-file-utils \
dialog \
dpkg \
ffmpeg \
g++ \
g++-11 \
gcc \
gcc-11 \
gettext \
git \
libao-dev \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavformat-dev \
libavutil-dev \
libbluetooth-dev \
libbz2-dev \
libc6-dev \
libc++abi-dev \
libc++-dev \
libcurl4-openssl-dev \
libevdev-dev \
libfmt-dev \
libfuse2 \
libgl1-mesa-dev \
libglu1-mesa-dev \
libgtk2.0-dev \
libhidapi-dev \
liblz4-dev \
liblzma-dev \
liblzo2-dev \
libmbedtls-dev \
libminiupnpc-dev \
libopus-dev \
libpangocairo-1.0-0 \
libpipewire-0.3-0 \
libpipewire-0.3-modules \
libpng-dev \
libpugixml-dev \
libpulse-dev \
libqt6svg6-dev \
libreadline-dev \
libsdl1.2-dev \
libsfml-dev \
libspa-0.2-dev \
libspa-0.2-modules \
libssl-dev \
libstdc++6 \
libswscale-dev \
libsystemd-dev \
libudev-dev
libudev-dev \
libusb-1.0-0-dev \
libwayland-dev \
libxcb-cursor0 \
libxcb-cursor-dev \
libxcb-icccm4 \
libxcb-image0-dev \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxext-dev \
libxi-dev \
libxrandr-dev \
libzip-dev \
libzstd-dev \
make \
mesa-common-dev \
mesa-utils \
mesa-vulkan-drivers \
ninja-build \
p7zip \
p7zip-full \
pipewire-alsa \
pipewire-audio-client-libraries \
pkg-config \
pulseaudio \
qt6-base-private-dev \
qt6ct \
wget \
x11-utils \
xvfb \
zenity \
zlib1g-dev
version=$(apt-cache pkgnames | sed -nr 's/^gcc-(([0-9]+\.?)+)$/\1/p' \
| sort -n | tail -n1)
echo "The latest available GCC version: $version"
sudo apt-get install gcc-$version g++-$version
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$version 60 \
--slave /usr/bin/g++ g++ /usr/bin/g++-$version
sudo apt remove --purge llvm-* clang-* -y
sudo apt autoremove -y
LIB4BN="https://raw.githubusercontent.com/VHSgunzo/sharun/refs/heads/main/lib4bin"
wget -q -c "$LIB4BN" ; chmod a+x lib4bin
wget -q "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage" -O qtplugin ; chmod a+x qtplugin
wget -q "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" -O linuxdeploy ; chmod a+x linuxdeploy
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage" -O appimagetool ; chmod a+x appimagetool
git clone --filter="blob:none" --depth=1 -b master https://github.com/dolphin-emu/dolphin.git dolphin-emu
#export VERSION2=$(git tag | tail -n 1)
mkdir lucas/
mkdir lucas/usr/
mkdir lucas/usr/lib/
mkdir -p lucas2/shared/lib/
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ${{github.workspace}}/lucas2/shared/lib/
cp dolphin-emu.desktop dolphin-emu.png lucas2/
cp ${{github.workspace}}/files/AppRun lucas2/
cd ./dolphin-emu
git submodule update --init --recursive
[ "${COMMIT:=}" ] && git fetch --unshallow --tags && git checkout "$COMMIT"
HEAD="$(git rev-parse --short HEAD)"
DATE="$(git show -s --format=%cd --date=format:%Y.%m.%d)"
VERSION="${DATE}_$HEAD"
#export PATH=$PATH:$( find ${{github.workspace}}/qt/6.7.3/ -type d -printf ":%p" )
#export QMAKE="${{github.workspace}}/qt/6.7.3/gcc_64/bin/"
#export CMAKE_PREFIX_PATH="${{github.workspace}}/qt/6.7.3/gcc_64/"
#export QT_DIR="$QT_DIR:${{github.workspace}}/qt/6.7.3/gcc_64/lib/cmake/Qt6/"
mkdir -p "$HOME/.ccache"
mkdir Build && cd Build
cmake .. -GNinja -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DLINUX_LOCAL_DEV=true -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/lucas/usr/"
ninja install
cd ..
cd ..
sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf
pacman -Syu --noconfirm base-devel \
strace \
patchelf \
curl \
wget \
git \
artix-archlinux-support \
llvm \
mesa \
xorg-server-xvfb \
vulkan-radeon \
vulkan-intel \
vulkan-nouveau
pacman-key --init && pacman-key --populate archlinux
printf "\n[extra]\nInclude = /etc/pacman.d/mirrorlist-arch\n" | tee -a /etc/pacman.conf
pacman -Syu --noconfirm zsync \
dolphin-emu \
pulseaudio \
pulseaudio-alsa \
pipewire-audio \
qt6ct
# Runs a set of commands using the runners shell
- name: Build appimage
run: |
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$( find ${{github.workspace}}/qt/6.7.3/ -type d -printf ":%p" )
#echo $LD_LIBRARY_PATH
export PATH="$PATH:${{github.workspace}}"
cd lucas2/
chmod a+x ./AppRun
xvfb-run -- lib4bin -p -v -r -e -s -k "${{github.workspace}}/lucas/usr/bin/dolphin-emu-nogui" "${{github.workspace}}/lucas/usr/bin/dolphin-tool" "${{github.workspace}}/lucas/usr/bin/dolphin-emu"
./sharun -g
find "${{github.workspace}}/lucas2/shared/lib/home/" -type f | xargs -i -t -exec cp -Lr "${{github.workspace}}/lucas2/shared/lib"
cd ..
find . -iname 'Sys' | xargs -i -t -exec cp -r {} ${GITHUB_WORKSPACE}/lucas2/bin/
find -iname ${GITHUB_WORKSPACE} 'libxcb-cursor**' | xargs -i -t -exec cp -Lr {} ${{github.workspace}}/lucas2/shared/lib/
find ${GITHUB_WORKSPACE} -iname 'libqxcb**' | xargs -i -t -exec cp -Lr {} ${{github.workspace}}/lucas2/shared/lib/
find ${GITHUB_WORKSPACE} -iname 'libQt6XcbQpa.so.6' | xargs -i -t -exec cp -Lr {} ${{github.workspace}}/lucas2/shared/lib/
ARCH=x86_64 VERSION=git ./appimagetool -n lucas2/
chmod +x ./dolphin-emu-appimage.sh
./dolphin-emu-appimage.sh
- name: release
uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
with:
title: Continuous Sharun
automatic_release_tag: continuous-Sharun
prerelease: false
automatic_release_tag: continuous-Sharun-Artixlinux
prerelease: true
draft: false
files: /home/runner/work/Dolphin_emu_Appimage/Dolphin_emu_Appimage/*.AppImage*
repo_token: "${{ secrets.GITHUB_TOKEN }}"
11 changes: 0 additions & 11 deletions AppRun

This file was deleted.

96 changes: 96 additions & 0 deletions dolphin-emu-appimage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#/bin/sh

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
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"

# Prepare AppDir
mkdir -p ./AppDir && cd ./AppDir

echo '[Desktop Entry]
Version=1.0
Icon=dolphin-emu
Exec=dolphin-emu
Terminal=false
Type=Application
Categories=Game;Emulator;
Name=Dolphin Emulator
GenericName=Wii/GameCube Emulator
StartupWMClass=dolphin-emu
Comment=A Wii/GameCube Emulator
X-AppImage-Version=5.0-16793' > ./dolphin-emu.desktop

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-*

# for some reason the dir needs a capital S?
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"
LD_PRELOAD=${SHARUN_DIR}/path-mapping.so' > ./.env

# 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 .

echo "All done!"
11 changes: 0 additions & 11 deletions dolphin-emu.desktop

This file was deleted.

Loading

0 comments on commit 2cbb9da

Please sign in to comment.