From 6f24ce2c8fddea33375d291c6b47b3acdf6736e1 Mon Sep 17 00:00:00 2001 From: awawa-dev <69086569+awawa-dev@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:55:03 +0200 Subject: [PATCH] Update --- .github/workflows/push-master.yml | 210 +----------------------------- cmake/Dependencies.cmake | 46 ++++++- 2 files changed, 45 insertions(+), 211 deletions(-) diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index 21b501590..8dcb056aa 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -12,118 +12,7 @@ env: jobs: -###################### -###### Linux ######### -###################### - - Linux: - name: ${{ matrix.dockerName }} - runs-on: ubuntu-22.04 - - strategy: - matrix: - linuxVersion: [ bullseye ] - dockerImage: [ x86_64, arm-32bit-armv6l, arm-64bit-aarch64 ] - include: - - dockerImage: x86_64 - linuxVersion: bullseye - dockerName: Debian Bullseye (x86_64) - platform: linux - - dockerImage: x86_64 - linuxVersion: bookworm - dockerName: Debian Bookworm (x86_64) - platform: linux - - dockerImage: x86_64 - linuxVersion: jammy - dockerName: Ubuntu 22.04 LTS (x86_64) - platform: linux - - dockerImage: x86_64 - linuxVersion: noble - dockerName: Ubuntu 24.04 LTS (x86_64) - platform: linux - - dockerImage: arm-32bit-armv6l - linuxVersion: bullseye - dockerName: Debian Bullseye (ARM 32-bit Raspberry Pi OS) - platform: rpi - - dockerImage: arm-64bit-aarch64 - linuxVersion: bullseye - dockerName: Debian Bullseye (ARM 64-bit Raspberry Pi OS) - platform: rpi - - dockerImage: arm-32bit-armv6l - linuxVersion: bookworm - dockerName: Debian Bookworm (ARM 32-bit Raspberry Pi OS) - platform: rpi - - dockerImage: arm-64bit-aarch64 - linuxVersion: bookworm - dockerName: Debian Bookworm (ARM 64-bit Raspberry Pi OS) - platform: rpi - - dockerImage: x86_64 - linuxVersion: Fedora_40 - dockerName: Fedora 40 (x86_64) - platform: linux - - dockerImage: x86_64 - linuxVersion: ArchLinux - dockerName: Arch Linux (x86_64) - platform: linux - steps: - # checkout - - uses: actions/checkout@v4 - with: - submodules: true - # generate cache id - - name: Prepare ccache timestamp - if: env.USE_CACHE == '1' - id: ccache_cache_timestamp - shell: cmake -P {0} - run: | - string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC) - file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}") - - # download cache - - name: ccache cache files - if: ( env.USE_CACHE == '1' ) - uses: actions/cache@v4 - with: - path: .ccache - key: ${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }} - restore-keys: ${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-ccache- - - - name: Check default version - if: matrix.linuxVersion != 'bullseye' - run: | - echo "USE_STANDARD_INSTALLER_NAME=ON" >> $GITHUB_ENV - - - name: Build packages - env: - DOCKER_IMAGE: ${{ matrix.dockerImage }} - DOCKER_TAG: ${{ matrix.linuxVersion }} - DOCKER_NAME: ${{ matrix.dockerName }} - PLATFORM: ${{ matrix.platform }} - USE_CCACHE: ${{ env.USE_CACHE }} - RESET_CACHE: ${{ env.RESET_CACHE }} - shell: bash - run: | - ./.ci/ci_build.sh - - # Upload artifacts (only on tagged commit) - - name: Upload artifacts - if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: release-artifact-${{ matrix.linuxVersion }}-${{ matrix.dockerImage }} - path: deploy/Hyper* - - # Upload artifacts from commit - - name: Upload artifacts from commit - if: (startsWith(github.event.ref, 'refs/tags') != true) && github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: Linux-${{ matrix.linuxVersion }}-${{ matrix.dockerImage }}-installer - path: | - deploy/Hyper*.deb - deploy/Hyper*.zst - deploy/Hyper*.rpm ###################### ######## macOS ####### @@ -135,10 +24,6 @@ jobs: strategy: matrix: include: - - JOB_RUNNER: macos-14 - JOB_NAME: macOS 14 (arm64/M1/M2) - QT_VERSION: 6 - NICE_NAME: arm64_M1_M2 - JOB_RUNNER: macos-13 JOB_NAME: macOS 13 (x64) QT_VERSION: 6 @@ -205,99 +90,6 @@ jobs: name: Apple_macOS_${{ matrix.NICE_NAME }}_DMG_installer path: build/Hyper*.dmg -###################### -###### Windows ####### -###################### - - windows: - name: Windows - runs-on: windows-2022 - env: - VCINSTALLDIR: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' - QT_VERSION: 6.5.3 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true - - - name: Cache Qt - uses: actions/cache@v4 - id: cache-qt-windows - with: - path: ${{ runner.workspace }}/Qt - key: ${{ runner.os }}-Qt.${{ env.QT_VERSION }} - - - name: Install QT - if: steps.cache-qt-windows.outputs.cache-hit != 'true' - run: | - pip install aqtinstall - aqt install-qt -O ${{ runner.workspace }}/Qt windows desktop ${{ env.QT_VERSION }} win64_msvc2019_64 -m qtserialport - - - name: Install TurboJPEG - shell: powershell - run: | - Invoke-WebRequest -Method Get -Uri https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.0.3/libjpeg-turbo-3.0.3-vc64.exe -OutFile turbojpeg.exe -UseBasicParsing - Start-Process -Wait turbojpeg.exe -ArgumentList "/S" - - - name: Set up x64 build architecture environment - shell: cmd - run: call "${{env.VCINSTALLDIR}}\Auxiliary\Build\vcvars64.bat" - - # Build packages - - name: Build packages - env: - PLATFORM: windows - CMAKE_PREFIX_PATH: "${{ runner.workspace }}/Qt/${{ env.QT_VERSION }}/msvc2019_64/lib/cmake/" - USE_CCACHE: ${{ env.USE_CACHE }} - shell: bash - run: | - ./.ci/ci_build.sh - - # Upload artifacts (only on tagged commit) - - name: Upload artifacts - if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: release-artifact-windows - path: build/Hyper* - - # Upload artifacts from commit - - name: Upload artifacts from commit - if: (startsWith(github.event.ref, 'refs/tags') != true) && github.event_name != 'pull_request' - uses: actions/upload-artifact@v4 - with: - name: Windows_x64_setup - path: build/Hyper*.exe - -################################ -####### CodeQL support ######### -################################ - - analyze: - name: Analyze (CodeQL) - runs-on: ubuntu-latest - if: ( true ) - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp', 'javascript' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: true - - - name: Run composite CodeQL job for '${{matrix.language}}' language - uses: ./.github/actions/codeql - with: - language: ${{matrix.language}} ################################ ###### Publish Releases ######## @@ -306,7 +98,7 @@ jobs: publish: name: Publish Releases if: startsWith(github.event.ref, 'refs/tags') && github.event_name != 'pull_request' - needs: [Linux, windows, macOS] + needs: [macOS] runs-on: ubuntu-22.04 permissions: contents: write diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 33587e393..946c28a9f 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -16,6 +16,18 @@ macro(DeployApple TARGET) install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION "hyperhdr.app/Contents/Resources" COMPONENT "HyperHDR") install(FILES "${PROJECT_SOURCE_DIR}/3RD_PARTY_LICENSES" DESTINATION "hyperhdr.app/Contents/Resources" COMPONENT "HyperHDR") + if ( Qt5Core_FOUND ) + get_target_property(MYQT_QMAKE_EXECUTABLE ${Qt5Core_QMAKE_EXECUTABLE} IMPORTED_LOCATION) + else() + SET (MYQT_QMAKE_EXECUTABLE "${_qt_import_prefix}/../../../bin/qmake") + endif() + + execute_process( + COMMAND ${MYQT_QMAKE_EXECUTABLE} -query QT_INSTALL_PLUGINS + OUTPUT_VARIABLE MYQT_PLUGINS_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + install(CODE "set(MYQT_PLUGINS_DIR \"${MYQT_PLUGINS_DIR}\")" COMPONENT "HyperHDR") install(CODE "set(MY_DEPENDENCY_PATHS \"${TARGET_FILE}\")" COMPONENT "HyperHDR") install(CODE "set(MY_SYSTEM_LIBS_SKIP \"${SYSTEM_LIBS_SKIP}\")" COMPONENT "HyperHDR") install(CODE "set(SCOPE_Qt_VERSION ${Qt_VERSION})" COMPONENT "HyperHDR") @@ -116,10 +128,40 @@ macro(DeployApple TARGET) list(LENGTH _u_deps _u_length) if("${_u_length}" GREATER 0) message(WARNING "Unresolved dependencies detected!") - endif() + endif() + + foreach(PLUGIN "tls") + if(EXISTS ${MYQT_PLUGINS_DIR}/${PLUGIN}) + file(GLOB files "${MYQT_PLUGINS_DIR}/${PLUGIN}/*") + foreach(file ${files}) + file(GET_RUNTIME_DEPENDENCIES + EXECUTABLES ${file} + RESOLVED_DEPENDENCIES_VAR PLUGINS + UNRESOLVED_DEPENDENCIES_VAR _u_deps + ) + + foreach(DEPENDENCY ${PLUGINS}) + file(INSTALL + DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib" + TYPE SHARED_LIBRARY + FILES ${DEPENDENCY} + ) + endforeach() + + get_filename_component(singleQtLib ${file} NAME) + list(APPEND MYQT_PLUGINS "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/plugins/${PLUGIN}/${singleQtLib}") + file(INSTALL + DESTINATION "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/plugins/${PLUGIN}" + TYPE SHARED_LIBRARY + FILES ${file} + ) + + endforeach() + endif() + endforeach() include(BundleUtilities) - fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "" "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib") + fixup_bundle("${CMAKE_INSTALL_PREFIX}/hyperhdr.app" "${MYQT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib") file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/hyperhdr.app/Contents/lib") file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/share")