From e6179a6897998f9e3f96e92327667432aebb6f58 Mon Sep 17 00:00:00 2001 From: barts Date: Tue, 9 Jan 2024 20:58:48 +0100 Subject: [PATCH] tmp --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 2 +- scripts/install-qt | 31 ++++++++++++++++-------- src/CMakeLists.txt | 8 ++++--- 4 files changed, 72 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d8951da --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + build-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Update apt-get database + run: | + sudo apt-get update -y + sudo apt-get upgrade -y + + - name: Install build dependencies + run: sudo apt-get install -y clang ninja-build git cmake llvm + + - name: Install project dependencies + run: | + sudo apt-get install -y libboost-all-dev libspdlog-dev + sudo apt-get install -y build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libpulse-dev + + - name: Build Qt from source with static linking + env: + CC: gcc + CXX: g++ + CXXFLAGS: -Wall + QT_INSTALLER_JWT_TOKEN: ${{ secrets.QT_INSTALLER_JWT_TOKEN }} + run: | + mkdir /tmp/Qt + ./scripts/install-qt --root /tmp/Qt qt.qt6.661.src + /tmp/Qt/6.6.1/Src/configure -release -static -prefix $PWD/3rdparty/Qt/ -no-pch -no-gstreamer -submodules qtbase,qtmultimedia,qtwayland -- -S . -B ./build -Wdev + cmake --build /tmp/Qt/6.6.1/Src/build + cmake --install /tmp/Qt/6.6.1/Src/build + + - name: Build project + run: | + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF + cmake --build ./build --target package diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7199826..eaa74f0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,7 +32,7 @@ jobs: run: | sudo apt-get install -y libboost-all-dev libspdlog-dev sudo apt-get install -y build-essential openssl libssl-dev libssl1.0 libgl1-mesa-dev libqt5x11extras5 '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libpulse-dev - ./scripts/install-qt + ./scripts/install-qt --root $PWD/3rdparty/Qt qt.qt6.661.gcc_64 qt.qt6.661.addons.qtmultimedia - name: Build project run: | diff --git a/scripts/install-qt b/scripts/install-qt index 55bbd48..4d5aeb3 100755 --- a/scripts/install-qt +++ b/scripts/install-qt @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -usage="Usage: $0 +usage="Usage: $0 Installs Qt 6.6.1 to 3rdparty/Qt. For this script to work, you need to set the QT_INSTALLER_JWT_TOKEN environment variable to your jwt token. Check the @@ -11,21 +11,32 @@ Optionally, you can add more Qt packages to install by adding them as arguments. Options: + -r, --root The root directory to install Qt to. -h, --help Show this help message and exit" -if [[ "$*" == *-h* ]] || [[ "$*" == *--help* ]]; then - echo "$usage" - exit 0 -fi +packages="" +while [[ $# -gt 0 ]]; do + case "$1" in + -r | --root) + install_dir="$2" + shift + shift + ;; + -h | --help) + echo "$usage" + exit 0 + ;; + *) + packages="$packages $1" + shift + ;; + esac +done tmp_dir=$(mktemp -d) -this_dir=$(dirname "$(realpath "${BASH_SOURCE:-$0}")") -install_dir="$this_dir/../3rdparty/Qt" -base="qt.qt6.661.gcc_64" -multimedia="qt.qt6.661.addons.qtmultimedia" curl "https://d13lb3tujbc8s0.cloudfront.net/onlineinstallers/qt-unified-linux-x64-4.6.1-online.run" -o "$tmp_dir/qt-installer.run" chmod +x "$tmp_dir/qt-installer.run" -"$tmp_dir/qt-installer.run" --root "$install_dir" --accept-licenses --accept-obligations --default-answer --confirm-command install $base $multimedia $@ +"$tmp_dir/qt-installer.run" --root "$install_dir" --accept-licenses --accept-obligations --default-answer --confirm-command install $packages rm -rf "$tmp_dir" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04f0445..96621ed 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,7 +27,9 @@ target_link_libraries( Qt6::Widgets Qt6::Multimedia Qt6::MultimediaWidgets - Qt6::QWaylandIntegrationPlugin) + Qt6::QWaylandIntegrationPlugin + Qt6::QWaylandEglPlatformIntegrationPlugin) -qt_import_plugins(snapshotapp INCLUDE_BY_TYPE platforms - Qt6::QWaylandIntegrationPlugin) +qt_import_plugins( + snapshotapp INCLUDE_BY_TYPE platforms Qt6::QWaylandIntegrationPlugin + Qt6::QWaylandEglPlatformIntegrationPlugin)