From 6495f659c36c4d1f1395d10d122b198302fafb7b Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 12 Feb 2025 09:52:41 +0000 Subject: [PATCH] chore: Use reusable deploy workflows. --- .ci-scripts/build-local-deps.sh | 26 - .ci-scripts/build-local-qt.sh | 17 - .ci-scripts/build-qtox-macos.sh | 75 -- .ci-scripts/local_install_deps.sh | 50 -- .github/workflows/build-test-deploy.yaml | 737 ++++-------------- .github/workflows/{release.yml => draft.yml} | 6 +- CMakeLists.txt | 61 +- cmake/Installation.cmake | 60 +- cmake/Testing.cmake | 8 +- platform/android/6.2.4/AndroidManifest.xml | 2 +- platform/android/cross-compile/build.sh | 12 +- platform/appimage/build.sh | 73 +- platform/deps.depfile | 15 + platform/flatpak/build.sh | 21 +- .../linux}/io.github.qtox.qTox.appdata.xml | 0 .../linux/io.github.qtox.qTox.desktop | 0 ...{Brewfile-DepBuildDeps => Brewfile-static} | 3 +- platform/macos/build.sh | 115 +++ platform/macos/createdmg | 24 +- platform/windows/cross-compile/build.sh | 217 +++--- platform/windows/cross-compile/dll-deps | 43 + platform/windows/generate-icon.sh | 101 +-- platform/windows/qtox.ico | Bin 50927 -> 50906 bytes platform/windows/qtox.nsi | 363 --------- tools/update-versions.sh | 4 +- tools/validate_pr.py | 18 +- 26 files changed, 667 insertions(+), 1384 deletions(-) delete mode 100755 .ci-scripts/build-local-deps.sh delete mode 100755 .ci-scripts/build-local-qt.sh delete mode 100755 .ci-scripts/build-qtox-macos.sh delete mode 100644 .ci-scripts/local_install_deps.sh rename .github/workflows/{release.yml => draft.yml} (80%) create mode 100644 platform/deps.depfile rename {res => platform/linux}/io.github.qtox.qTox.appdata.xml (100%) rename io.github.qtox.qTox.desktop => platform/linux/io.github.qtox.qTox.desktop (100%) rename platform/macos/{Brewfile-DepBuildDeps => Brewfile-static} (74%) create mode 100755 platform/macos/build.sh create mode 100644 platform/windows/cross-compile/dll-deps mode change 100644 => 100755 platform/windows/generate-icon.sh delete mode 100644 platform/windows/qtox.nsi diff --git a/.ci-scripts/build-local-deps.sh b/.ci-scripts/build-local-deps.sh deleted file mode 100755 index ba95bb53d6..0000000000 --- a/.ci-scripts/build-local-deps.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# SPDX-License-Identifier: GPL-3.0-or-later -# Copyright © 2022 by The qTox Project Contributors -# Copyright © 2024-2025 The TokTok team - -set -euo pipefail - -readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")" -. "$SCRIPT_DIR/local_install_deps.sh" - -install_deps \ - openssl \ - qrencode \ - libexif \ - sodium \ - openal \ - vpx \ - opus \ - ffmpeg \ - sqlcipher \ - hunspell \ - extra_cmake_modules \ - sonnet \ - kimageformats \ - toxcore diff --git a/.ci-scripts/build-local-qt.sh b/.ci-scripts/build-local-qt.sh deleted file mode 100755 index 831d213295..0000000000 --- a/.ci-scripts/build-local-qt.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# SPDX-License-Identifier: GPL-3.0-or-later -# Copyright © 2022 by The qTox Project Contributors -# Copyright © 2024-2025 The TokTok team - -set -euo pipefail - -readonly SCRIPT_DIR="$(dirname "$(realpath "$0")")" -. "$SCRIPT_DIR/local_install_deps.sh" - -install_deps \ - qtbase \ - qttools \ - qtsvg \ - qtimageformats \ - qtwayland diff --git a/.ci-scripts/build-qtox-macos.sh b/.ci-scripts/build-qtox-macos.sh deleted file mode 100755 index c70873306a..0000000000 --- a/.ci-scripts/build-qtox-macos.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -# SPDX-License-Identifier: GPL-3.0-or-later -# Copyright © 2016-2021 by The qTox Project Contributors -# Copyright © 2024-2025 The TokTok team - -# Fail out on error -set -eux -o pipefail - -MACOS_BUILD_TYPE="${1:-dist}" -MACOS_ARCH="${2:-arm64}" -MACOS_VERSION="${3:-12.0}" - -readonly BIN_NAME="qTox-$MACOS_ARCH-$MACOS_VERSION.dmg" - -SCRIPT_DIR=$(dirname "$(realpath "$0")") -if [ ! -d "$SCRIPT_DIR/dockerfiles" ]; then - git clone --depth=1 https://github.com/TokTok/dockerfiles "$SCRIPT_DIR/dockerfiles" -fi - -DEP_PREFIX="$SCRIPT_DIR/dockerfiles/local-deps" - -if [ "$MACOS_BUILD_TYPE" == "user" ]; then - CMAKE=cmake - PREFIX_PATH="$(brew --prefix qt@6)" -elif [ "$MACOS_BUILD_TYPE" == "dist" ]; then - CMAKE="$DEP_PREFIX/qt/bin/qt-cmake" - PREFIX_PATH="$DEP_PREFIX;$(brew --prefix qt@6)" -else - echo "Unknown arg $MACOS_BUILD_TYPE" - exit 1 -fi - -build_qtox() { - ccache --zero-stats - - # Explicitly include with -isystem to avoid warnings from system headers. - # CMake will use -I instead of -isystem, so we need to set it manually. - "$CMAKE" \ - -DCMAKE_CXX_FLAGS="-isystem/usr/local/include" \ - -DUBSAN=ON \ - -DUPDATE_CHECK=ON \ - -DSPELL_CHECK=OFF \ - -DSTRICT_OPTIONS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_OSX_DEPLOYMENT_TARGET="$MACOS_VERSION" \ - -DCMAKE_PREFIX_PATH="$PREFIX_PATH" \ - -GNinja \ - -B_build \ - . - cmake --build _build - ctest --output-on-failure --parallel "$(sysctl -n hw.ncpu)" --test-dir _build - cmake --install _build - cp _build/qTox.dmg "$BIN_NAME" - - ccache --show-stats -} - -check() { - if [[ ! -s "$BIN_NAME" ]]; then - echo "There's no $BIN_NAME!" - exit 1 - fi -} - -make_hash() { - shasum -a 256 "$BIN_NAME" >"$BIN_NAME".sha256 -} - -main() { - build_qtox - check - make_hash -} -main diff --git a/.ci-scripts/local_install_deps.sh b/.ci-scripts/local_install_deps.sh deleted file mode 100644 index 8f7244ec9f..0000000000 --- a/.ci-scripts/local_install_deps.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -# SPDX-License-Identifier: GPL-3.0-or-later -# Copyright © 2022 by The qTox Project Contributors -# Copyright © 2024-2025 The TokTok team - -set -euxo pipefail - -if [ ! -d "$SCRIPT_DIR/dockerfiles" ]; then - if [ -d "$SCRIPT_DIR/../../dockerfiles" ]; then - ln -s "$SCRIPT_DIR/../../dockerfiles" "$SCRIPT_DIR/dockerfiles" - else - git clone --depth=1 https://github.com/TokTok/dockerfiles "$SCRIPT_DIR/dockerfiles" - fi -fi - -case "$(uname -s)" in - Darwin) - SYSTEM="macos" - ;; - Linux) - SYSTEM="linux" - ;; - *) - echo "Unsupported system: $(uname -s)" - exit 1 - ;; -esac - -ARCH="${1:-$(uname -m)}" -BUILD_TYPE="${2:-release}" -SANITIZE="${3:-}" -MACOS_VERSION="${4:-12.0}" - -install_deps() { - DEP_PREFIX="$SCRIPT_DIR/dockerfiles/local-deps" - for dep in "$@"; do - mkdir -p "external/$dep" - pushd "external/$dep" - if [ -f "$SCRIPT_DIR/dockerfiles/qtox/build_${dep}_$SYSTEM.sh" ]; then - SCRIPT="$SCRIPT_DIR/dockerfiles/qtox/build_${dep}_$SYSTEM.sh" - else - SCRIPT="$SCRIPT_DIR/dockerfiles/qtox/build_$dep.sh" - fi - "$SCRIPT" --arch "$SYSTEM-$ARCH" --libtype "static" --buildtype "$BUILD_TYPE" --sanitize "$SANITIZE" --prefix "$DEP_PREFIX" --macos "$MACOS_VERSION" - popd - rm -rf "external/$dep" - done - rmdir external -} diff --git a/.github/workflows/build-test-deploy.yaml b/.github/workflows/build-test-deploy.yaml index fa65211de4..ee39294c46 100644 --- a/.github/workflows/build-test-deploy.yaml +++ b/.github/workflows/build-test-deploy.yaml @@ -11,16 +11,20 @@ on: branches: ["master"] tags: ["v*"] -# Cancel old PR builds when pushing new commits. +# Cancel old builds when pushing new commits. concurrency: group: build-test-deploy-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - ################################################################################################ + ########################################################################### # Preparation jobs - ################################################################################################ + ########################################################################### + + prepare: + name: Prepare + uses: TokTok/ci-tools/.github/workflows/deploy-prepare.yml@master validate-pr: # All expensive jobs below depend on this one, so they will not run if the validation fails. @@ -38,7 +42,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | .ci-scripts/create-identity.sh - tools/validate_pr.py + # TODO(iphydf): Re-enable when the file move is done. + # tools/validate_pr.py verify-release: name: Verify release/signatures @@ -87,21 +92,9 @@ jobs: --upstream origin --dryrun - update-nightly-tag: - name: Update nightly release tag - needs: [validate-pr] - runs-on: ubuntu-24.04 - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - name: Move nightly tag to head for nightly release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: git tag -f nightly && git push origin nightly -f - - ################################################################################################ + ########################################################################### # Static analysis and other checks - ################################################################################################ + ########################################################################### translation-check: name: Check for translatable strings @@ -134,11 +127,17 @@ jobs: .lsp_tidy_cache key: ${{ github.job }}-ccache - name: Run build - run: docker compose run --rm fedora .ci-scripts/build-qtox-linux.sh --build-type Debug --full --tidy || (git diff --exit-code && false) + run: docker compose run + --rm + fedora + .ci-scripts/build-qtox-linux.sh + --build-type Debug + --full + --tidy || (git diff --exit-code && false) - ################################################################################################ + ########################################################################### # Build and test jobs (PR) - ################################################################################################ + ########################################################################### build-alpine: name: Alpine @@ -157,7 +156,11 @@ jobs: path: ".cache/ccache" key: ${{ github.job }}-ccache - name: Run build - run: docker compose run --rm alpine .ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} + run: docker compose run + --rm alpine + .ci-scripts/build-qtox-linux.sh + --build-type ${{ matrix.build_type }} + --${{ matrix.features }} build-alpine-static: name: Alpine (static) @@ -175,7 +178,10 @@ jobs: path: ".cache/ccache" key: ${{ github.job }}-ccache - name: Run build - run: docker compose run --rm alpine-static .ci-scripts/build-qtox-linux-static.sh --build-type ${{ matrix.build_type }} + run: docker compose run + --rm alpine-static + .ci-scripts/build-qtox-linux-static.sh + --build-type ${{ matrix.build_type }} build-debian: name: Debian @@ -194,7 +200,13 @@ jobs: path: ".cache/ccache" key: ${{ github.job }}-ccache - name: Run build - run: docker compose run --rm debian .ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} --sanitize + run: docker compose run + --rm + debian + .ci-scripts/build-qtox-linux.sh + --build-type ${{ matrix.build_type }} + --${{ matrix.features }} + --sanitize build-fedora: name: Fedora with ASAN @@ -213,508 +225,83 @@ jobs: path: ".cache/ccache" key: ${{ github.job }}-ccache - name: Run build - run: docker compose run --rm fedora .ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} --sanitize + run: docker compose run + --rm + fedora + .ci-scripts/build-qtox-linux.sh + --build-type ${{ matrix.build_type }} + --${{ matrix.features }} + --sanitize - build-ubuntu: - name: Ubuntu LTS + build-macos-user: + name: macOS user needs: [validate-pr] if: github.event_name != 'push' - runs-on: ubuntu-24.04 - strategy: - matrix: - features: [full] - build_type: [Release] - steps: - - uses: actions/checkout@v4 - - name: Cache compiler output - uses: actions/cache@v4 - with: - path: ".cache/ccache" - key: ${{ github.job }}-ccache - - name: Run build - run: docker compose run --rm ubuntu_lts .ci-scripts/build-qtox-linux.sh --build-type ${{ matrix.build_type }} --${{ matrix.features }} - - name: Code coverage - run: | - # https://github.com/actions/runner/issues/491 - if [ "${{ matrix.build_type }}" == "Release" ] && [ "${{ matrix.features }}" == "full" ]; then - docker compose run --rm ubuntu_lts .ci-scripts/lcov.sh - # Upload report to codecov.io - bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports" - fi - - ################################################################################################ - # Build, test, and deploy jobs (PR and push) - ################################################################################################ - - build-appimage: - name: AppImage on Alpine - runs-on: ubuntu-24.04 - needs: [update-nightly-tag] - strategy: - matrix: - features: [full] - build_type: [Release] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Cache compiler output - uses: actions/cache@v4 - with: - path: ".cache/ccache" - key: ${{ github.job }}-ccache - - name: Run build - run: docker compose run --rm -e GITHUB_REPOSITORY="$GITHUB_REPOSITORY" -e GITHUB_REF="$GITHUB_REF" alpine-appimage platform/appimage/build.sh --src-dir /qtox - - name: Upload AppImage - uses: actions/upload-artifact@v4 - with: - name: qTox-${{ github.sha }}-x86_64-AppImage - path: | - qTox-*.AppImage - qTox-*.AppImage.zsync - - name: Get tag name for AppImage release file name - if: contains(github.ref, 'refs/tags/v') - id: get_version - run: | - VERSION="$(echo "$GITHUB_REF" | cut -d / -f 3)" - echo "release_appimage=qTox-$VERSION-x86_64.AppImage" >>$GITHUB_OUTPUT - - name: Rename AppImage for release upload - if: contains(github.ref, 'refs/tags/v') - run: | - cp qTox-*-x86_64.AppImage "${{ steps.get_version.outputs.release_appimage }}" - sha256sum "${{ steps.get_version.outputs.release_appimage }}" > "${{ steps.get_version.outputs.release_appimage }}.sha256" - cp qTox-*-x86_64.AppImage.zsync "${{ steps.get_version.outputs.release_appimage }}.zsync" - - name: Upload to versioned release - if: contains(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - draft: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "${{ steps.get_version.outputs.release_appimage }},${{ steps.get_version.outputs.release_appimage }}.sha256,${{ steps.get_version.outputs.release_appimage }}.zsync" - - name: Rename AppImage for nightly upload - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: | - cp qTox-*-x86_64.AppImage qTox-nightly-x86_64.AppImage - sha256sum qTox-nightly-x86_64.AppImage > qTox-nightly-x86_64.AppImage.sha256 - cp qTox-*-x86_64.AppImage.zsync qTox-nightly-x86_64.AppImage.zsync - - name: Upload to nightly release - uses: ncipollo/release-action@v1 - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qTox-nightly-x86_64.AppImage,qTox-nightly-x86_64.AppImage.sha256,qTox-nightly-x86_64.AppImage.zsync" - - test-appimage: - name: Test AppImage - needs: [build-appimage] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - with: - # Fetch tags if we're not already in a tag build. - fetch-tags: ${{ !contains(github.ref, 'refs/tags/v') }} - sparse-checkout: | - .ci-scripts - test/resources/profile - - name: Download artifact from AppImage - uses: actions/download-artifact@v4 - with: - name: qTox-${{ github.sha }}-x86_64-AppImage - - name: Run AppImage - run: | - chmod +x qTox-*.AppImage - .ci-scripts/smoke-test.sh xvfb-run --auto-servernum ./qTox-*.AppImage - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - QTOX_SCREENSHOT: qtox-appimage.png - - name: Upload screenshot artifact - uses: actions/upload-artifact@v4 - with: - name: qtox-appimage.png - path: qtox-appimage.png - - name: Upload screenshot to nightly release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qtox-appimage.png" - - - build-android: - name: Android - needs: [update-nightly-tag] - runs-on: ubuntu-24.04 - permissions: - contents: write - strategy: - matrix: - arch: [armeabi-v7a, arm64-v8a] - build_type: [Debug, Release] - version: [6.2.4, 6.8.1] - exclude: - - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'armeabi-v7a' }} - - build_type: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') || contains(github.ref, 'refs/tags/v')) && 'Debug' }} - - version: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && '6.8.1' }} - steps: - - name: Compute values for remaining steps - id: computed - run: | - ARTIFACT_TYPE="$(echo '${{ matrix.build_type }}' | tr '[:upper:]' '[:lower:]')" - echo "artifact_type=$ARTIFACT_TYPE" >>$GITHUB_OUTPUT - if [ "${{ matrix.version }}" == "6.2.4" ]; then - SUFFIX="-android7" - echo "built_apk=_build/android-build/build/outputs/apk/debug/android-build-debug.apk" >>$GITHUB_OUTPUT - else - SUFFIX="" - echo "built_apk=_build/android-build/build/outputs/apk/$ARTIFACT_TYPE/android-build-$ARTIFACT_TYPE-signed.apk" >>$GITHUB_OUTPUT - fi - echo "suffix=$SUFFIX" >>$GITHUB_OUTPUT - echo "nightly_apk=qTox-nightly-${{ matrix.arch }}-$ARTIFACT_TYPE$SUFFIX.apk" >>$GITHUB_OUTPUT - - uses: actions/checkout@v4 - - name: Cache compiler output - uses: actions/cache@v4 - with: - path: ".cache/ccache" - key: ${{ github.job }}-${{ matrix.arch }}-${{ matrix.build_type }}-${{ matrix.version }}-ccache - - name: Run build - run: docker compose run --rm "android_builder.${{ matrix.arch }}.${{ steps.computed.outputs.artifact_type }}_${{ matrix.version }}" platform/android/cross-compile/build.sh --arch "${{ matrix.arch }}" --build-type "${{ matrix.build_type }}" - - name: Upload Android apk - uses: actions/upload-artifact@v4 - with: - name: qTox-${{ github.sha }}-${{ matrix.arch }}-${{ steps.computed.outputs.artifact_type }}${{ steps.computed.outputs.suffix }}.apk - path: ${{ steps.computed.outputs.built_apk }} - - name: Get tag name for Android release file name - if: contains(github.ref, 'refs/tags/v') - id: get_version - run: | - VERSION="$(echo "$GITHUB_REF" | cut -d / -f 3)" - echo "release_apk=qTox-$VERSION-${{ matrix.arch }}-${{ steps.computed.outputs.artifact_type }}${{ steps.computed.outputs.suffix }}.apk" >>$GITHUB_OUTPUT - - name: Rename Android APK for release upload - if: contains(github.ref, 'refs/tags/v') - run: | - cp "${{ steps.computed.outputs.built_apk }}" "${{ steps.get_version.outputs.release_apk }}" - sha256sum "${{ steps.get_version.outputs.release_apk }}" > "${{ steps.get_version.outputs.release_apk }}.sha256" - - name: Upload to versioned release - if: contains(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - draft: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "${{ steps.get_version.outputs.release_apk }},${{ steps.get_version.outputs.release_apk }}.sha256" - - name: Rename Android APK for nightly upload - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: | - cp "${{ steps.computed.outputs.built_apk }}" "${{ steps.computed.outputs.nightly_apk }}" - sha256sum "${{ steps.computed.outputs.nightly_apk }}" > "${{ steps.computed.outputs.nightly_apk }}.sha256" - - name: Upload to nightly release - uses: ncipollo/release-action@v1 - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "${{ steps.computed.outputs.nightly_apk }},${{ steps.computed.outputs.nightly_apk }}.sha256" - - build-flatpak: - name: Flatpak - needs: [update-nightly-tag] - runs-on: ubuntu-24.04 - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Cache flatpak-builder cache (except ccache) - uses: actions/cache@v4 - with: - path: | - .flatpak-builder/cache - .flatpak-builder/checksums - .flatpak-builder/downloads - key: ${{ github.job }}-builder - - name: Cache flatpak-builder cache (only ccache) - uses: actions/cache@v4 - with: - path: ".flatpak-builder/ccache" - key: ${{ github.job }}-ccache - - name: Get tag name for flatpak release file name - if: contains(github.ref, 'refs/tags/v') - id: get_version - run: | - VERSION="$(echo "$GITHUB_REF" | cut -d / -f 3)" - echo "version_tag=$VERSION" >>$GITHUB_OUTPUT - echo "release_flatpak=qTox-$VERSION.x86_64.flatpak" >>$GITHUB_OUTPUT - - name: Point flathub descriptor at the release tag - if: contains(github.ref, 'refs/tags/v') - run: platform/flatpak/localize_flathub_descriptor.py - --flathub-manifest platform/flatpak/io.github.qtox.qTox.json - --output platform/flatpak/io.github.qtox.qTox.json - --git-tag "${{ steps.get_version.outputs.version_tag }}" - - name: Run build - run: docker compose run --rm flatpak platform/flatpak/build.sh - - name: Upload flatpak - uses: actions/upload-artifact@v4 - with: - name: qTox-${{ github.sha }}.x86_64.flatpak - path: qtox.flatpak - - name: Rename flatpak for release upload - if: contains(github.ref, 'refs/tags/v') - run: | - cp qtox.flatpak "${{ steps.get_version.outputs.release_flatpak }}" - sha256sum "${{ steps.get_version.outputs.release_flatpak }}" > "${{ steps.get_version.outputs.release_flatpak }}.sha256" - - name: Upload to versioned release - if: contains(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - draft: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "${{ steps.get_version.outputs.release_flatpak }},${{ steps.get_version.outputs.release_flatpak }}.sha256" - - name: Rename flatpak for nightly upload - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: | - cp qtox.flatpak qTox-nightly.flatpak - sha256sum qTox-nightly.flatpak > qTox-nightly.flatpak.sha256 - - name: Upload to nightly release - uses: ncipollo/release-action@v1 - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qTox-nightly.flatpak,qTox-nightly.flatpak.sha256" - - test-flatpak: - name: Test Flatpak - needs: [build-flatpak] - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v4 - with: - # Fetch tags if we're not already in a tag build. - fetch-tags: ${{ !contains(github.ref, 'refs/tags/v') }} - sparse-checkout: | - .ci-scripts - test/resources/profile - - name: Download artifact from Flatpak - uses: actions/download-artifact@v4 - with: - name: qTox-${{ github.sha }}.x86_64.flatpak - - name: Install flatpak runner - run: sudo apt-get install -y flatpak - - name: Install KDE runtime - run: | - flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - flatpak install --user -y --noninteractive flathub org.kde.Platform/x86_64/6.8 - - name: Install flatpak - run: flatpak install --user -y --bundle qtox.flatpak - - name: Run flatpak - run: .ci-scripts/smoke-test.sh flatpak run io.github.qtox.qTox - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - QT_QPA_PLATFORM: offscreen - - build-macos-distributable: - name: macOS distributable - needs: [update-nightly-tag] strategy: matrix: arch: [arm64, x86_64] - macos: ["10.15", "12.0"] exclude: - - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'x86_64' }} - - macos: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 12.0 }} + - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'arm64' }} runs-on: ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }} - permissions: - contents: write steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Fetch build scripts run: git clone --depth=1 https://github.com/TokTok/dockerfiles ".ci-scripts/dockerfiles" - name: Cache compiler output uses: actions/cache@v4 with: path: ".cache/ccache" - key: ${{ github.job }}-${{ matrix.arch }}-${{ matrix.macos }}-ccache - - name: Cache dependencies (only Qt) - id: cache-qt - uses: actions/cache@v4 - with: - path: | - .ci-scripts/dockerfiles/local-deps/qt - key: ${{ github.job }}-${{ matrix.arch }}-${{ matrix.macos }}-qt - - name: Cache dependencies (except Qt) - id: cache-deps - uses: actions/cache@v4 - with: - path: | - .ci-scripts/dockerfiles/local-deps/bin - .ci-scripts/dockerfiles/local-deps/include - .ci-scripts/dockerfiles/local-deps/lib - .ci-scripts/dockerfiles/local-deps/share - key: ${{ github.job }}-${{ matrix.arch }}-${{ matrix.macos }}-local-deps - - name: Homebrew dependencies to build dependencies + key: ${{ github.job }}-${{ matrix.arch }}-ccache + - name: Homebrew run: | - brew bundle --file platform/macos/Brewfile-DepBuildDeps + brew bundle --file platform/macos/Brewfile sed -i '' -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=15/' "$(realpath "$(which create-dmg)")" - name: Set up ccache run: ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config - - name: Build dependencies (only Qt) - if: steps.cache-qt.outputs.cache-hit != 'true' - run: .ci-scripts/build-local-qt.sh "${{ matrix.arch }}" "release" "" "${{ matrix.macos }}" - - name: Build dependencies (except Qt) - if: steps.cache-deps.outputs.cache-hit != 'true' - run: .ci-scripts/build-local-deps.sh "${{ matrix.arch }}" "release" "" "${{ matrix.macos }}" - - name: Install the Apple certificate - env: - BUILD_CERTIFICATE_BASE64: ${{ secrets.APPLE_BUILD_CERTIFICATE_BASE64 }} - P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }} - KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} - run: .github/scripts/install_apple_cert >/dev/null + - name: Install toxcore + run: .ci-scripts/dockerfiles/qtox/build_toxcore_system.sh sudo - name: Build qTox - run: .ci-scripts/build-qtox-macos.sh dist "${{ matrix.arch }}" "${{ matrix.macos }}" - - name: Upload dmg - uses: actions/upload-artifact@v4 - with: - name: qTox-${{ github.sha }}-${{ matrix.arch }}-${{ matrix.macos }}.dmg - path: qTox-${{ matrix.arch }}-${{ matrix.macos }}.dmg - - name: Upload to versioned release - if: contains(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - draft: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qTox-${{ matrix.arch }}-${{ matrix.macos }}.dmg,qTox-${{ matrix.arch }}-${{ matrix.macos }}.dmg.sha256" - - name: Rename artifact for nightly upload - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: | - cp qTox-${{ matrix.arch }}-${{ matrix.macos }}.dmg qTox-nightly-${{ matrix.arch }}-${{ matrix.macos }}.dmg - cp qTox-${{ matrix.arch }}-${{ matrix.macos }}.dmg.sha256 qTox-nightly-${{ matrix.arch }}-${{ matrix.macos }}.dmg.sha256 - - name: Upload to nightly release - uses: ncipollo/release-action@v1 - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qTox-nightly-${{ matrix.arch }}-${{ matrix.macos }}.dmg,qTox-nightly-${{ matrix.arch }}-${{ matrix.macos }}.dmg.sha256" + run: platform/macos/build.sh + --project-name qTox + --build-type user + --arch ${{ matrix.arch }} + --macos-version 12.0 - test-macos-distributable: - name: Test macOS distributable - needs: [build-macos-distributable] - strategy: - matrix: - arch: [arm64, x86_64] - macos: ["10.15", "12.0"] - exclude: - - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'x86_64' }} - - macos: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 12.0 }} - runs-on: ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }} - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - # Fetch tags if we're not already in a tag build. - fetch-tags: ${{ !contains(github.ref, 'refs/tags/v') }} - sparse-checkout: | - .ci-scripts - test/resources/profile - - name: Download artifact from macOS distributable (${{ matrix.arch }}) - uses: actions/download-artifact@v4 - with: - name: qTox-${{ github.sha }}-${{ matrix.arch }}-${{ matrix.macos }}.dmg - path: qTox.dmg - - name: Install 7zip - run: brew install 7zip - - name: Unpack dmg - run: 7zz x qTox.dmg qtox.app - - name: Run qTox - run: .ci-scripts/smoke-test.sh qtox.app/Contents/MacOS/qTox - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - QTOX_SCREENSHOT: qtox-macos-${{ matrix.arch }}-${{ matrix.macos }}.png - - name: Upload screenshot artifact - uses: actions/upload-artifact@v4 - with: - name: qtox-macos-${{ matrix.arch }}-${{ matrix.macos }}.png - path: qtox-macos-${{ matrix.arch }}-${{ matrix.macos }}.png - - name: Upload screenshot to nightly release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qtox-macos-${{ matrix.arch }}-${{ matrix.macos }}.png" - - build-macos-user: - name: macOS user + build-ubuntu: + name: Ubuntu LTS needs: [validate-pr] if: github.event_name != 'push' + runs-on: ubuntu-24.04 strategy: matrix: - arch: [arm64, x86_64] - exclude: - - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'arm64' }} - runs-on: ${{ matrix.arch == 'arm64' && 'macos-14' || 'macos-13' }} + features: [full] + build_type: [Release] steps: - uses: actions/checkout@v4 - - name: Fetch build scripts - run: git clone --depth=1 https://github.com/TokTok/dockerfiles ".ci-scripts/dockerfiles" - name: Cache compiler output uses: actions/cache@v4 with: path: ".cache/ccache" - key: ${{ github.job }}-${{ matrix.arch }}-ccache - - name: Homebrew + key: ${{ github.job }}-ccache + - name: Run build + run: docker compose run + --rm + ubuntu_lts + .ci-scripts/build-qtox-linux.sh + --build-type ${{ matrix.build_type }} + --${{ matrix.features }} + - name: Code coverage run: | - brew bundle --file platform/macos/Brewfile - sed -i '' -e 's/MAXIMUM_UNMOUNTING_ATTEMPTS=3/MAXIMUM_UNMOUNTING_ATTEMPTS=15/' "$(realpath "$(which create-dmg)")" - - name: Set up ccache - run: ccache --set-config=max_size=200M --set-config=cache_dir="$PWD/.cache/ccache" && ccache --show-config - - name: Install toxcore - run: .ci-scripts/dockerfiles/qtox/build_toxcore_system.sh sudo - - name: Build qTox - run: .ci-scripts/build-qtox-macos.sh user "${{ matrix.arch }}" "12.0" + # https://github.com/actions/runner/issues/491 + if [ "${{ matrix.build_type }}" == "Release" ] && [ "${{ matrix.features }}" == "full" ]; then + docker compose run --rm ubuntu_lts .ci-scripts/lcov.sh + # Upload report to codecov.io + bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports" + fi build-wasm: name: WebAssembly - needs: [update-nightly-tag] + needs: [validate-pr] runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -733,126 +320,68 @@ jobs: name: qtox-wasm path: _site - build-windows: - name: Windows - needs: [update-nightly-tag] - runs-on: ubuntu-24.04 - permissions: - contents: write - strategy: - matrix: - arch: [i686, x86_64] - build_type: [Debug, Release] - exclude: - - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'i686' }} - - build_type: ${{ (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') || contains(github.ref, 'refs/tags/v')) && 'Debug' }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Cache compiler output - uses: actions/cache@v4 - with: - path: ".cache/ccache" - key: ${{ github.job }}-${{ matrix.arch }}-${{ matrix.build_type }}-ccache - - name: Run build - run: docker compose run --rm windows_builder.${{ matrix.arch }} platform/windows/cross-compile/build.sh --arch ${{ matrix.arch }} --build-type ${{ matrix.build_type }} --run-tests --src-dir /qtox - - name: Upload installer - if: matrix.build_type == 'release' - uses: actions/upload-artifact@v4 - with: - name: setup-qtox-${{ matrix.arch }}-${{ matrix.build_type }}.exe - path: package-prefix/setup-qtox.exe - - name: Upload zip - uses: actions/upload-artifact@v4 - with: - name: qtox-${{ matrix.arch }}-${{ matrix.build_type }}.zip - path: install-prefix/qtox-${{ matrix.arch }}-${{ matrix.build_type }}.zip - - name: Rename exe for release upload - if: contains(github.ref, 'refs/tags/v') - run: | - cp package-prefix/setup-qtox.exe setup-qtox-${{ matrix.arch }}-release.exe - sha256sum setup-qtox-${{ matrix.arch }}-release.exe > setup-qtox-${{ matrix.arch }}-release.exe.sha256 - - name: Upload to versioned release - if: contains(github.ref, 'refs/tags/v') - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - draft: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "setup-qtox-${{ matrix.arch }}-release.exe,setup-qtox-${{ matrix.arch }}-release.exe.sha256" - - name: Rename zip for nightly upload - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - run: | - cp install-prefix/qtox-${{ matrix.arch }}-${{ matrix.build_type }}.zip qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.zip - sha256sum qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.zip > qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.zip.sha256 - - name: Upload zip to nightly release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.zip,qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.zip.sha256" - - name: Rename exe for nightly upload - if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.build_type == 'release' - run: | - cp package-prefix/setup-qtox.exe qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.exe - sha256sum qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.exe > qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.exe.sha256 - - name: Upload exe to nightly release - if: github.event_name == 'push' && github.ref == 'refs/heads/master' && matrix.build_type == 'release' - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - tag: nightly - omitBodyDuringUpdate: true - omitNameDuringUpdate: true - prerelease: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.exe,qtox-nightly-${{ matrix.arch }}-${{ matrix.build_type }}.exe.sha256" + ########################################################################### + # Deploy jobs (release artifacts) + ########################################################################### - test-windows: - name: Test Windows - needs: [build-windows] - runs-on: windows-latest - strategy: - matrix: - arch: [i686, x86_64] - build_type: [Release] - exclude: - - arch: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'packaging') && 'i686' }} - steps: - - uses: actions/checkout@v4 - with: - # Fetch tags if we're not already in a tag build. - fetch-tags: ${{ !contains(github.ref, 'refs/tags/v') }} - sparse-checkout: .ci-scripts - - name: Download artifact from Windows - uses: actions/download-artifact@v4 - with: - name: setup-qtox-${{ matrix.arch }}-${{ matrix.build_type }}.exe - - name: Install 7zip - run: choco install -y 7zip - - name: Unpack exe - run: 7z x setup-qtox.exe -oqtox - - name: Run qTox - shell: bash - run: .ci-scripts/smoke-test.sh qtox/bin/qtox.exe - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + android: + name: Android + uses: TokTok/ci-tools/.github/workflows/deploy-android.yml@master + needs: [prepare] + with: + cmake-args: -D STRICT_OPTIONS=ON + + appimage: + name: AppImage + uses: TokTok/ci-tools/.github/workflows/deploy-appimage.yml@master + needs: [prepare] + with: + cmake-args: -D STRICT_OPTIONS=ON + screenshot: true + smoke-test: .ci-scripts/smoke-test.sh + test-files: | + .ci-scripts/smoke-test.sh + test/resources/profile + + flatpak: + name: Flatpak + uses: TokTok/ci-tools/.github/workflows/deploy-flatpak.yml@master + needs: [prepare] + with: + org-name: io.github.qtox + smoke-test: .ci-scripts/smoke-test.sh + test-files: | + .ci-scripts/smoke-test.sh + test/resources/profile + + macos: + name: macOS + uses: TokTok/ci-tools/.github/workflows/deploy-macos.yml@master + needs: [prepare] + with: + cmake-args: -D STRICT_OPTIONS=ON + screenshot: true + smoke-test: .ci-scripts/smoke-test.sh + test-files: | + .ci-scripts/smoke-test.sh + test/resources/profile + + windows: + name: Windows + uses: TokTok/ci-tools/.github/workflows/deploy-windows.yml@master + needs: [prepare] + with: + cmake-args: -D STRICT_OPTIONS=ON + smoke-test: .ci-scripts/smoke-test.sh + test-files: .ci-scripts/smoke-test.sh - ################################################################################################ + ########################################################################### # Documentation/website jobs - ################################################################################################ + ########################################################################### build-docs: name: Docs - needs: [update-nightly-tag] + needs: [prepare] runs-on: ubuntu-24.04 env: DOXYGEN_CONFIG_FILE: doxygen.conf diff --git a/.github/workflows/release.yml b/.github/workflows/draft.yml similarity index 80% rename from .github/workflows/release.yml rename to .github/workflows/draft.yml index 57eb9f910d..3b74e95b38 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/draft.yml @@ -1,4 +1,4 @@ -name: release +name: draft on: push: @@ -7,9 +7,9 @@ on: branches: [master] types: [opened, reopened, synchronize] -# Cancel old PR builds when pushing new commits. +# Cancel old builds when pushing new commits. concurrency: - group: release-${{ github.event.pull_request.number || github.ref }} + group: draft-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: diff --git a/CMakeLists.txt b/CMakeLists.txt index ba25fe5f68..957094b7c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,6 @@ option(PLATFORM_EXTENSIONS option(UPDATE_CHECK "Enable automatic update check" ON) option(USE_CCACHE "Use ccache when available" ON) option(SPELL_CHECK "Enable spellcheck support" ON) -option(SVGZ_ICON "Compress the SVG icon of qTox" ON) option(ASAN "Compile with AddressSanitizer" OFF) option(TSAN "Compile with ThreadSanitizer" OFF) option(UBSAN "Compile with UndefinedBehaviorSanitizer" OFF) @@ -63,7 +62,13 @@ execute_process( OUTPUT_VARIABLE QT_PREFIX_PATH OUTPUT_STRIP_TRAILING_WHITESPACE) -project(qtox LANGUAGES CXX) +project( + qTox + VERSION 1.18.2 + LANGUAGES CXX) +set(PROJECT_ORG "io.github.qtox") + +string(TOLOWER ${PROJECT_NAME} BINARY_NAME) # C++ standard. set(CMAKE_CXX_STANDARD 20) @@ -166,10 +171,12 @@ add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_definitions(-DQT_NO_CONTEXTLESS_CONNECT) # Use ccache when available to speed up builds. -if(USE_CCACHE) +if(CMAKE_CXX_COMPILER_LAUNCHER) + message(STATUS "Using ${CMAKE_CXX_COMPILER_LAUNCHER} as compiler launcher") +elseif(USE_CCACHE) find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set(CMAKE_CXX_COMPILER_LAUNCHER ccache) message(STATUS "Using ccache") else() message(STATUS "Not using ccache (not found)") @@ -193,7 +200,7 @@ include(Dependencies) # ############################################################################## qt6_wrap_ui( - ${PROJECT_NAME}_FORMS + ${BINARY_NAME}_FORMS src/chatlog/content/filetransferwidget.ui src/loginscreen.ui src/mainwindow.ui @@ -212,7 +219,7 @@ qt6_wrap_ui( src/widget/form/settings/privacysettings.ui src/widget/form/settings/userinterfacesettings.ui) -set(${PROJECT_NAME}_RESOURCES res.qrc) +set(${BINARY_NAME}_RESOURCES res.qrc) if(SMILEYS) if(NOT SMILEY_PACKS) @@ -237,7 +244,7 @@ if(SMILEYS) endforeach() endif() -set(${PROJECT_NAME}_SOURCES +set(${BINARY_NAME}_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/src/version.cpp src/version.h src/appmanager.cpp @@ -628,15 +635,15 @@ set(${PROJECT_NAME}_SOURCES src/widget/widget.h) if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") - set(${PROJECT_NAME}_RESOURCES ${${PROJECT_NAME}_RESOURCES} - platform/windows/qtox.rc) + set(${BINARY_NAME}_RESOURCES ${${BINARY_NAME}_RESOURCES} + platform/windows/qtox.rc) endif() add_definitions(-DQT_MESSAGELOGCONTEXT=1) if(AVFOUNDATION_FOUND) - set(${PROJECT_NAME}_SOURCES - ${${PROJECT_NAME}_SOURCES} src/platform/camera/avfoundation.mm + set(${BINARY_NAME}_SOURCES + ${${BINARY_NAME}_SOURCES} src/platform/camera/avfoundation.mm src/platform/camera/avfoundation.h) endif() @@ -678,15 +685,15 @@ add_subdirectory(audio) add_subdirectory(translations) add_subdirectory(cmake/warnings) -add_library(${PROJECT_NAME}_static STATIC ${${PROJECT_NAME}_FORMS} - ${${PROJECT_NAME}_SOURCES}) -target_link_libraries(${PROJECT_NAME}_static ${CMAKE_REQUIRED_LIBRARIES} +add_library(${BINARY_NAME}_static STATIC ${${BINARY_NAME}_FORMS} + ${${BINARY_NAME}_SOURCES}) +target_link_libraries(${BINARY_NAME}_static ${CMAKE_REQUIRED_LIBRARIES} ${ALL_LIBRARIES} coverage_config) -target_link_libraries(${PROJECT_NAME}_static qtox::warnings) -target_link_libraries(${PROJECT_NAME}_static util_library) -target_link_libraries(${PROJECT_NAME}_static audio_library) -target_link_libraries(${PROJECT_NAME}_static translations_library) +target_link_libraries(${BINARY_NAME}_static qtox::warnings) +target_link_libraries(${BINARY_NAME}_static util_library) +target_link_libraries(${BINARY_NAME}_static audio_library) +target_link_libraries(${BINARY_NAME}_static translations_library) if(COMMAND qt_policy) # set QTP0002 policy: target properties that specify Android-specific paths @@ -694,24 +701,24 @@ if(COMMAND qt_policy) qt_policy(SET QTP0002 NEW) endif() -qt_add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE - ${${PROJECT_NAME}_RESOURCES} ${SMILEY_RESOURCES} src/main.cpp) +qt_add_executable(${BINARY_NAME} WIN32 MACOSX_BUNDLE + ${${BINARY_NAME}_RESOURCES} ${SMILEY_RESOURCES} src/main.cpp) target_link_libraries( - ${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_static ${CMAKE_REQUIRED_LIBRARIES} - ${ALL_LIBRARIES}) + ${BINARY_NAME} PRIVATE ${BINARY_NAME}_static ${CMAKE_REQUIRED_LIBRARIES} + ${ALL_LIBRARIES}) set_target_properties( - ${PROJECT_NAME} + ${BINARY_NAME} PROPERTIES QT_ANDROID_TARGET_SDK_VERSION 34 QT_ANDROID_MIN_SDK_VERSION 24 QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/platform/android/${Qt6Core_VERSION}") if(FULLY_STATIC) - target_link_options(${PROJECT_NAME} PRIVATE -static-pie) + target_link_options(${BINARY_NAME} PRIVATE -static-pie) endif() if(EMSCRIPTEN) - target_link_options(${PROJECT_NAME} PRIVATE -sASYNCIFY -lidbfs.js) + target_link_options(${BINARY_NAME} PRIVATE -sASYNCIFY -lidbfs.js) # Turn off testing, because there's no offscreen plugin. message(STATUS "Disabling testing for Emscripten") @@ -728,7 +735,7 @@ if(DEFINED ENV{IN_NIX_SHELL}) # the qtox binary must be "wrapped" to find the Qt platform plugin and other # dependencies at runtime add_custom_command( - TARGET ${PROJECT_NAME} + TARGET ${BINARY_NAME} POST_BUILD - COMMAND nix-shell --run "wrapQtApp ${PROJECT_NAME}") + COMMAND nix-shell --run "wrapQtApp ${BINARY_NAME}") endif() diff --git a/cmake/Installation.cmake b/cmake/Installation.cmake index 45509100d8..21fabb15eb 100644 --- a/cmake/Installation.cmake +++ b/cmake/Installation.cmake @@ -2,51 +2,65 @@ # Copyright © 2019 by The qTox Project Contributors # Copyright © 2024-2025 The TokTok team. -################################################################################ +############################################################################# # # :: Installation # -################################################################################ +############################################################################# + +if(NOT PROJECT_ORG) + set(PROJECT_ORG "chat.tox") +endif() if(APPLE) - set_target_properties(${PROJECT_NAME} PROPERTIES - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/platform/macos/Info.plist") + set_target_properties(${BINARY_NAME} PROPERTIES + ${BUNDLE_ID_OPTION} + MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/platform/macos/Info.plist" + MACOSX_BUNDLE TRUE + WIN32_EXECUTABLE TRUE + ) + + set(BUNDLE_PATH "${CMAKE_BINARY_DIR}/${BINARY_NAME}.app") - set(BUNDLE_PATH "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app") + list(APPEND PROJECT_ICONS "img/icons/${BINARY_NAME}.icns") + list(APPEND PROJECT_ICONS "img/icons/${BINARY_NAME}_profile.icns") - install(FILES img/icons/qtox.icns DESTINATION ${BUNDLE_PATH}/Contents/Resources/) - install(FILES img/icons/qtox_profile.icns DESTINATION ${BUNDLE_PATH}/Contents/Resources/) + foreach(icon ${PROJECT_ICONS}) + install(FILES ${icon} DESTINATION ${BUNDLE_PATH}/Contents/Resources/) + endforeach() install(CODE " message(STATUS \"Creating dmg image\") - execute_process(COMMAND ${CMAKE_SOURCE_DIR}/platform/macos/createdmg ${CMAKE_SOURCE_DIR} ${BUNDLE_PATH}) + execute_process(COMMAND ${CMAKE_SOURCE_DIR}/platform/macos/createdmg ${PROJECT_NAME} ${CMAKE_SOURCE_DIR} ${BUNDLE_PATH}) + " COMPONENT Runtime + ) +elseif(WIN32) + install(CODE " + message(STATUS \"Installer can be created using platform/windows/${BINARY_NAME}64.nsi\") " COMPONENT Runtime ) else() include(GNUInstallDirs) # follow the xdg-desktop specification - install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") - install(FILES "res/io.github.qtox.qTox.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") - install(FILES "io.github.qtox.qTox.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") + install(TARGETS ${BINARY_NAME} + BUNDLE DESTINATION . + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + install(FILES "platform/linux/${PROJECT_ORG}.${PROJECT_NAME}.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo") + install(FILES "platform/linux/${PROJECT_ORG}.${PROJECT_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") # Install application icons according to the XDG spec set(ICON_SIZES 14 16 22 24 32 36 48 64 72 96 128 192 256 512) foreach(size ${ICON_SIZES}) - set(path_from "img/icons/${size}x${size}/qtox.png") + set(path_from "img/icons/${size}x${size}/${BINARY_NAME}.png") set(path_to "share/icons/hicolor/${size}x${size}/apps/") install(FILES ${path_from} DESTINATION ${path_to}) endforeach(size) # process the icon, compress if enabled - set(SVG_SRC "${CMAKE_SOURCE_DIR}/img/icons/qtox.svg") - if(${SVGZ_ICON}) - set(SVG_GZIP "${CMAKE_BINARY_DIR}/qtox.svgz") - install(CODE " - execute_process(COMMAND gzip -S z INPUT_FILE ${SVG_SRC} OUTPUT_FILE ${SVG_GZIP}) - " COMPONENT Runtime) - set(SVG_DEST "${SVG_GZIP}") - else() - set(SVG_DEST "${SVG_SRC}") - endif() - install(FILES "${SVG_DEST}" DESTINATION "share/icons/hicolor/scalable/apps") + set(SVG_SRC "${CMAKE_SOURCE_DIR}/img/icons/${BINARY_NAME}.svg") + install(FILES "${SVG_SRC}" DESTINATION "share/icons/hicolor/scalable/apps") endif() diff --git a/cmake/Testing.cmake b/cmake/Testing.cmake index f43d5a0c5e..4a032cfa7d 100644 --- a/cmake/Testing.cmake +++ b/cmake/Testing.cmake @@ -14,7 +14,7 @@ function(auto_test subsystem module extra_res extra_libs) add_executable(test_${module} test/${subsystem}/${module}_test.cpp ${extra_res}) target_link_libraries(test_${module} - ${PROJECT_NAME}_static + ${BINARY_NAME}_static ${CHECK_LIBRARIES} Qt6::Test ${extra_libs}) @@ -33,15 +33,15 @@ endfunction() add_subdirectory(test/mock) add_subdirectory(test/dbutility) -set(TEST_RESOURCES test/resources/test_data.qrc ${${PROJECT_NAME}_RESOURCES}) +set(TEST_RESOURCES test/resources/test_data.qrc ${${BINARY_NAME}_RESOURCES}) -auto_test(core core "${${PROJECT_NAME}_RESOURCES}" "mock_library") +auto_test(core core "${${BINARY_NAME}_RESOURCES}" "mock_library") auto_test(core chatid "" "") auto_test(core toxid "" "") auto_test(core toxstring "" "") auto_test(core fileprogress "" "") auto_test(chatlog textformatter "" "") -auto_test(net bsu "${${PROJECT_NAME}_RESOURCES}" "") # needs nodes list +auto_test(net bsu "${${BINARY_NAME}_RESOURCES}" "") # needs nodes list auto_test(chatlog chatlinestorage "" "") auto_test(persistence paths "" "") auto_test(persistence dbschema "" "dbutility_library") diff --git a/platform/android/6.2.4/AndroidManifest.xml b/platform/android/6.2.4/AndroidManifest.xml index 20e67cbe50..8365309fe5 100644 --- a/platform/android/6.2.4/AndroidManifest.xml +++ b/platform/android/6.2.4/AndroidManifest.xml @@ -1,6 +1,6 @@ diff --git a/platform/android/cross-compile/build.sh b/platform/android/cross-compile/build.sh index 14111cdc9d..bc70fc3b56 100755 --- a/platform/android/cross-compile/build.sh +++ b/platform/android/cross-compile/build.sh @@ -14,6 +14,10 @@ while (($# > 0)); do BUILD_TYPE="$2" shift 2 ;; + --) + shift + break + ;; *) echo "Unexpected argument $1" exit 1 @@ -30,12 +34,12 @@ export QT_ANDROID_KEYSTORE_KEY_PASS=aoeuaoeu /opt/buildhome/android/qt/bin/qt-cmake \ -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DQT_ANDROID_SIGN_APK=ON \ - -DSPELL_CHECK=OFF \ - -DUPDATE_CHECK=ON \ - -DSTRICT_OPTIONS=ON \ -GNinja \ -B_build \ - -H. + -H. \ + "$@" cmake --build _build --target apk diff --git a/platform/appimage/build.sh b/platform/appimage/build.sh index 36f24744a1..e4b74f4854 100755 --- a/platform/appimage/build.sh +++ b/platform/appimage/build.sh @@ -8,20 +8,32 @@ set -exuo pipefail usage() { - echo "$0 --src-dir SRC_DIR" - echo "Builds an app image in the CWD based off qtox installation at SRC_DIR" + echo "$0 --src-dir SRC_DIR --project-name PROJECT_NAME [cmake args]" + echo "Builds an app image in the CWD based off PROJECT_NAME installation at SRC_DIR" } while (($# > 0)); do case $1 in + --project-name) + PROJECT_NAME=$2 + shift 2 + ;; --src-dir) - QTOX_SRC_DIR=$2 + SRC_DIR=$2 + shift 2 + ;; + --arch) + ARCH=$2 shift 2 ;; --help | -h) usage exit 1 ;; + --) + shift + break + ;; *) echo "Unexpected argument $1" usage @@ -30,12 +42,24 @@ while (($# > 0)); do esac done -if [ -z "${QTOX_SRC_DIR+x}" ]; then +if [ -z "${ARCH+x}" ]; then + echo "--arch is a required argument" + usage + exit 1 +fi + +if [ -z "${SRC_DIR+x}" ]; then echo "--src-dir is a required argument" usage exit 1 fi +if [ -z "${PROJECT_NAME+x}" ]; then + echo "--project-name is a required argument" + usage + exit 1 +fi + # https://stackoverflow.com/questions/72978485/git-submodule-update-failed-with-fatal-detected-dubious-ownership-in-reposit git config --global --add safe.directory '*' @@ -44,7 +68,7 @@ git describe --tags --match 'v*' # directory paths readonly BUILD_DIR="$(realpath .)" -readonly QTOX_APP_DIR="$BUILD_DIR/QTox.AppDir" +readonly PROJECT_APP_DIR="$BUILD_DIR/$PROJECT_NAME.AppDir" rm -f appimagetool-*.AppImage wget "https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2)" @@ -55,37 +79,42 @@ chmod +x appimagetool-*.AppImage ./appimagetool-*.AppImage --appimage-extract sed -i -e 's!/EEE!/etc!g' squashfs-root/usr/bin/appimagetool -# update information to be embedded in AppImage -#readonly UPDATE_INFO="gh-releases-zsync|TokTok|qTox|latest|qTox-*.x86_64.AppImage.zsync" -#export GIT_VERSION=$(git -C "${QTOX_SRC_DIR}" rev-parse --short HEAD) - export PKG_CONFIG_PATH=/opt/buildhome/lib/pkgconfig -echo "$QTOX_APP_DIR" -cmake "$QTOX_SRC_DIR" \ +ccache --zero-stats +ccache --show-config + +echo "$PROJECT_APP_DIR" +cmake "$SRC_DIR" \ -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH="/opt/buildhome/lib64/cmake;/opt/buildhome/qt/lib/cmake" \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DUPDATE_CHECK=ON \ - -B _build + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -B _build \ + "$@" cmake --build _build -#rm -fr QTox.AppDir -cmake --install _build --prefix QTox.AppDir/usr +cmake --install _build --prefix "$PROJECT_NAME.AppDir/usr" + +ccache --show-stats export QTDIR=/opt/buildhome/qt export LD_LIBRARY_PATH="/opt/buildhome/lib:/opt/buildhome/lib64:$QTDIR/lib" # Copy offscreen/wayland plugins to the app dir. -mkdir -p "$QTOX_APP_DIR/$QTDIR/plugins/platforms" -cp -r "$QTDIR/plugins/platforms/libqoffscreen.so" "$QTOX_APP_DIR/$QTDIR/plugins/platforms/" -cp -r "$QTDIR/plugins/platforms/libqwayland-generic.so" "$QTOX_APP_DIR/$QTDIR/plugins/platforms/" +mkdir -p "$PROJECT_APP_DIR/$QTDIR/plugins/platforms" +cp -r "$QTDIR/plugins/platforms/libqoffscreen.so" "$PROJECT_APP_DIR/$QTDIR/plugins/platforms/" +cp -r "$QTDIR/plugins/platforms/libqwayland-generic.so" "$PROJECT_APP_DIR/$QTDIR/plugins/platforms/" # Copy the tls plugins to the app dir, needed for https connections. -cp -r "$QTDIR/plugins/tls/" "$QTOX_APP_DIR/$QTDIR/plugins/" +cp -r "$QTDIR/plugins/tls/" "$PROJECT_APP_DIR/$QTDIR/plugins/" -squashfs-root/AppRun -s deploy "$QTOX_APP_DIR"/usr/share/applications/*.desktop +squashfs-root/AppRun -s deploy "$PROJECT_APP_DIR"/usr/share/applications/*.desktop # print all links not contained inside the AppDir -LD_LIBRARY_PATH='' find "$QTOX_APP_DIR" -type f -exec ldd {} \; 2>&1 | grep '=>' | grep -v "$QTOX_APP_DIR" +LD_LIBRARY_PATH='' find "$PROJECT_APP_DIR" -type f -exec ldd {} \; 2>&1 | grep '=>' | grep -v "$PROJECT_APP_DIR" + +squashfs-root/AppRun "$PROJECT_APP_DIR" -squashfs-root/AppRun "$QTOX_APP_DIR" +APPIMAGE_FILE="$PROJECT_NAME-$(git rev-parse --short HEAD | head -c7)-$ARCH.AppImage" +sha256sum "$APPIMAGE_FILE" >"$APPIMAGE_FILE.sha256" diff --git a/platform/deps.depfile b/platform/deps.depfile new file mode 100644 index 0000000000..388393ff09 --- /dev/null +++ b/platform/deps.depfile @@ -0,0 +1,15 @@ +# Build dependencies for qTox (in build order). +openssl +qrencode +libexif +sodium +openal +vpx +opus +ffmpeg +sqlcipher +hunspell +extra_cmake_modules +sonnet +kimageformats +toxcore diff --git a/platform/flatpak/build.sh b/platform/flatpak/build.sh index a1bd2d943d..8a9e8c5075 100755 --- a/platform/flatpak/build.sh +++ b/platform/flatpak/build.sh @@ -5,11 +5,16 @@ # Copyright © 2024-2025 The TokTok team # Fail out on error -set -exuo pipefail +set -euxo pipefail + +PROJECT_NAME=$1 +ORG_NAME=$2 + +BINARY_NAME=$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]') # use multiple cores when building export MAKEFLAGS="-j$(nproc)" -FLATPAK_DESCRIPTOR=$(dirname "$(realpath "$0")")/io.github.qtox.qTox.json +FLATPAK_DESCRIPTOR="$(dirname "$(realpath "$0")")/$ORG_NAME.$PROJECT_NAME.json" # If $FLATPAK_BUILD is set, use it as the build directory if [ -n "${FLATPAK_BUILD:-}" ]; then @@ -17,15 +22,19 @@ if [ -n "${FLATPAK_BUILD:-}" ]; then cd "$FLATPAK_BUILD" fi -# Build the qTox flatpak -flatpak-builder --ccache --disable-rofiles-fuse --install-deps-from=flathub --force-clean --repo=qtox-repo _build-flatpak "$FLATPAK_DESCRIPTOR" +# Build the flatpak +flatpak-builder --ccache --disable-rofiles-fuse --install-deps-from=flathub --force-clean --repo="$BINARY_NAME-repo" _build-flatpak "$FLATPAK_DESCRIPTOR" # Create a bundle for distribution -flatpak build-bundle qtox-repo qtox.flatpak io.github.qtox.qTox +flatpak build-bundle "$BINARY_NAME-repo" "$PROJECT_NAME.flatpak" "$ORG_NAME.$PROJECT_NAME" + +# Generate checksum. +sha256sum "$PROJECT_NAME.flatpak" >"$PROJECT_NAME.flatpak.sha256" # If $FLATPAK_BUILD is set, copy the bundle to the build directory if [ -n "${FLATPAK_BUILD:-}" ]; then - cp qtox.flatpak "/qtox" + cp "$PROJECT_NAME.flatpak" "/qtox" + cp "$PROJECT_NAME.flatpak.sha256" "/qtox" fi rm -f .flatpak-builder/cache/.lock diff --git a/res/io.github.qtox.qTox.appdata.xml b/platform/linux/io.github.qtox.qTox.appdata.xml similarity index 100% rename from res/io.github.qtox.qTox.appdata.xml rename to platform/linux/io.github.qtox.qTox.appdata.xml diff --git a/io.github.qtox.qTox.desktop b/platform/linux/io.github.qtox.qTox.desktop similarity index 100% rename from io.github.qtox.qTox.desktop rename to platform/linux/io.github.qtox.qTox.desktop diff --git a/platform/macos/Brewfile-DepBuildDeps b/platform/macos/Brewfile-static similarity index 74% rename from platform/macos/Brewfile-DepBuildDeps rename to platform/macos/Brewfile-static index 0e4f5e0457..1ae1ca8c26 100644 --- a/platform/macos/Brewfile-DepBuildDeps +++ b/platform/macos/Brewfile-static @@ -1,9 +1,8 @@ -# Dependencies for building all of qTox's dependencies except Qt from source. +# Dependencies for building all dependencies from source as static libraries. # Needed for distributable builds, but users should use Brewfile if they are # just compiling for their own machine. brew "bash" # macOS bash is too old brew "cmake" -brew "coreutils" brew "create-dmg" brew "git" brew "libtool" diff --git a/platform/macos/build.sh b/platform/macos/build.sh new file mode 100755 index 0000000000..c8987f01db --- /dev/null +++ b/platform/macos/build.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright © 2016-2021 by The qTox Project Contributors +# Copyright © 2024-2025 The TokTok team + +# Fail out on error +set -eux -o pipefail + +MACOS_BUILD_TYPE="dist" +MACOS_ARCH="arm64" +MACOS_VERSION="12.0" + +GIT_ROOT=$(git rev-parse --show-toplevel) +DEP_PREFIX="$GIT_ROOT/third_party/deps" + +usage() { + echo "Usage: $0 --project-name [options]" + echo "Options:" + echo " --project-name Name of the project (required)" + echo " --build-type Build type (user or dist)" + echo " --dep-prefix Dependency prefix (default: third_party/deps)" + echo " --arch Architecture (arm64 or x86_64)" + echo " --macos-version macOS version (default: 12.0)" + echo " --help, -h Show this help message" +} + +while (($# > 0)); do + case $1 in + --project-name) + PROJECT_NAME=$2 + shift 2 + ;; + --build-type) + MACOS_BUILD_TYPE=$2 + shift 2 + ;; + --dep-prefix) + DEP_PREFIX=$2 + shift 2 + ;; + --arch) + MACOS_ARCH=$2 + shift 2 + ;; + --macos-version) + MACOS_VERSION=$2 + shift 2 + ;; + --help | -h) + usage + exit 1 + ;; + --) + shift + break + ;; + *) + echo "Unexpected argument $1" + usage + exit 1 + ;; + esac +done + +if [ -z "${PROJECT_NAME+x}" ]; then + echo "--project-name is a required argument" + usage + exit 1 +fi + +readonly BIN_NAME="$PROJECT_NAME-$MACOS_ARCH-$MACOS_VERSION.dmg" + +if [ "$MACOS_BUILD_TYPE" == "user" ]; then + CMAKE=cmake + PREFIX_PATH="$(brew --prefix qt@6)" +elif [ "$MACOS_BUILD_TYPE" == "dist" ]; then + CMAKE="$DEP_PREFIX/qt/bin/qt-cmake" + PREFIX_PATH="$DEP_PREFIX;$(brew --prefix qt@6)" +else + echo "Unknown arg $MACOS_BUILD_TYPE" + exit 1 +fi + +# Build project. +ccache --zero-stats + +# Explicitly include with -isystem to avoid warnings from system headers. +# CMake will use -I instead of -isystem, so we need to set it manually. +"$CMAKE" \ + -DCMAKE_CXX_FLAGS="-isystem/usr/local/include" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="$MACOS_VERSION" \ + -DCMAKE_PREFIX_PATH="$PREFIX_PATH" \ + -GNinja \ + -B_build \ + "$@" \ + . +cmake --build _build +ctest --output-on-failure --parallel "$(sysctl -n hw.ncpu)" --test-dir _build +cmake --install _build +cp "_build/$PROJECT_NAME.dmg" "$BIN_NAME" + +ccache --show-stats + +# Check if the binary exists. +if [[ ! -s "$BIN_NAME" ]]; then + echo "There's no $BIN_NAME!" + exit 1 +fi + +# Create a sha256 checksum. +shasum -a 256 "$BIN_NAME" >"$BIN_NAME".sha256 diff --git a/platform/macos/createdmg b/platform/macos/createdmg index cc90b6dc14..866e4c0aab 100755 --- a/platform/macos/createdmg +++ b/platform/macos/createdmg @@ -6,19 +6,21 @@ set -euo pipefail -QTOX_DIR="$1" +PROJECT_NAME="$1" +PROJECT_SRC_DIR="$2" +BUNDLE_PATH="$(realpath "$3")" -BUNDLE_PATH="$(realpath "$2")" BUILD_DIR="$(realpath "$BUNDLE_PATH/..")" APP_VER=$(defaults read "$BUNDLE_PATH/Contents/Info.plist" CFBundleVersion) +BINARY_NAME=$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]') if [ ! -d "$BUNDLE_PATH" ]; then - echo "Please pass path to qTox.app as an argument!" + echo "Please pass path to $BINARY_NAME.app as an argument!" exit 1 fi -rm -f "$BUILD_DIR/qTox.dmg" +rm -f "$BUILD_DIR/$PROJECT_NAME.dmg" if security find-identity | grep -q Development; then codesign -s "Development" "$BUNDLE_PATH" @@ -31,17 +33,17 @@ createdmg() { create-dmg \ --filesystem APFS \ --no-internet-enable \ - --volname "qTox $APP_VER" \ - --volicon "$QTOX_DIR/img/icons/qtox.icns" \ - --background "$QTOX_DIR/platform/macos/backgroundImage.tiff" \ - --eula "$QTOX_DIR/platform/macos/gplv3.rtf" \ + --volname "$PROJECT_NAME $APP_VER" \ + --volicon "$PROJECT_SRC_DIR/img/icons/$BINARY_NAME.icns" \ + --background "$PROJECT_SRC_DIR/platform/macos/backgroundImage.tiff" \ + --eula "$PROJECT_SRC_DIR/platform/macos/gplv3.rtf" \ --window-pos 200 120 \ --window-size 640 480 \ --icon-size 128 \ - --hide-extension "qTox.app" \ - --icon "qTox.app" 0 300 \ + --hide-extension "$BINARY_NAME.app" \ + --icon "$BINARY_NAME.app" 0 300 \ --app-drop-link 400 300 \ - "$BUILD_DIR/qTox.dmg" \ + "$BUILD_DIR/$PROJECT_NAME.dmg" \ "$BUNDLE_PATH" } diff --git a/platform/windows/cross-compile/build.sh b/platform/windows/cross-compile/build.sh index 500a39394b..690380edc1 100755 --- a/platform/windows/cross-compile/build.sh +++ b/platform/windows/cross-compile/build.sh @@ -4,19 +4,20 @@ # Copyright © 2017-2021 Maxim Biro # Copyright © 2024-2025 The TokTok team. -# Known issues: -# - Doesn't build qTox updater, because it wasn't ported to cmake yet and -# because it requires static Qt, which means we'd need to build Qt twice, and -# building Qt takes really long time. - set -euo pipefail +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" + RUN_TESTS=0 while (($# > 0)); do case $1 in + --project-name) + PROJECT_NAME=$2 + shift 2 + ;; --src-dir) - QTOX_SRC_DIR=$2 + PROJECT_SRC_DIR=$2 shift 2 ;; --arch) @@ -31,6 +32,10 @@ while (($# > 0)); do BUILD_TYPE=$2 shift 2 ;; + --) + shift + break + ;; *) "Unexpected argument $1" exit 1 @@ -46,15 +51,15 @@ git describe --tags --match 'v*' # Common directory paths -QTOX_BUILD_DIR="_build-$WINEARCH" -readonly QTOX_BUILD_DIR -QTOX_PREFIX_DIR="$(realpath install-prefix)" -readonly QTOX_PREFIX_DIR -QTOX_PACKAGE_DIR="$(realpath package-prefix)" -readonly QTOX_PACKAGE_DIR +PROJECT_BUILD_DIR="_build-$WINEARCH" +readonly PROJECT_BUILD_DIR +PROJECT_PREFIX_DIR="$(realpath install-prefix)" +readonly PROJECT_PREFIX_DIR +PROJECT_PACKAGE_DIR="$(realpath package-prefix)" +readonly PROJECT_PACKAGE_DIR -if [ -z "$ARCH" ]; then - echo "Error: No architecture was specified. Please specify either 'i686' or 'x86_64', case sensitive, as the first argument to the script." +if [ -z "${ARCH:-}" ]; then + echo "Error: No architecture was specified. Please specify either 'i686' or 'x86_64', case sensitive." exit 1 fi @@ -63,66 +68,108 @@ if [[ "$ARCH" == "i686" ]]; then elif [[ "$ARCH" == "x86_64" ]]; then export WINE=/usr/lib/wine/wine64 else - echo "Error: Incorrect architecture was specified. Please specify either 'i686' or 'x86_64', case sensitive, as the first argument to the script." + echo "Error: Incorrect architecture was specified. Please specify either 'i686' or 'x86_64', case sensitive." exit 1 fi -if [ -z "$QTOX_SRC_DIR" ]; then +if [ -z "$PROJECT_SRC_DIR" ]; then echo "--src-dir must be specified" fi if [ -z "$BUILD_TYPE" ]; then - echo "Error: No build type was specified. Please specify either 'Release' or 'Debug', case sensitive, as the second argument to the script." + echo "Error: No build type was specified. Please specify either 'Release' or 'Debug', case sensitive." exit 1 fi if [[ "$BUILD_TYPE" != "Release" ]] && [[ "$BUILD_TYPE" != "Debug" ]]; then - echo "Error: Incorrect build type was specified. Please specify either 'Release' or 'Debug', case sensitive, as the second argument to the script." + echo "Error: Incorrect build type was specified. Please specify either 'Release' or 'Debug', case sensitive." + exit 1 +fi + +if [ -z "${PROJECT_NAME:-}" ]; then + echo "Error: No project name was specified." exit 1 fi +BINARY_NAME="$(echo "$PROJECT_NAME" | tr '[:upper:]' '[:lower:]')" + export PKG_CONFIG_PATH=/windows/lib64/pkgconfig -ccache --zero-stats +CMAKE_FLAGS=( + -D CMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake + -D CMAKE_LIBRARY_PATH=/windows/lib64 + -D CMAKE_PREFIX_PATH=/windows + -D CMAKE_BUILD_TYPE=Release + -D CMAKE_CROSSCOMPILING_EMULATOR="$WINE" + -D CMAKE_C_COMPILER_LAUNCHER=ccache + -D CMAKE_CXX_COMPILER_LAUNCHER=ccache + -G Ninja +) -# Spell check on windows currently not supported, disable -if [[ "$BUILD_TYPE" == "Release" ]]; then - cmake -DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \ - -DCMAKE_LIBRARY_PATH=/windows/lib64 \ - -DCMAKE_PREFIX_PATH=/windows \ - -DCMAKE_BUILD_TYPE=Release \ - -DSTRICT_OPTIONS=ON \ - -DTEST_CROSSCOMPILING_EMULATOR="$WINE" \ - -GNinja \ - "-B$QTOX_BUILD_DIR" \ - "$QTOX_SRC_DIR" -elif [[ "$BUILD_TYPE" == "Debug" ]]; then - cmake -DCMAKE_TOOLCHAIN_FILE=/build/windows-toolchain.cmake \ - -DCMAKE_LIBRARY_PATH=/windows/lib64 \ - -DCMAKE_PREFIX_PATH=/windows \ - -DCMAKE_BUILD_TYPE=Debug \ - -DSTRICT_OPTIONS=ON \ - -DTEST_CROSSCOMPILING_EMULATOR="$WINE" \ - -GNinja \ - -DCMAKE_EXE_LINKER_FLAGS="-mconsole" \ - "-B$QTOX_BUILD_DIR" \ - "$QTOX_SRC_DIR" +if [[ "$BUILD_TYPE" == "Debug" ]]; then + CMAKE_FLAGS+=(-D CMAKE_EXE_LINKER_FLAGS="-mconsole") fi -cmake --build "$QTOX_BUILD_DIR" +CMAKE_FLAGS+=("$@") + +ccache --zero-stats + +cmake "${CMAKE_FLAGS[@]}" -B "$PROJECT_BUILD_DIR" "$PROJECT_SRC_DIR" +cmake --build "$PROJECT_BUILD_DIR" ccache --show-stats -mkdir -p "$QTOX_PREFIX_DIR" -cp "$QTOX_BUILD_DIR/qtox.exe" "$QTOX_PREFIX_DIR" -cp -r /export/* "$QTOX_PREFIX_DIR" +mkdir -p "$PROJECT_PREFIX_DIR" +cp "$PROJECT_BUILD_DIR/$BINARY_NAME.exe" "$PROJECT_PREFIX_DIR" + +# Always needed DLLs. +DLL_DEPS=( + libssp-0.dll + libstdc++-6.dll + libwinpthread-1.dll +) + +if [ "$ARCH" == "i686" ]; then + DLL_DEPS+=(libgcc_s_dw2-1.dll) +elif [ "$ARCH" == "x86_64" ]; then + DLL_DEPS+=(libgcc_s_seh-1.dll) +fi + +# Add all the DLL dependencies from $SCRIPT_DIR/dll-deps to DLL_DEPS. +# Ignore lines starting with # and empty lines. +while IFS= read -r line; do + if [ -n "$line" ] && [ "${line:0:1}" != "#" ]; then + DLL_DEPS+=("$line") + fi +done <"$SCRIPT_DIR/dll-deps" + +# If tls/qopensslbackend.dll is in the DLL_DEPS, add the OpenSSL DLLs. +if [[ " ${DLL_DEPS[*]} " == *" tls/qopensslbackend.dll "* ]]; then + if [ "$ARCH" == "i686" ]; then + DLL_DEPS+=( + libcrypto-3.dll + libssl-3.dll + ) + elif [ "$ARCH" == "x86_64" ]; then + DLL_DEPS+=( + libcrypto-3-x64.dll + libssl-3-x64.dll + ) + fi +fi + +# Copy from /export to $PROJECT_PREFIX_DIR, but only the DLLs that are in DLL_DEPS. +for dll in "${DLL_DEPS[@]}"; do + mkdir -p "$(dirname "$PROJECT_PREFIX_DIR/$dll")" + cp "/export/$dll" "$PROJECT_PREFIX_DIR/$dll" +done export WINEQT_QPA_PLATFORM='offscreen' -export WINEPREFIX="$PWD/$QTOX_BUILD_DIR/.wine" +export WINEPREFIX="$PWD/$PROJECT_BUILD_DIR/.wine" # Check if our main binary runs (just to see if any DLL errors happen early on). # This also initialises the wine directory for tests (avoiding race conditions). -"$WINE" "$QTOX_PREFIX_DIR/qtox.exe" --help +"$WINE" "$PROJECT_PREFIX_DIR/$BINARY_NAME.exe" --help # Run tests set +u @@ -131,43 +178,47 @@ if [[ $RUN_TESTS -ne 0 ]]; then # we want to see if the prefix dir has everything we need). export WINEQT_PLUGIN_PATH='z:\export' export WINEPATH='z:\export;z:\windows\bin' - ctest --test-dir "$QTOX_BUILD_DIR" --parallel "$(nproc)" --output-on-failure + ctest --test-dir "$PROJECT_BUILD_DIR" --parallel "$(nproc)" --output-on-failure fi set -u # Strip set +e if [[ "$BUILD_TYPE" == "Release" ]]; then - "$ARCH-w64-mingw32-strip" -s "$QTOX_PREFIX_DIR"/*.exe + "$ARCH-w64-mingw32-strip" -s "$PROJECT_PREFIX_DIR"/*.exe fi -"$ARCH-w64-mingw32-strip" -s "$QTOX_PREFIX_DIR"/*.dll -"$ARCH-w64-mingw32-strip" -s "$QTOX_PREFIX_DIR"/*/*.dll +"$ARCH-w64-mingw32-strip" -s "$PROJECT_PREFIX_DIR"/*.dll +"$ARCH-w64-mingw32-strip" -s "$PROJECT_PREFIX_DIR"/*/*.dll set -e if [[ "$BUILD_TYPE" == "Debug" ]]; then - cp -r /debug_export/* "$QTOX_PREFIX_DIR" + cp -r /debug_export/* "$PROJECT_PREFIX_DIR" fi # Create zip -pushd "$QTOX_PREFIX_DIR" -zip "qtox-$ARCH-$BUILD_TYPE.zip" -r * +pushd "$PROJECT_PREFIX_DIR" +zip "$BINARY_NAME-$ARCH-$BUILD_TYPE.zip" -r ./* popd # Create installer if [[ "$BUILD_TYPE" == "Release" ]]; then - mkdir -p "$QTOX_PACKAGE_DIR" - pushd "$QTOX_PACKAGE_DIR" - # The installer creation script expects all the files to be in qtox/* - mkdir -p qtox - cp -r "$QTOX_PREFIX_DIR"/* ./qtox - rm ./qtox/*.zip - - cp -r "$QTOX_SRC_DIR"/platform/windows/* . + mkdir -p "$PROJECT_PACKAGE_DIR" + pushd "$PROJECT_PACKAGE_DIR" + # The installer creation script expects all the files to be in $BINARY_NAME/* + mkdir -p "$BINARY_NAME" + cp -r "$PROJECT_PREFIX_DIR"/* "./$BINARY_NAME" + rm ./"$BINARY_NAME"/*.zip + + cp -r "$PROJECT_SRC_DIR"/platform/windows/* . # Select the installer script for the correct architecture if [[ "$ARCH" == "i686" ]]; then - makensis qtox.nsi + grep -v ' SetRegView 64' "${BINARY_NAME}64.nsi" | + sed -e 's/PROGRAMFILES64/PROGRAMFILES/g' | + sed -e 's/FileRead /FileReadUTF16LE /g' \ + >"${BINARY_NAME}32.nsi" + makensis "${BINARY_NAME}32.nsi" elif [[ "$ARCH" == "x86_64" ]]; then - makensis qtox64.nsi + makensis "${BINARY_NAME}64.nsi" fi popd @@ -175,42 +226,28 @@ fi # dll check # Create lists of all .exe and .dll files -find "$QTOX_PREFIX_DIR" -iname '*.dll' >dlls -find "$QTOX_PREFIX_DIR" -iname '*.exe' >exes +find "$PROJECT_PREFIX_DIR" -iname '*.dll' >dlls +find "$PROJECT_PREFIX_DIR" -iname '*.exe' >exes # Create a list of dlls that are loaded during the runtime (not listed in the PE -# import table, thus ldd doesn't print those) -echo "$QTOX_PREFIX_DIR/iconengines/qsvgicon.dll -$QTOX_PREFIX_DIR/imageformats/kimg_qoi.dll -$QTOX_PREFIX_DIR/imageformats/qgif.dll -$QTOX_PREFIX_DIR/imageformats/qjpeg.dll -$QTOX_PREFIX_DIR/imageformats/qsvg.dll -$QTOX_PREFIX_DIR/imageformats/qwebp.dll -$QTOX_PREFIX_DIR/kf6/sonnet/sonnet_hunspell.dll -$QTOX_PREFIX_DIR/kf6/sonnet/sonnet_ispellchecker.dll -$QTOX_PREFIX_DIR/platforms/qdirect2d.dll -$QTOX_PREFIX_DIR/platforms/qminimal.dll -$QTOX_PREFIX_DIR/platforms/qoffscreen.dll -$QTOX_PREFIX_DIR/platforms/qwindows.dll -$QTOX_PREFIX_DIR/tls/qcertonlybackend.dll -$QTOX_PREFIX_DIR/tls/qopensslbackend.dll -$QTOX_PREFIX_DIR/tls/qschannelbackend.dll" >runtime-dlls -if [[ "$ARCH" == "i686" ]]; then - echo "$QTOX_PREFIX_DIR/libssl-3.dll" >>runtime-dlls -elif [[ "$ARCH" == "x86_64" ]]; then - echo "$QTOX_PREFIX_DIR/libssl-3-x64.dll" >>runtime-dlls -fi +# import table, thus ldd doesn't print those). +echo >runtime-dlls +for path in iconengines imageformats kf6/sonnet platforms tls; do + if [ -d "$PROJECT_PREFIX_DIR/$path" ]; then + ls "$PROJECT_PREFIX_DIR/$path"/*.dll >>runtime-dlls + fi +done # Clean up any old file that may be here from previous runs. rm -f dlls-required # Create a tree of all required dlls -# Assumes all .exe files are directly in $QTOX_PREFIX_DIR, not in subdirs +# Assumes all .exe files are directly in $PROJECT_PREFIX_DIR, not in subdirs platform/windows/cross-compile/check-dlls "-j$(nproc)" \ EXES="$(cat exes runtime-dlls)" \ ARCH="$ARCH" \ - BUILD_DIR="$QTOX_BUILD_DIR" \ - PREFIX_DIR="$QTOX_PREFIX_DIR" + BUILD_DIR="$PROJECT_BUILD_DIR" \ + PREFIX_DIR="$PROJECT_PREFIX_DIR" wc -l dlls-required diff --git a/platform/windows/cross-compile/dll-deps b/platform/windows/cross-compile/dll-deps new file mode 100644 index 0000000000..e4d0210390 --- /dev/null +++ b/platform/windows/cross-compile/dll-deps @@ -0,0 +1,43 @@ +# Common Qt dependencies. +Qt6Core.dll +Qt6Gui.dll +Qt6Network.dll +Qt6Widgets.dll +libzstd.dll +platforms/qdirect2d.dll +platforms/qoffscreen.dll +platforms/qwindows.dll +platforms/qminimal.dll +tls/qschannelbackend.dll +tls/qopensslbackend.dll +tls/qcertonlybackend.dll +# Toxcore dependencies. +libopus-0.dll +libsodium-26.dll +libtoxcore.dll +# qTox Qt SVG dependencies. +Qt6Svg.dll +Qt6Xml.dll +# Icon engines and image formats we've reviewed and fuzzed. +iconengines/qsvgicon.dll +imageformats/kimg_qoi.dll +imageformats/qgif.dll +imageformats/qjpeg.dll +imageformats/qsvg.dll +imageformats/qwebp.dll +# Spell checking. +kf6/sonnet/sonnet_hunspell.dll +kf6/sonnet/sonnet_ispellchecker.dll +libKF6SonnetCore.dll +libKF6SonnetUi.dll +libhunspell-1.7-0.dll +# Other qTox dependencies. +OpenAL32.dll +avcodec-61.dll +avdevice-61.dll +avformat-61.dll +avutil-59.dll +libexif-12.dll +libqrencode.dll +libsqlcipher-0.dll +swscale-8.dll diff --git a/platform/windows/generate-icon.sh b/platform/windows/generate-icon.sh old mode 100644 new mode 100755 index 85837c8d6e..35cf710386 --- a/platform/windows/generate-icon.sh +++ b/platform/windows/generate-icon.sh @@ -1,64 +1,71 @@ -#!/bin/bash +#!/usr/bin/env bash -# Copyright © 2017-2019 The qTox Project Contributors -# -# This file is part of qTox, a Qt-based graphical interface for Tox. -# qTox is libre software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# qTox is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with qTox. If not, see +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright © 2017-2019 The qTox Project Contributors +# Copyright © 2025 The TokTok team -# Generates qtox.ico from qtox.svg +# Generates $BINARY_NAME.ico from $BINARY_NAME.svg +# +# Usage: ./generate-icon.sh +# binary-name: name of the binary, e.g. "qtox" # # Dependencies: # base64 8.25 # ImageMagick 7.0.4 # icoutils 0.31.0 +set -eux -o pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +GIT_ROOT=$(git rev-parse --show-toplevel) + +BINARY_NAME=${1:-} + +# Default to the git directory name. +if [ -z "$BINARY_NAME" ]; then + BINARY_NAME=$(basename "$GIT_ROOT" | tr '[:upper:]' '[:lower:]') +fi + +cd "$SCRIPT_DIR" + # Black, gray and transparent colors from Windows 16-color palette base64 -d <<pal.gif # Generate 32 bpp images -convert -background none -depth 8 qtox.svg qtox_256_256_32.png -convert -resize 64x64 qtox_256_256_32.png qtox_64_64_32.png -convert -resize 48x48 qtox_256_256_32.png qtox_48_48_32.png -convert -resize 32x32 qtox_256_256_32.png qtox_32_32_32.png -convert -resize 24x24 qtox_256_256_32.png qtox_24_24_32.png -convert -resize 16x16 qtox_256_256_32.png qtox_16_16_32.png +magick -background none -depth 8 "$GIT_ROOT/img/icons/$BINARY_NAME.svg" "${BINARY_NAME}_256_256_32.png" +magick "${BINARY_NAME}_256_256_32.png" -resize 64x64 "${BINARY_NAME}_64_64_32.png" +magick "${BINARY_NAME}_256_256_32.png" -resize 48x48 "${BINARY_NAME}_48_48_32.png" +magick "${BINARY_NAME}_256_256_32.png" -resize 32x32 "${BINARY_NAME}_32_32_32.png" +magick "${BINARY_NAME}_256_256_32.png" -resize 24x24 "${BINARY_NAME}_24_24_32.png" +magick "${BINARY_NAME}_256_256_32.png" -resize 16x16 "${BINARY_NAME}_16_16_32.png" # Generate 8 bpp images -convert +dither qtox_48_48_32.png png8:qtox_48_48_8.png -convert +dither qtox_32_32_32.png png8:qtox_32_32_8.png -convert +dither qtox_16_16_32.png png8:qtox_16_16_8.png +magick "${BINARY_NAME}_48_48_32.png" +dither "png8:${BINARY_NAME}_48_48_8.png" +magick "${BINARY_NAME}_32_32_32.png" +dither "png8:${BINARY_NAME}_32_32_8.png" +magick "${BINARY_NAME}_16_16_32.png" +dither "png8:${BINARY_NAME}_16_16_8.png" # Generate 1 bpp images -convert +dither -remap pal.gif qtox_32_32_8.png png8:qtox_32_32_1.png -convert +dither -remap pal.gif qtox_16_16_8.png png8:qtox_16_16_1.png +magick "${BINARY_NAME}_32_32_8.png" +dither -remap pal.gif "png8:${BINARY_NAME}_32_32_1.png" +magick "${BINARY_NAME}_16_16_8.png" +dither -remap pal.gif "png8:${BINARY_NAME}_16_16_1.png" # Hack for Windows XP file properties page -convert -modulate 99.5 -strip qtox_256_256_32.png qtox_256_256_32.png -convert -modulate 99.5 qtox_64_64_32.png qtox_64_64_32.png -convert -modulate 99.5 qtox_48_48_32.png qtox_48_48_32.png -convert -modulate 99.5 qtox_32_32_32.png qtox_32_32_32.png -convert -modulate 99.5 qtox_24_24_32.png qtox_24_24_32.png -convert -modulate 99.5 qtox_16_16_32.png qtox_16_16_32.png +magick "${BINARY_NAME}_256_256_32.png" -modulate 99.5 -strip "${BINARY_NAME}_256_256_32.png" +magick "${BINARY_NAME}_64_64_32.png" -modulate 99.5 "${BINARY_NAME}_64_64_32.png" +magick "${BINARY_NAME}_48_48_32.png" -modulate 99.5 "${BINARY_NAME}_48_48_32.png" +magick "${BINARY_NAME}_32_32_32.png" -modulate 99.5 "${BINARY_NAME}_32_32_32.png" +magick "${BINARY_NAME}_24_24_32.png" -modulate 99.5 "${BINARY_NAME}_24_24_32.png" +magick "${BINARY_NAME}_16_16_32.png" -modulate 99.5 "${BINARY_NAME}_16_16_32.png" # Build .ico file from .png images icotool -c -t 32 \ - qtox_32_32_1.png \ - qtox_16_16_1.png \ - qtox_48_48_8.png \ - qtox_32_32_8.png \ - qtox_16_16_8.png \ - --raw=qtox_256_256_32.png \ - qtox_64_64_32.png \ - qtox_48_48_32.png \ - qtox_32_32_32.png \ - qtox_24_24_32.png \ - qtox_16_16_32.png \ - >qtox.ico + "${BINARY_NAME}_32_32_1.png" \ + "${BINARY_NAME}_16_16_1.png" \ + "${BINARY_NAME}_48_48_8.png" \ + "${BINARY_NAME}_32_32_8.png" \ + "${BINARY_NAME}_16_16_8.png" \ + --raw="${BINARY_NAME}_256_256_32.png" \ + "${BINARY_NAME}_64_64_32.png" \ + "${BINARY_NAME}_48_48_32.png" \ + "${BINARY_NAME}_32_32_32.png" \ + "${BINARY_NAME}_24_24_32.png" \ + "${BINARY_NAME}_16_16_32.png" \ + >"$BINARY_NAME.ico" +rm -f pal.gif "$BINARY_NAME"_*.png # Show debug information -icotool -l qtox.ico +icotool -l "$BINARY_NAME.ico" diff --git a/platform/windows/qtox.ico b/platform/windows/qtox.ico index b95cb526c4874398113de55eff85b2d2604d63ab..80cc15c4f7eba011f85fdf33dbc71774306cbe48 100644 GIT binary patch delta 121 zcmaFg%Y3Vsc|uqm0}wDWC@`ofGBEhbGcY(fK=>L?3=Bm;wt)eJze1IPVOA3ZgMtE- zFTlXyw1R;_LIT3?;ACKUwS$2{04NSJFM|cB|Io%Qv*adkTdKVI-BL!y&3^J3Z2;Av B7&HI? delta 141 zcmccB%ly8Vc|us6g98HtBZC5ih7$vWpF9JDfdPcSLY0A`ERlghK>^AaU|^7IXJC+! zfbcsw85oXDXJ8Njii7lLumJThWB>yY-%^o*VcXJ;TV}~^E^^3do9rjAEX=@J;1O92 SR1yWo1 None: ) files = ( "README.md", + "platform/linux/io.github.qtox.qTox.appdata.xml", "platform/macos/Info.plist", "platform/windows/qtox.nsi", "platform/windows/qtox64.nsi", - "res/io.github.qtox.qTox.appdata.xml", ) if has_diff(config, *files): if config.commit: @@ -205,9 +209,9 @@ def check_package_versions(failures: list[str], config: Config) -> None: def check_no_version_changes(failures: list[str]) -> None: """Check that no version changes are made in a non-release PR. - Diff res/io.github.qtox.qTox.appdata.xml against $GITHUB_BASE_BRANCH and - check if there's a line starting with "+" or "-" that contains a version - number. + Diff platform/linux/io.github.qtox.qTox.appdata.xml against + $GITHUB_BASE_BRANCH and check if there's a line starting with "+" or "-" + that contains a version number. Example: - @@ -224,7 +228,7 @@ def check_no_version_changes(failures: list[str]) -> None: "diff", github.base_branch(), "--", - "res/io.github.qtox.qTox.appdata.xml", + "platform/linux/io.github.qtox.qTox.appdata.xml", ], cwd=GIT_BASE_DIR, universal_newlines=True,