diff --git a/.github/workflows/build.linux.workflow.yml b/.github/workflows/build.linux.workflow.yml index 0b156bd7e..7e9f4798e 100644 --- a/.github/workflows/build.linux.workflow.yml +++ b/.github/workflows/build.linux.workflow.yml @@ -2,7 +2,7 @@ name: Build Linux on: push: - branches: [ master, feature/github-actions ] + branches: [ master, feature/github-actions, ci_linux_static ] pull_request: branches: [ master, feature/github-actions ] release: @@ -18,16 +18,12 @@ jobs: os: [ubuntu-20.04] arch: [x64] config: [Release] - statictype: [ON, OFF] + statictype: [ON] include: - statictype: ON qtver: Qt6 host_triplet: release release_suffix: static - - statictype: OFF - qtver: Qt6-Dynamic - host_triplet: dynamic - release_suffix: shared steps: - name: Checkout Git Repo @@ -42,7 +38,7 @@ jobs: - name: Install dependencies run: | set -e - sudo apt install -y autoconf automake autoconf-archive '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev + sudo apt install -y autoconf automake autoconf-archive '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev libbsd-dev - name: Install latest CMake uses: lukka/get-cmake@a70f1cfa1857a3eecfe0d34962269e1b1e8be56c # latest as of 2024-08-08 diff --git a/.github/workflows/build.mac.workflow.yml b/.github/workflows/build.mac.workflow.yml deleted file mode 100644 index 1addfffdc..000000000 --- a/.github/workflows/build.mac.workflow.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: Build macOS - -on: - push: - branches: [ master, feature/github-actions ] - pull_request: - branches: [ master, feature/github-actions ] - release: - types: [published] - -jobs: - build: - name: "Build: ${{ matrix.os }} Qt${{ matrix.qtvershort }}" - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-12, macos-13, macos-14] - config: [Release] - include: - - os: macos-12 - arch: x64 - qtver: Qt5 - qtvershort: "5_intel" - - os: macos-13 - arch: x64 - qtver: Qt6 - qtvershort: "6_intel" - - os: macos-14 - arch: arm64 - qtver: Qt6 - qtvershort: "6_arm" - - steps: - - name: Checkout Git Repo - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install dependencies - run: | - set -e - brew install automake autoconf libtool - - - name: Install latest CMake - uses: lukka/get-cmake@a70f1cfa1857a3eecfe0d34962269e1b1e8be56c # latest as of 2024-08-08 - - - name: Restore artifacts, or setup vcpkg (do not install any package) - uses: lukka/run-vcpkg@d87e7fac99f22776a4973d7e413921ea254c1fc9 # latest as of 2024-08-08 - with: - vcpkgJsonGlob: '**/gui/qt/vcpkg.json' - - - name: Build CEmu ${{ matrix.qtver }} ${{ matrix.config }} on MacOS ${{ matrix.arch }} - uses: lukka/run-cmake@4b1adc1944be8367be9f4e08303ce49918db8e3c # latest as of 2024-08-08 - with: - cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt' - configurePreset: 'Mac-${{ matrix.arch }}-${{ matrix.qtver }}' - configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON']" - buildPreset: 'Mac-${{ matrix.arch }}-${{ matrix.qtver }}-${{ matrix.config }}' - env: - VCPKG_DEFAULT_HOST_TRIPLET: ${{ matrix.arch }}-osx-release - VCPKG_FORCE_SYSTEM_BINARIES: 1 - - - name: Move to temp folder - run: | - mkdir -p /tmp/CEmu-nightly_mac_qt${{matrix.qtvershort}}/ - mv ${{ github.workspace }}/gui/qt/CEmu.build/Mac-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.app /tmp/CEmu-nightly_mac_qt${{matrix.qtvershort}}/ - - - name: "Codesign CEmu.app" - env: - HAVE_SECRETS: ${{ secrets.MACOS_CERTIFICATE_PWD != '' }} - MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} - MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} - MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }} - MACOS_CODESIGN_IDENT: ${{ secrets.MACOS_CODESIGN_IDENT }} - if: ${{ runner.os == 'macOS' && github.repository == 'CE-Programming/CEmu' && env.HAVE_SECRETS == 'true' }} - run: | - echo $MACOS_CERTIFICATE | base64 -d > certificate.p12 - security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain - security default-keychain -s build.keychain - security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain - security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign - security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain - /usr/bin/codesign --deep --force --verify --verbose --sign "$MACOS_CODESIGN_IDENT" --timestamp --options runtime /tmp/CEmu-nightly_mac_qt${{matrix.qtvershort}}/CEmu.app - - - name: "Create the DMG" - run: | - brew install create-dmg || brew install create-dmg; # we try twice because sometimes it fails... - # The codesign variable may be empty (for forks) but that's fine, create-dmg only does code-signing if it's not empty. - createDmgArgs="--codesign '${{ secrets.MACOS_CODESIGN_IDENT }}' \ - --volname 'CEmu-nightly Qt${{matrix.qtvershort}}' \ - --window-pos 200 120 \ - --window-size 600 400 \ - --icon-size 64 \ - --icon 'CEmu.app' 125 200 \ - --app-drop-link 400 200 \ - 'CEmu-nightly_mac_qt${{matrix.qtvershort}}.dmg' \ - '/tmp/CEmu-nightly_mac_qt${{matrix.qtvershort}}/'" - eval "create-dmg $createDmgArgs" || eval "create-dmg $createDmgArgs" # We also retry just in case... - - - name: "[macOS] Notarize and staple DMG" - if: ${{ runner.os == 'macOS' && github.repository == 'CE-Programming/CEmu' && env.HAVE_SECRETS == 'true' }} - env: - HAVE_SECRETS: ${{ secrets.APPLE_NOTARIZATION_PASSWORD != '' }} - APPLE_NOTARIZATION_USERNAME: ${{ secrets.APPLE_NOTARIZATION_USERNAME }} - APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }} - APPLE_NOTARIZATION_TEAMID: ${{ secrets.APPLE_NOTARIZATION_TEAMID }} - run: | - xcrun notarytool store-credentials "notarytool-profile" --apple-id "$APPLE_NOTARIZATION_USERNAME" --team-id "$APPLE_NOTARIZATION_TEAMID" --password "$APPLE_NOTARIZATION_PASSWORD" - xcrun notarytool submit "CEmu-nightly_mac_qt${{matrix.qtvershort}}.dmg" --keychain-profile "notarytool-profile" --wait - xcrun stapler staple "CEmu-nightly_mac_qt${{matrix.qtvershort}}.dmg" - - - name: Upload dmg as artifact - uses: actions/upload-artifact@v3 - with: - name: CEmu-nightly_mac_qt${{matrix.qtvershort}} - path: CEmu-nightly_mac_qt${{matrix.qtvershort}}.dmg - - - name: Update nightly release - if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' - uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b # latest as of 2023-01-13 - with: - tag_name: nightly - prerelease: true - token: ${{secrets.GITHUB_TOKEN}} - files: | - CEmu-nightly_mac_qt${{matrix.qtvershort}}.dmg diff --git a/.github/workflows/build.windows.workflow.yml b/.github/workflows/build.windows.workflow.yml deleted file mode 100644 index b8fb495fd..000000000 --- a/.github/workflows/build.windows.workflow.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Build Windows - -on: - push: - branches: [ master, feature/github-actions ] - pull_request: - branches: [ master, feature/github-actions ] - release: - types: [published] - -jobs: - build: - name: "Build: Windows ${{ matrix.arch }}-${{ matrix.config }}-${{ matrix.qtver }}" - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - arch: [x64, x86] - qtver: [Qt5, Qt6] - config: [Release] - exclude: - - arch: x86 - qtver: Qt6 - include: - - arch: x64 - arch_name: 64-bit - arch_suffix: "64" - deps_release_only: "ON" - - arch: x86 - arch_name: 32-bit - arch_suffix: "32" - deps_release_only: "OFF" - steps: - - name: Remove Perl Strawberry installation - # Removes conflicting headers from include paths - run: | - Remove-Item -Recurse -Force C:/Strawberry - - - name: Checkout Git Repo - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install latest CMake - uses: lukka/get-cmake@a70f1cfa1857a3eecfe0d34962269e1b1e8be56c # latest as of 2024-08-08 - - - name: Restore artifacts, or setup vcpkg (do not install any package) - uses: lukka/run-vcpkg@d87e7fac99f22776a4973d7e413921ea254c1fc9 # latest as of 2024-08-08 - with: - vcpkgJsonGlob: '**/gui/qt/vcpkg.json' - - - name: Build CEmu ${{ matrix.qtver }} ${{ matrix.config }} on Windows ${{ matrix.arch_name }} - uses: lukka/run-cmake@4b1adc1944be8367be9f4e08303ce49918db8e3c # latest as of 2024-08-08 - with: - cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt' - configurePreset: 'Win-${{ matrix.arch }}-${{ matrix.qtver }}' - configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=${{ matrix.deps_release_only }}']" - buildPreset: 'Win-${{ matrix.arch }}-${{ matrix.qtver }}-${{ matrix.config }}' - env: - VCPKG_DEFAULT_TRIPLET: ${{ matrix.arch }}-windows - VCPKG_DEFAULT_HOST_TRIPLET: x64-windows-static-release - VCPKG_FORCE_SYSTEM_BINARIES: 1 - - - name: Upload ${{ matrix.arch_name }} ${{ matrix.config }} ${{ matrix.qtver }} EXE - uses: actions/upload-artifact@v3 - with: - name: CEmu_win${{ matrix.arch_suffix }}_${{ matrix.qtver }}_master - path: ${{ github.workspace }}/gui/qt/CEmu.build/Win-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.exe - - - name: Prepare binary for release upload - if: ${{ matrix.config == 'Release' }} - run: | - $ReleaseName = "CEmu-nightly_win${{ matrix.arch_suffix }}-msvc_${{ matrix.qtver }}.exe".Replace("Qt", "qt") - Rename-Item -Path "${{ github.workspace }}/gui/qt/CEmu.build/Win-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/CEmu.exe" -NewName $ReleaseName - echo "RELEASE_NAME=$ReleaseName" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - - name: Update nightly release - if: ${{ matrix.config == 'Release' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }} - uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b # latest as of 2023-01-13 - with: - tag_name: nightly - prerelease: true - token: ${{secrets.GITHUB_TOKEN}} - files: | - ./gui/qt/CEmu.build/Win-${{ matrix.arch }}-${{ matrix.qtver }}/${{ matrix.config }}/${{ env.RELEASE_NAME }} diff --git a/.github/workflows/coverity.workflow.yml b/.github/workflows/coverity.workflow.yml deleted file mode 100644 index f13581259..000000000 --- a/.github/workflows/coverity.workflow.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Coverity Scan - -# We only want to test official release code, not every pull request. -on: - push: - branches: [master] - -jobs: - coverity: - runs-on: ubuntu-20.04 - steps: - - name: Checkout Git Repo - uses: actions/checkout@v3 - with: - submodules: 'recursive' - - - name: Install Linux dependencies (Ubuntu 18.04+) - run: | - set -e - sudo apt-get update - sudo apt-get install qt5-default qtbase5-dev libgl1-mesa-dev libarchive-dev - - - name: Prepare build - run: | - set -e - cd gui/qt/capture ; /bin/bash ./get_libpng-apng.sh ; cd ../../../ - mkdir build - cd build - qmake ../gui/qt - - - uses: vapier/coverity-scan-action@v1 - with: - email: ${{ secrets.COVERITY_SCAN_EMAIL }} - token: ${{ secrets.COVERITY_SCAN_TOKEN }} - working-directory: "${{ github.workspace }}/build" - diff --git a/gui/qt/CMakeLists.txt b/gui/qt/CMakeLists.txt index 0dd213fd1..1460a6176 100644 --- a/gui/qt/CMakeLists.txt +++ b/gui/qt/CMakeLists.txt @@ -275,6 +275,12 @@ else() message(WARNING "No LibPNG found! APNG capture will not be available") endif() +if(LINUX AND TRY_STATIC_LIBS) + target_link_libraries(CEmu PRIVATE + -lxcb -lxcb-image + ) +endif() + target_link_libraries(CEmu PRIVATE Qt::Core Qt::Gui @@ -283,6 +289,14 @@ target_link_libraries(CEmu PRIVATE Qt::Widgets ) +if(LINUX AND TRY_STATIC_LIBS) + target_link_libraries(CEmu PRIVATE + /usr/lib/x86_64-linux-gnu/libXau.a + /usr/lib/x86_64-linux-gnu/libXdmcp.a + /usr/lib/x86_64-linux-gnu/libbsd.a + ) +endif() + include(CheckIPOSupported) check_ipo_supported(RESULT lto_supported OUTPUT error) if(lto_supported)