From a0f7c832d07cea1090dce26bbbd8151e13914f96 Mon Sep 17 00:00:00 2001 From: askmeaboutloom Date: Fri, 18 Oct 2024 05:32:23 +0200 Subject: [PATCH] WIP: rcedit --- .../scripts/build-to-product-version.cmake | 25 + .github/scripts/edit-pe-metadata.cmake | 25 + .github/workflows/main.yml | 539 +++++++++--------- cmake/DrawpileVersions.cmake | 6 +- 4 files changed, 338 insertions(+), 257 deletions(-) create mode 100644 .github/scripts/build-to-product-version.cmake create mode 100644 .github/scripts/edit-pe-metadata.cmake diff --git a/.github/scripts/build-to-product-version.cmake b/.github/scripts/build-to-product-version.cmake new file mode 100644 index 0000000000..28ba599174 --- /dev/null +++ b/.github/scripts/build-to-product-version.cmake @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: MIT +if(NOT BUILD_VERSION OR NOT OUTPUT_PATH) + message(FATAL_ERROR "BUILD_VERSION and OUTPUT_PATH are required") +endif() + +message(STATUS "Build version: '${BUILD_VERSION}'") +if(BUILD_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") + set(server "${CMAKE_MATCH_1}") + set(major "${CMAKE_MATCH_2}") + set(minor "${CMAKE_MATCH_3}") + + if(BUILD_VERSION MATCHES "-beta\\.([0-9]+)") + set(beta "${CMAKE_MATCH_1}") + else() + set(beta 0) + endif() + + set(PRODUCT_VERSION "${server}.${major}.${minor}.${beta}") + message(STATUS "Product version: '${PRODUCT_VERSION}'") + file(APPEND "${OUTPUT_PATH}" "WINDOWS_PRODUCT_VERSION=${PRODUCT_VERSION}\n") +else() + message(FATAL_ERROR "Unable to determine product version") +endif() + + diff --git a/.github/scripts/edit-pe-metadata.cmake b/.github/scripts/edit-pe-metadata.cmake new file mode 100644 index 0000000000..df38689adb --- /dev/null +++ b/.github/scripts/edit-pe-metadata.cmake @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: MIT +if(NOT PRODUCT_NAME OR NOT PRODUCT_VERSION OR NOT SEARCH_PATHS) + message(FATAL_ERROR "PRODUCT_NAME, PRODUCT_VERSION and SEARCH_PATHS are required") +endif() + +find_program(RCEDIT_COMMAND rcedit REQUIRED) + +unset(globs) +foreach(search_path IN LISTS SEARCH_PATHS) + list(APPEND globs "${search_path}/*.dll" "${search_path}/*.exe") +endforeach() + +message(STATUS "Looking for PE files: ${globs}") +file(GLOB_RECURSE pe_paths FOLLOW_SYMLINKS ${globs}) +foreach(pe_path IN LISTS pe_paths) + execute_process( + COMMAND + ${RCEDIT_COMMAND} + "${pe_path}" + --set-version-string ProductName "${PRODUCT_NAME}" + --set-version-string ProductVersion "${PRODUCT_VERSION}" + COMMAND_ECHO STDOUT + COMMAND_ERROR_IS_FATAL ANY + ) +endforeach() diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ccac821cc4..f36216fd27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,211 +43,211 @@ jobs: # There's ways to deduplicate these includes, but any mistake causes # utterly confounding errors, so just explicitly specify each target. include: - - os: ubuntu-20.04 - cross_os: '' - component: '' - qt: 5.15.14 - arch: x86_64 - sccache_triplet: x86_64-unknown-linux-musl - build_flags: -DINITSYS=systemd -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: Release - collect_symbols: false - signpath: false - # This causes the AppImage to be generated, instead of just creating - # the portable tree, because there seems to be no way to separate - # these steps with linuxdeploy - # Even though the svg component is linked explicitly, - # linuxdeploy-plugin-qt does not seem to notice and so does not - # export the iconengine if it is not told that we really, really - # want svg plugins please - packager: >- - EXTRA_QT_PLUGINS="svg;" - VERSION="${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe)' }}" - cmake --install build --config Release - # The runner has multiple clang versions installed and CMake/Qt gets - # confused about which one to pick for some reason, so this also - # sets Clang_ROOT during the Qt build - qt_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev - libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev - libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev - libxext-dev libxfixes-dev libxrender-dev libx11-dev - libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev - libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev - libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev - libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev - libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev - libxcb-util-dev libinput-dev libvulkan-dev - libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev - libasound2-dev libpulse-dev libcups2-dev libssl-dev - libfontconfig1-dev && - echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV - ffmpeg_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - nasm yasm - other_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libsecret-1-dev - - - os: ubuntu-20.04 - cross_os: Android - component: '' - qt: 5.15.14 - arch: arm64 - sccache_triplet: x86_64-unknown-linux-musl - build_type: Release - collect_symbols: false - signpath: false - packager: cmake --install build --config Release --prefix . - cross_qt_args: >- - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - -DANDROID_ABI=arm64-v8a - cross_ffmpeg_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - -DANDROID_ABI=arm64-v8a - cross_other_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - -DANDROID_ABI=arm64-v8a - build_flags: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - "-DANDROID_TARGET_SDK_VERSION=$ANDROID_TARGET_SDK_VERSION" - "-DANDROID_SDK_BUILD_TOOLS_REVISION=$ANDROID_BUILD_TOOLS_VERSION" - -DANDROID_ABI=arm64-v8a - -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on - -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH - -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH - -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH - # The runner has multiple clang versions installed and CMake/Qt gets - # confused about which one to pick for some reason, so this also - # sets Clang_ROOT during the Qt build - qt_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev - libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev - libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev - libxext-dev libxfixes-dev libxrender-dev libx11-dev - libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev - libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev - libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev - libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev - libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev - libxcb-util-dev libinput-dev libvulkan-dev - libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev - libasound2-dev libpulse-dev libcups2-dev libssl-dev - libfontconfig1-dev && - echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV - ffmpeg_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - yasm - other_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libsecret-1-dev - - - os: ubuntu-20.04 - cross_os: Android - component: '' - qt: 5.15.14 - arch: arm32 - sccache_triplet: x86_64-unknown-linux-musl - build_type: Release - collect_symbols: false - signpath: false - packager: cmake --install build --config Release --prefix . - cross_qt_args: >- - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - -DANDROID_ABI=armeabi-v7a - cross_ffmpeg_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - -DANDROID_ABI=armeabi-v7a - cross_other_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - -DANDROID_ABI=armeabi-v7a - build_flags: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" - "-DANDROID_PLATFORM=$ANDROID_PLATFORM" - "-DANDROID_TARGET_SDK_VERSION=$ANDROID_TARGET_SDK_VERSION" - "-DANDROID_SDK_BUILD_TOOLS_REVISION=$ANDROID_BUILD_TOOLS_VERSION" - -DANDROID_ABI=armeabi-v7a - -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on - -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH - -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH - -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH - # The runner has multiple clang versions installed and CMake/Qt gets - # confused about which one to pick for some reason, so this also - # sets Clang_ROOT during the Qt build - qt_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev - libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev - libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev - libxext-dev libxfixes-dev libxrender-dev libx11-dev - libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev - libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev - libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev - libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev - libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev - libxcb-util-dev libinput-dev libvulkan-dev - libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev - libasound2-dev libpulse-dev libcups2-dev libssl-dev - libfontconfig1-dev && - echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV - ffmpeg_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - yasm - other_pre_build: > - sudo apt-get update && - sudo apt-get install --no-install-recommends - libsecret-1-dev - - - os: macos-13 - cross_os: '' - component: '' - qt: 6.7.2 - arch: x86_64 - build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: Release - collect_symbols: false - signpath: false - sccache_triplet: x86_64-apple-darwin - packager: cpack --verbose --config build/CPackConfig.cmake -C Release - - - os: macos-14 - cross_os: '' - component: '' - qt: 6.7.2 - arch: arm64 - build_flags: -DBUILD_PACKAGE_SUFFIX=arm64 -G Ninja - build_type: Release - collect_symbols: false - signpath: false - sccache_triplet: aarch64-apple-darwin - packager: cpack --verbose --config build/CPackConfig.cmake -C Release + # - os: ubuntu-20.04 + # cross_os: '' + # component: '' + # qt: 5.15.14 + # arch: x86_64 + # sccache_triplet: x86_64-unknown-linux-musl + # build_flags: -DINITSYS=systemd -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja + # build_type: Release + # collect_symbols: false + # signpath: false + # # This causes the AppImage to be generated, instead of just creating + # # the portable tree, because there seems to be no way to separate + # # these steps with linuxdeploy + # # Even though the svg component is linked explicitly, + # # linuxdeploy-plugin-qt does not seem to notice and so does not + # # export the iconengine if it is not told that we really, really + # # want svg plugins please + # packager: >- + # EXTRA_QT_PLUGINS="svg;" + # VERSION="${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '$(git describe)' }}" + # cmake --install build --config Release + # # The runner has multiple clang versions installed and CMake/Qt gets + # # confused about which one to pick for some reason, so this also + # # sets Clang_ROOT during the Qt build + # qt_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev + # libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev + # libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev + # libxext-dev libxfixes-dev libxrender-dev libx11-dev + # libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev + # libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev + # libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev + # libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev + # libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev + # libxcb-util-dev libinput-dev libvulkan-dev + # libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev + # libasound2-dev libpulse-dev libcups2-dev libssl-dev + # libfontconfig1-dev && + # echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV + # ffmpeg_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # nasm yasm + # other_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # libsecret-1-dev + + # - os: ubuntu-20.04 + # cross_os: Android + # component: '' + # qt: 5.15.14 + # arch: arm64 + # sccache_triplet: x86_64-unknown-linux-musl + # build_type: Release + # collect_symbols: false + # signpath: false + # packager: cmake --install build --config Release --prefix . + # cross_qt_args: >- + # "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + # "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # -DANDROID_ABI=arm64-v8a + # cross_ffmpeg_args: >- + # "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + # "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + # "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # -DANDROID_ABI=arm64-v8a + # cross_other_args: >- + # "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + # "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + # "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # -DANDROID_ABI=arm64-v8a + # build_flags: >- + # "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # "-DANDROID_TARGET_SDK_VERSION=$ANDROID_TARGET_SDK_VERSION" + # "-DANDROID_SDK_BUILD_TOOLS_REVISION=$ANDROID_BUILD_TOOLS_VERSION" + # -DANDROID_ABI=arm64-v8a + # -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on + # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH + # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH + # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH + # # The runner has multiple clang versions installed and CMake/Qt gets + # # confused about which one to pick for some reason, so this also + # # sets Clang_ROOT during the Qt build + # qt_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev + # libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev + # libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev + # libxext-dev libxfixes-dev libxrender-dev libx11-dev + # libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev + # libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev + # libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev + # libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev + # libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev + # libxcb-util-dev libinput-dev libvulkan-dev + # libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev + # libasound2-dev libpulse-dev libcups2-dev libssl-dev + # libfontconfig1-dev && + # echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV + # ffmpeg_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # yasm + # other_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # libsecret-1-dev + + # - os: ubuntu-20.04 + # cross_os: Android + # component: '' + # qt: 5.15.14 + # arch: arm32 + # sccache_triplet: x86_64-unknown-linux-musl + # build_type: Release + # collect_symbols: false + # signpath: false + # packager: cmake --install build --config Release --prefix . + # cross_qt_args: >- + # "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + # "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # -DANDROID_ABI=armeabi-v7a + # cross_ffmpeg_args: >- + # "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + # "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + # "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # -DANDROID_ABI=armeabi-v7a + # cross_other_args: >- + # "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + # "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" + # "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # -DANDROID_ABI=armeabi-v7a + # build_flags: >- + # "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_TOOLCHAIN_FILE" + # "-DANDROID_PLATFORM=$ANDROID_PLATFORM" + # "-DANDROID_TARGET_SDK_VERSION=$ANDROID_TARGET_SDK_VERSION" + # "-DANDROID_SDK_BUILD_TOOLS_REVISION=$ANDROID_BUILD_TOOLS_VERSION" + # -DANDROID_ABI=armeabi-v7a + # -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=on + # -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=BOTH + # -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=BOTH + # -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH + # # The runner has multiple clang versions installed and CMake/Qt gets + # # confused about which one to pick for some reason, so this also + # # sets Clang_ROOT during the Qt build + # qt_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # libatspi2.0-dev libmtdev-dev libts-dev libgtk-3-dev + # libgl1-mesa-dev libglu1-mesa-dev libxi-dev libdrm-dev + # libgbm-dev libgl-dev libgles-dev libegl-dev libegl1-mesa-dev + # libxext-dev libxfixes-dev libxrender-dev libx11-dev + # libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-util0-dev + # libxkbcommon-dev libxkbcommon-x11-dev libxcb-keysyms1-dev + # libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev + # libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev + # libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev + # libxcb-util-dev libinput-dev libvulkan-dev + # libxcb-xinerama0-dev libxcb-xkb-dev libxcb-xinput-dev libclang-12-dev + # libasound2-dev libpulse-dev libcups2-dev libssl-dev + # libfontconfig1-dev && + # echo "Clang_ROOT=/usr/lib/llvm-12" >> $GITHUB_ENV + # ffmpeg_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # yasm + # other_pre_build: > + # sudo apt-get update && + # sudo apt-get install --no-install-recommends + # libsecret-1-dev + + # - os: macos-13 + # cross_os: '' + # component: '' + # qt: 6.7.2 + # arch: x86_64 + # build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja + # build_type: Release + # collect_symbols: false + # signpath: false + # sccache_triplet: x86_64-apple-darwin + # packager: cpack --verbose --config build/CPackConfig.cmake -C Release + + # - os: macos-14 + # cross_os: '' + # component: '' + # qt: 6.7.2 + # arch: arm64 + # build_flags: -DBUILD_PACKAGE_SUFFIX=arm64 -G Ninja + # build_type: Release + # collect_symbols: false + # signpath: false + # sccache_triplet: aarch64-apple-darwin + # packager: cpack --verbose --config build/CPackConfig.cmake -C Release - os: windows-latest cross_os: '' @@ -274,53 +274,53 @@ jobs: cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo - - os: windows-latest - cross_os: '' - component: 'Tools' - qt: 5.15.14 - arch: x86_64 - sccache_triplet: x86_64-pc-windows-msvc - build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja - build_type: RelWithDebInfo - collect_symbols: false - signpath: false - qt_pre_build: > - choco install gperf jom winflexbison3 && - New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && - New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe - ffmpeg_pre_build: > - choco install yasm - # Copying files is a disgusting hack because windeployqt does not - # search PATH to find DLLs and it gets confused by QtKeychain having - # a Qt prefix and thinks it is part of Qt and tries to process it - # and fails if it is not in the Qt bin directory with the rest of - # them - packager: > - cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && - cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo - - - os: windows-latest - qt: 5.15.14 - arch: x86 - sccache_triplet: x86_64-pc-windows-msvc - build_flags: -DCARGO_TRIPLE=i686-pc-windows-msvc -DBUILD_PACKAGE_SUFFIX=x86 -G Ninja - build_type: RelWithDebInfo - collect_symbols: false - signpath: true - qt_pre_build: > - choco install gperf jom winflexbison3 && - New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && - New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe - ffmpeg_pre_build: > - choco install yasm - # Copying files is a disgusting hack because windeployqt does not - # search PATH to find DLLs and it gets confused by QtKeychain having - # a Qt prefix and thinks it is part of Qt and tries to process it - # and fails if it is not in the Qt bin directory with the rest of - # them - packager: > - cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && - cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo + # - os: windows-latest + # cross_os: '' + # component: 'Tools' + # qt: 5.15.14 + # arch: x86_64 + # sccache_triplet: x86_64-pc-windows-msvc + # build_flags: -DBUILD_PACKAGE_SUFFIX=x86_64 -G Ninja + # build_type: RelWithDebInfo + # collect_symbols: false + # signpath: false + # qt_pre_build: > + # choco install gperf jom winflexbison3 && + # New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && + # New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe + # ffmpeg_pre_build: > + # choco install yasm + # # Copying files is a disgusting hack because windeployqt does not + # # search PATH to find DLLs and it gets confused by QtKeychain having + # # a Qt prefix and thinks it is part of Qt and tries to process it + # # and fails if it is not in the Qt bin directory with the rest of + # # them + # packager: > + # cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && + # cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo + + # - os: windows-latest + # qt: 5.15.14 + # arch: x86 + # sccache_triplet: x86_64-pc-windows-msvc + # build_flags: -DCARGO_TRIPLE=i686-pc-windows-msvc -DBUILD_PACKAGE_SUFFIX=x86 -G Ninja + # build_type: RelWithDebInfo + # collect_symbols: false + # signpath: true + # qt_pre_build: > + # choco install gperf jom winflexbison3 && + # New-Item -Path C:\ProgramData\Chocolatey\bin\flex.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_flex.exe && + # New-Item -Path C:\ProgramData\Chocolatey\bin\bison.exe -ItemType SymbolicLink -Value C:\ProgramData\Chocolatey\bin\win_bison.exe + # ffmpeg_pre_build: > + # choco install yasm + # # Copying files is a disgusting hack because windeployqt does not + # # search PATH to find DLLs and it gets confused by QtKeychain having + # # a Qt prefix and thinks it is part of Qt and tries to process it + # # and fails if it is not in the Qt bin directory with the rest of + # # them + # packager: > + # cp .github/deps/other/bin/qt*.dll .github/deps/qt/bin && + # cpack --verbose --config build/CPackConfig.cmake -C RelWithDebInfo steps: @@ -357,9 +357,9 @@ jobs: brew install yasm if: runner.os == 'macOS' - - name: Install pkg-config for building and linking to ffmpeg in Windows + - name: Install pkg-config and rcedit on Windows run: | - choco install pkgconfiglite + choco install pkgconfiglite rcedit if: runner.os == 'Windows' - name: Add msbuild to PATH @@ -488,6 +488,26 @@ jobs: WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }} if: runner.os == 'Windows' && matrix.packager && (!startsWith(github.ref, 'refs/tags/') || !matrix.signpath) + - name: Figure out Windows product version from build version + run: > + cmake + "-DBUILD_VERSION=2.3.4-beta.5" + "-DOUTPUT_PATH=$env:GITHUB_ENV" + "-DSEARCH_PATHS=${{ matrix.cross_os && format('{0};', steps.cross-deps.outputs.path) }}${{ steps.deps.outputs.path }}" + -P ".github/scripts/build-to-product-version.cmake" + if: runner.os == 'Windows' && matrix.packager + # if: runner.os == 'Windows' && matrix.packager && startsWith(github.ref, 'refs/tags/') && matrix.signpath + + - name: Set product name and version of dependencies on Windows + run: > + cmake + -DPRODUCT_NAME="Drawpile client" + "-DPRODUCT_VERSION=$env:WINDOWS_PRODUCT_VERSION" + "-DSEARCH_PATHS=${{ matrix.cross_os && format('{0};', steps.cross-deps.outputs.path) }}${{ steps.deps.outputs.path }}" + -P ".github/scripts/edit-pe-metadata.cmake" + if: runner.os == 'Windows' && matrix.packager + # if: runner.os == 'Windows' && matrix.packager && startsWith(github.ref, 'refs/tags/') && matrix.signpath + - name: Generate project run: > cmake -S . -B build --log-level=VERBOSE @@ -543,6 +563,16 @@ jobs: WINDOWS_PFX_PASS: ${{ secrets.WINDOWS_CERTIFICATE_PASS }} WINDOWS_PFX_TIMESTAMP_URL: 'http://timestamp.digicert.com' + - name: Set product name and version of built files on Windows + run: > + cmake + "-DPRODUCT_NAME=Drawpile client" + "-DPRODUCT_VERSION=$env:WINDOWS_PRODUCT_VERSION" + "-DSEARCH_PATHS=build" + -P ".github/scripts/edit-pe-metadata.cmake" + if: runner.os == 'Windows' && matrix.packager + # if: runner.os == 'Windows' && matrix.packager && startsWith(github.ref, 'refs/tags/') && matrix.signpath + - name: Run C++ tests run: ctest -C ${{ matrix.build_type }} --output-on-failure working-directory: build @@ -586,6 +616,7 @@ jobs: parameters: | Version: "${{ github.ref_name }}" Release_Tag: "${{ github.ref_name }}" + Product_Version: "${{ env.WINDOWS_PRODUCT_VERSION }}" if: runner.os == 'Windows' && matrix.packager && startsWith(github.ref, 'refs/tags/') && matrix.signpath - name: Delete unsigned executable uploaded for SignPath after signing diff --git a/cmake/DrawpileVersions.cmake b/cmake/DrawpileVersions.cmake index 92eba378f6..6cd0e3f299 100644 --- a/cmake/DrawpileVersions.cmake +++ b/cmake/DrawpileVersions.cmake @@ -38,18 +38,18 @@ endif() unset(semver_regexp) function(calculate_android_version_code out_var version abi_name) - if(version MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)") + if(version MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)") set(server "${CMAKE_MATCH_1}") set(major "${CMAKE_MATCH_2}") set(minor "${CMAKE_MATCH_3}") - if(version MATCHES "-beta\.([0-9]+)") + if(version MATCHES "-beta\\.([0-9]+)") set(beta "${CMAKE_MATCH_1}") else() set(beta 0) endif() - if(version MATCHES "-fix\.([0-9]+)") + if(version MATCHES "-fix\\.([0-9]+)") set(fix "${CMAKE_MATCH_1}") else() set(fix 0)