Skip to content
This repository was archived by the owner on Sep 13, 2025. It is now read-only.
Merged
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
87 changes: 87 additions & 0 deletions .ci/linux/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#!/bin/bash -e

# SPDX-FileCopyrightText: 2025 QDash
# SPDX-License-Identifier: GPL-3.0-or-later

export ARCH="$(uname -m)"

case "$1" in
amd64|"")
echo "Making amd64-v3 optimized build of QDash"
ARCH="amd64_v3"
ARCH_FLAGS="-march=x86-64-v3"
export USE_CCACHE=true
;;
steamdeck)
echo "Making Steam Deck (Zen 2) optimized build of QDash"
ARCH="steamdeck"
ARCH_FLAGS="-march=znver2 -mtune=znver2"
export USE_CCACHE=true
;;
rog-ally|allyx)
echo "Making ROG Ally X (Zen 4) optimized build of QDash"
ARCH="rog-ally-x"
ARCH_FLAGS="-march=znver3 -mtune=znver4" # GH actions runner is a Zen 3 CPU, so a small workaround
export USE_CCACHE=true
;;
legacy)
echo "Making amd64 generic build of QDash"
ARCH=amd64
ARCH_FLAGS="-march=x86-64 -mtune=generic"
export USE_CCACHE=true
;;
aarch64)
echo "Making armv8-a build of QDash"
ARCH=aarch64
ARCH_FLAGS="-march=armv8-a -mtune=generic -w"
;;
armv9)
echo "Making armv9-a build of QDash"
ARCH=armv9
ARCH_FLAGS="-march=armv9-a -mtune=generic -w"
;;
esac

export ARCH_FLAGS="$ARCH_FLAGS -O2"

NPROC="$2"
if [ -z "$NPROC" ]; then
NPROC="$(nproc)"
else
shift
fi

[ "$1" != "" ] && shift

export EXTRA_CMAKE_FLAGS=(-DBUILD_SHARED_LIBS=OFF)

if [ "$TARGET" = "appimage" ]; then
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_INSTALL_PREFIX=/usr)
fi

if [ "$USE_CCACHE" = "true" ]; then
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache)
fi

if [ "$BUILD_TYPE" = "" ]; then
export BUILD_TYPE="RelWithDebInfo"
fi

export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)

mkdir -p build
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_CXX_FLAGS="$ARCH_FLAGS" \
-DCMAKE_C_FLAGS="$ARCH_FLAGS" \
"${EXTRA_CMAKE_FLAGS[@]}"

cd build

ninja -j${NPROC}

strip -s src/native/QDash

if [ "$USE_CCACHE" = "true" ]; then
ccache -s
fi
53 changes: 53 additions & 0 deletions .ci/linux/get-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

set -eux

sed -i 's/DownloadUser/#DownloadUser/g' /etc/pacman.conf

if [ "$(uname -m)" = 'x86_64' ]; then
PKG_TYPE='x86_64.pkg.tar.zst'
else
PKG_TYPE='aarch64.pkg.tar.xz'
fi

QT6_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/qt6-base-iculess-$PKG_TYPE"
LIBXML_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/libxml2-iculess-$PKG_TYPE"
OPUS_URL="https://github.com/pkgforge-dev/llvm-libs-debloated/releases/download/continuous/opus-nano-$PKG_TYPE"

echo "Installing build dependencies..."
echo "---------------------------------------------------------------"
pacman -Syu --noconfirm \
base-devel \
ccache \
cmake \
curl \
jq \
ninja \
patchelf \
python-pip \
python-jinja \
qt6-multimedia \
qt6-tools \
qt6-wayland \
strace \
unzip \
wget \
xcb-util-cursor \
xcb-util-image \
xcb-util-renderutil \
xcb-util-wm \
xorg-server-xvfb \
zip \
zsync

echo "Installing debloated pckages..."
echo "---------------------------------------------------------------"
wget --retry-connrefused --tries=30 "$QT6_URL" -O ./qt6-base-iculess.pkg.tar.zst
wget --retry-connrefused --tries=30 "$LIBXML_URL" -O ./libxml2-iculess.pkg.tar.zst
wget --retry-connrefused --tries=30 "$OPUS_URL" -O ./opus-nano.pkg.tar.zst

pacman -U --noconfirm ./*.pkg.tar.zst
rm -f ./*.pkg.tar.zst

echo "All done!"
echo "---------------------------------------------------------------"
139 changes: 139 additions & 0 deletions .ci/linux/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#!/bin/sh -e

# SPDX-FileCopyrightText: 2025 QDash
# 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)"

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

case "$1" in
amd64|"")
echo "Packaging amd64-v3 optimized build of QDash"
ARCH="amd64_v3"
;;
steamdeck)
echo "Packaging Steam Deck (Zen 2) optimized build of QDash"
ARCH="steamdeck"
;;
rog-ally|allyx)
echo "Packaging ROG Ally X (Zen 4) optimized build of QDash"
ARCH="rog-ally-x"
;;
legacy)
echo "Packaging amd64 generic build of QDash"
ARCH=amd64
;;
aarch64)
echo "Packaging armv8-a build of QDash"
ARCH=aarch64
;;
armv9)
echo "Packaging armv9-a build of QDash"
ARCH=armv9
;;
esac

if [ "$BUILDDIR" = '' ]
then
BUILDDIR=build
fi

QDash_TAG=$(git describe --tags --abbrev=0)
echo "Making \"$QDash_TAG\" build"
VERSION="$QDash_TAG"

# NOW MAKE APPIMAGE
mkdir -p ./AppDir
cd ./AppDir

cp ../dist/org.Q-FRC.QDash.desktop .
cp ../dist/org.Q-FRC.QDash.svg .

ln -sf ./org.Q-FRC.QDash.svg ./.DirIcon

UPINFO='gh-releases-zsync|Q-FRC|QDash|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/src/native/QDash \
$LIBDIR/libXss.so* \
$LIBDIR/libdecor-0.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-*/*

rm -f ./sharun-aio

# Copy QML Files
mkdir -p shared/lib/qt6/qml
set +e
cp -r $LIBDIR/qt6/qml/Qt{,Core,Multimedia,Network,Quick} shared/lib/qt6/qml/
set -e

# 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 \
--compression zstd:level=22 -S26 -B32 \
--header uruntime \
-N 4 \
-i ./AppDir -o QDash-"$VERSION"-"$ARCH".AppImage

# --categorize=hotness --hotness-list=.ci/linux/QDash.dwfsprof \
if [ "$DEVEL" != 'true' ]; then
echo "Generating zsync file..."
zsyncmake *.AppImage -u *.AppImage
fi
echo "All Done!"
25 changes: 25 additions & 0 deletions .ci/macos/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -e

# SPDX-FileCopyrightText: 2025 eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later

if [ "$USE_CCACHE" = "true" ]; then
export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" -DUSE_CCACHE=ON)
fi

if [ "$BUILD_TYPE" = "" ]; then
export BUILD_TYPE="RelWithDebInfo"
fi

export EXTRA_CMAKE_FLAGS=("${EXTRA_CMAKE_FLAGS[@]}" $@)

mkdir -p build && cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DBUILD_SHARED_LIBS=OFF \
"${EXTRA_CMAKE_FLAGS[@]}"

ninja

ccache -s
46 changes: 46 additions & 0 deletions .ci/macos/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
set -ex

cd build
rm -rf QDash.app
cp -r src/native/QDash.app .
chmod a+x QDash.app/Contents/MacOS/QDash
mkdir -p QDash.app/Contents/Resources
cp ../dist/QDash.icns QDash.app/Contents/Resources
cp ../dist/App.entitlements QDash.app/Contents/Resources

unset DYLD_LIBRARY_PATH
unset DYLD_FRAMEWORK_PATH

macdeployqt QDash.app \
-qmldir=../src/qml \
-qmlimport=$QML_SOURCES_PATHS \
-verbose=2

macdeployqt QDash.app \
-qmldir=../src/qml \
-qmlimport=$QML_SOURCES_PATHS \
-verbose=2 \
-always-overwrite

APP=QDash.app

# FixMachOLibraryPaths
find "$APP/Contents/Frameworks" ""$APP/Contents/MacOS"" -type f \( -name "*.dylib" -o -perm +111 \) | while read file; do
if file "$file" | grep -q "Mach-O"; then
otool -L "$file" | awk '/@rpath\// {print $1}' | while read lib; do
lib_name="${lib##*/}"
new_path="@executable_path/../Frameworks/$lib_name"
install_name_tool -change "$lib" "$new_path" "$file"
done

if [[ "$file" == *.dylib ]]; then
lib_name="${file##*/}"
new_id="@executable_path/../Frameworks/$lib_name"
install_name_tool -id "$new_id" "$file"
fi
fi
done

# TODO: sign w/ real identity?
codesign --force --deep --entitlements ../dist/App.entitlements -s - QDash.app
tar czf ../QDash.tar.gz QDash.app
Loading
Loading