Skip to content
This repository was archived by the owner on Sep 13, 2025. It is now read-only.

Commit 6e9f381

Browse files
committed
[ci] refactor: scripting and splitting (#220)
* [ci] refactor: scripting and splitting Signed-off-by: crueter <crueter@eden-emu.dev> * The Great reckoning Signed-off-by: crueter <crueter@eden-emu.dev> * I'm going insane Signed-off-by: crueter <crueter@eden-emu.dev> * install git Signed-off-by: crueter <crueter@eden-emu.dev> * The docker experience (TM) Signed-off-by: crueter <crueter@eden-emu.dev> * The docker experience part 2 Signed-off-by: crueter <crueter@eden-emu.dev> * it's 4:30 am Signed-off-by: crueter <crueter@eden-emu.dev> * askjndfknsdfjkndjkfnsdkjfnsdkjfnsdkjfnk Signed-off-by: crueter <crueter@eden-emu.dev> * soafmdlskdfnmklsdmfklsdnmfjklsdnfknsdfjkndsjkfnsdjknfsdkjfbsjildhbfilusgh 78yaehgoihduifghsdaiguhdiughiudsghisdhfidshgiuh Signed-off-by: crueter <crueter@eden-emu.dev> * FINALLY Signed-off-by: crueter <crueter@eden-emu.dev> * The finale Signed-off-by: crueter <crueter@eden-emu.dev> * Holy MacOS Signed-off-by: swurl <swurl@swurl.xyz> * The rapture is here Signed-off-by: crueter <crueter@eden-emu.dev> --------- Signed-off-by: crueter <crueter@eden-emu.dev> Signed-off-by: swurl <swurl@swurl.xyz>
1 parent 635668e commit 6e9f381

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+759
-417
lines changed

.ci/linux/build.sh

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#!/bin/bash -e
2+
3+
# SPDX-FileCopyrightText: 2025 QDash
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
6+
export ARCH="$(uname -m)"
7+
8+
case "$1" in
9+
amd64|"")
10+
echo "Making amd64-v3 optimized build of QDash"
11+
ARCH="amd64_v3"
12+
ARCH_FLAGS="-march=x86-64-v3"
13+
export USE_CCACHE=true
14+
;;
15+
steamdeck)
16+
echo "Making Steam Deck (Zen 2) optimized build of QDash"
17+
ARCH="steamdeck"
18+
ARCH_FLAGS="-march=znver2 -mtune=znver2"
19+
export USE_CCACHE=true
20+
;;
21+
rog-ally|allyx)
22+
echo "Making ROG Ally X (Zen 4) optimized build of QDash"
23+
ARCH="rog-ally-x"
24+
ARCH_FLAGS="-march=znver3 -mtune=znver4" # GH actions runner is a Zen 3 CPU, so a small workaround
25+
export USE_CCACHE=true
26+
;;
27+
legacy)
28+
echo "Making amd64 generic build of QDash"
29+
ARCH=amd64
30+
ARCH_FLAGS="-march=x86-64 -mtune=generic"
31+
export USE_CCACHE=true
32+
;;
33+
aarch64)
34+
echo "Making armv8-a build of QDash"
35+
ARCH=aarch64
36+
ARCH_FLAGS="-march=armv8-a -mtune=generic -w"
37+
;;
38+
armv9)
39+
echo "Making armv9-a build of QDash"
40+
ARCH=armv9
41+
ARCH_FLAGS="-march=armv9-a -mtune=generic -w"
42+
;;
43+
esac
44+
45+
export ARCH_FLAGS="$ARCH_FLAGS -O2"
46+
47+
NPROC="$2"
48+
if [ -z "$NPROC" ]; then
49+
NPROC="$(nproc)"
50+
else
51+
shift
52+
fi
53+
54+
[ "$1" != "" ] && shift
55+
56+
export EXTRA_CMAKE_FLAGS=(-DBUILD_SHARED_LIBS=OFF)
57+
58+
if [ "$TARGET" = "appimage" ]; then
59+
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_INSTALL_PREFIX=/usr)
60+
fi
61+
62+
if [ "$USE_CCACHE" = "true" ]; then
63+
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache)
64+
fi
65+
66+
if [ "$BUILD_TYPE" = "" ]; then
67+
export BUILD_TYPE="RelWithDebInfo"
68+
fi
69+
70+
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)
71+
72+
mkdir -p build
73+
cmake -S . -B build -G Ninja \
74+
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
75+
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS" \
76+
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
77+
"${EXTRA_CMAKE_FLAGS[@]}"
78+
79+
cd build
80+
81+
ninja -j${NPROC}
82+
83+
strip -s src/native/QDash
84+
85+
if [ "$USE_CCACHE" = "true" ]; then
86+
ccache -s
87+
fi

.ci/linux/get-dependencies.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/sh
2+
3+
set -eux
4+
5+
sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf
6+
7+
if [ "$(uname -m)" = 'x86_64' ]; then
8+
PKG_TYPE='x86_64.pkg.tar.zst'
9+
else
10+
PKG_TYPE='aarch64.pkg.tar.xz'
11+
fi
12+
13+
QT6_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/qt6-base-iculess-$PKG_TYPE"
14+
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-$PKG_TYPE"
15+
OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/opus-nano-$PKG_TYPE"
16+
17+
echo "Installing build dependencies..."
18+
echo "---------------------------------------------------------------"
19+
pacman -Syu --noconfirm \
20+
base-devel \
21+
ccache \
22+
cmake \
23+
curl \
24+
jq \
25+
ninja \
26+
patchelf \
27+
python-pip \
28+
python-jinja \
29+
qt6-multimedia \
30+
qt6-tools \
31+
qt6-wayland \
32+
strace \
33+
unzip \
34+
wget \
35+
xcb-util-cursor \
36+
xcb-util-image \
37+
xcb-util-renderutil \
38+
xcb-util-wm \
39+
xorg-server-xvfb \
40+
zip \
41+
zsync
42+
43+
echo "Installing debloated pckages..."
44+
echo "---------------------------------------------------------------"
45+
wget --retry-connrefused --tries=30 "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst
46+
wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2-iculess.pkg.tar.zst
47+
wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus-nano.pkg.tar.zst
48+
49+
pacman -U --noconfirm ./*.pkg.tar.zst
50+
rm -f ./*.pkg.tar.zst
51+
52+
echo "All done!"
53+
echo "---------------------------------------------------------------"

.ci/linux/package.sh

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#!/bin/sh -e
2+
3+
# SPDX-FileCopyrightText: 2025 QDash
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
6+
# This script assumes you're in the source directory
7+
8+
export APPIMAGE_EXTRACT_AND_RUN=1
9+
export BASE_ARCH="$(uname -m)"
10+
11+
SHARUN="https://github.com/VHSgunzo/sharun/releases/latest/download/sharun-${BASE_ARCH}-aio"
12+
URUNTIME="https://github.com/VHSgunzo/uruntime/releases/latest/download/uruntime-appimage-dwarfs-${BASE_ARCH}"
13+
14+
case "$1" in
15+
amd64|"")
16+
echo "Packaging amd64-v3 optimized build of QDash"
17+
ARCH="amd64_v3"
18+
;;
19+
steamdeck)
20+
echo "Packaging Steam Deck (Zen 2) optimized build of QDash"
21+
ARCH="steamdeck"
22+
;;
23+
rog-ally|allyx)
24+
echo "Packaging ROG Ally X (Zen 4) optimized build of QDash"
25+
ARCH="rog-ally-x"
26+
;;
27+
legacy)
28+
echo "Packaging amd64 generic build of QDash"
29+
ARCH=amd64
30+
;;
31+
aarch64)
32+
echo "Packaging armv8-a build of QDash"
33+
ARCH=aarch64
34+
;;
35+
armv9)
36+
echo "Packaging armv9-a build of QDash"
37+
ARCH=armv9
38+
;;
39+
esac
40+
41+
if [ "$BUILDDIR" = '' ]
42+
then
43+
BUILDDIR=build
44+
fi
45+
46+
QDash_TAG=$(git describe --tags --abbrev=0)
47+
echo "Making \"$QDash_TAG\" build"
48+
VERSION="$QDash_TAG"
49+
50+
# NOW MAKE APPIMAGE
51+
mkdir -p ./AppDir
52+
cd ./AppDir
53+
54+
cp ../dist/org.Q-FRC.QDash.desktop .
55+
cp ../dist/org.Q-FRC.QDash.svg .
56+
57+
ln -sf ./org.Q-FRC.QDash.svg ./.DirIcon
58+
59+
UPINFO='gh-releases-zsync|Q-FRC|QDash|latest|*.AppImage.zsync'
60+
61+
LIBDIR="/usr/lib"
62+
63+
# Workaround for Gentoo
64+
if [ ! -d "$LIBDIR/qt6" ]
65+
then
66+
LIBDIR="/usr/lib64"
67+
fi
68+
69+
# Workaround for Debian
70+
if [ ! -d "$LIBDIR/qt6" ]
71+
then
72+
LIBDIR="/usr/lib/${BASE_ARCH}-linux-gnu"
73+
fi
74+
75+
# Bundle all libs
76+
77+
wget --retry-connrefused --tries=30 "$SHARUN" -O ./sharun-aio
78+
chmod +x ./sharun-aio
79+
xvfb-run -a ./sharun-aio l -p -v -e -s -k \
80+
../$BUILDDIR/src/native/QDash \
81+
$LIBDIR/libXss.so* \
82+
$LIBDIR/libdecor-0.so* \
83+
$LIBDIR/qt6/plugins/audio/* \
84+
$LIBDIR/qt6/plugins/bearer/* \
85+
$LIBDIR/qt6/plugins/imageformats/* \
86+
$LIBDIR/qt6/plugins/iconengines/* \
87+
$LIBDIR/qt6/plugins/platforms/* \
88+
$LIBDIR/qt6/plugins/platformthemes/* \
89+
$LIBDIR/qt6/plugins/platforminputcontexts/* \
90+
$LIBDIR/qt6/plugins/styles/* \
91+
$LIBDIR/qt6/plugins/xcbglintegrations/* \
92+
$LIBDIR/qt6/plugins/wayland-*/*
93+
94+
rm -f ./sharun-aio
95+
96+
# Copy QML Files
97+
mkdir -p shared/lib/qt6/qml
98+
set +e
99+
cp -r $LIBDIR/qt6/qml/Qt{,Core,Multimedia,Network,Quick} shared/lib/qt6/qml/
100+
set -e
101+
102+
# Prepare sharun
103+
if [ "$ARCH" = 'aarch64' ]; then
104+
# allow the host vulkan to be used for aarch64 given the sad situation
105+
echo 'SHARUN_ALLOW_SYS_VKICD=1' > ./.env
106+
fi
107+
108+
# Workaround for Gentoo
109+
if [ -d "shared/libproxy" ]; then
110+
cp shared/libproxy/* lib/
111+
fi
112+
113+
ln -f ./sharun ./AppRun
114+
./sharun -g
115+
116+
# turn appdir into appimage
117+
cd ..
118+
wget -q "$URUNTIME" -O ./uruntime
119+
chmod +x ./uruntime
120+
121+
#Add udpate info to runtime
122+
echo "Adding update information \"$UPINFO\" to runtime..."
123+
./uruntime --appimage-addupdinfo "$UPINFO"
124+
125+
echo "Generating AppImage..."
126+
./uruntime --appimage-mkdwarfs -f \
127+
--set-owner 0 --set-group 0 \
128+
--no-history --no-create-timestamp \
129+
--compression zstd:level=22 -S26 -B32 \
130+
--header uruntime \
131+
-N 4 \
132+
-i ./AppDir -o QDash-"$VERSION"-"$ARCH".AppImage
133+
134+
# --categorize=hotness --hotness-list=.ci/linux/QDash.dwfsprof \
135+
if [ "$DEVEL" != 'true' ]; then
136+
echo "Generating zsync file..."
137+
zsyncmake *.AppImage -u *.AppImage
138+
fi
139+
echo "All Done!"

.ci/macos/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash -e
2+
3+
# SPDX-FileCopyrightText: 2025 eden Emulator Project
4+
# SPDX-License-Identifier: GPL-3.0-or-later
5+
6+
if [ "$USE_CCACHE" = "true" ]; then
7+
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DUSE_CCACHE=ON)
8+
fi
9+
10+
if [ "$BUILD_TYPE" = "" ]; then
11+
export BUILD_TYPE="RelWithDebInfo"
12+
fi
13+
14+
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)
15+
16+
mkdir -p build && cd build
17+
cmake .. -G Ninja \
18+
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
19+
-DCMAKE_OSX_ARCHITECTURES="arm64" \
20+
-DBUILD_SHARED_LIBS=OFF \
21+
"${EXTRA_CMAKE_FLAGS[@]}"
22+
23+
ninja
24+
25+
ccache -s

.ci/macos/package.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
set -ex
2+
3+
cd build
4+
rm -rf QDash.app
5+
cp -r src/native/QDash.app .
6+
chmod a+x QDash.app/Contents/MacOS/QDash
7+
mkdir -p QDash.app/Contents/Resources
8+
cp ../dist/QDash.icns QDash.app/Contents/Resources
9+
cp ../dist/App.entitlements QDash.app/Contents/Resources
10+
11+
unset DYLD_LIBRARY_PATH
12+
unset DYLD_FRAMEWORK_PATH
13+
14+
macdeployqt QDash.app \
15+
-qmldir=../src/qml \
16+
-qmlimport=$QML_SOURCES_PATHS \
17+
-verbose=2
18+
19+
macdeployqt QDash.app \
20+
-qmldir=../src/qml \
21+
-qmlimport=$QML_SOURCES_PATHS \
22+
-verbose=2 \
23+
-always-overwrite
24+
25+
APP=QDash.app
26+
27+
# FixMachOLibraryPaths
28+
find "$APP/Contents/Frameworks" ""$APP/Contents/MacOS"" -type f \( -name "*.dylib" -o -perm +111 \) | while read file; do
29+
if file "$file" | grep -q "Mach-O"; then
30+
otool -L "$file" | awk '/@rpath\// {print $1}' | while read lib; do
31+
lib_name="${lib##*/}"
32+
new_path="@executable_path/../Frameworks/$lib_name"
33+
install_name_tool -change "$lib" "$new_path" "$file"
34+
done
35+
36+
if [[ "$file" == *.dylib ]]; then
37+
lib_name="${file##*/}"
38+
new_id="@executable_path/../Frameworks/$lib_name"
39+
install_name_tool -id "$new_id" "$file"
40+
fi
41+
fi
42+
done
43+
44+
# TODO: sign w/ real identity?
45+
codesign --force --deep --entitlements ../dist/App.entitlements -s - QDash.app
46+
tar czf ../QDash.tar.gz QDash.app

0 commit comments

Comments
 (0)