From 891fe8c39d48749a091358745184359b844afa7b Mon Sep 17 00:00:00 2001 From: askmeaboutloom Date: Sun, 4 Aug 2024 09:37:05 +0200 Subject: [PATCH] WIP --- .github/scripts/build-ffmpeg.cmake | 53 ++--- .github/scripts/cmake/BuildDependency.cmake | 9 + .github/workflows/main.yml | 213 +------------------- 3 files changed, 42 insertions(+), 233 deletions(-) diff --git a/.github/scripts/build-ffmpeg.cmake b/.github/scripts/build-ffmpeg.cmake index eed9df103..99ec5774f 100644 --- a/.github/scripts/build-ffmpeg.cmake +++ b/.github/scripts/build-ffmpeg.cmake @@ -22,6 +22,34 @@ set(TARGET_ARCH "x86_64" CACHE STRING include(BuildDependency) +if(LIBX264) + build_dependency(x264 ${LIBX264} ${BUILD_TYPE} + URL https://code.videolan.org/videolan/x264/-/archive/@version@/x264-@version@.tar.gz + TARGET_ARCH "${TARGET_ARCH}" + VERSIONS + 31e19f92f00c7003fa115047ce50978bc98c3a0d + SHA384=bed835fcf11b4befa8341661b996c4f51842dfee6f7f87c9c2e767cebca0b7871a7f59435b4e92d89c2b13a659d1d737 + ALL_PLATFORMS + AUTOMAKE + ASSIGN_HOST ASSIGN_PREFIX WIN32_CC_CL + QUIRKS x264 + ALL + --enable-static + --enable-pic + --disable-lavf + --disable-swscale + --disable-avs + --disable-ffms + --disable-gpac + --disable-lsmash + --disable-bashcompletion + --disable-cli + --enable-strip + ) +endif() + +message(FATAL_ERROR "ok bail out") + if(LIBWEBP) set(libwebp_cmake_args -DBUILD_SHARED_LIBS=OFF @@ -164,31 +192,6 @@ if(LIBVPX) endif() endif() -if(LIBX264) - build_dependency(x264 ${LIBX264} ${BUILD_TYPE} - URL https://code.videolan.org/videolan/x264/-/archive/@version@/x264-@version@.tar.gz - TARGET_ARCH "${TARGET_ARCH}" - VERSIONS - 31e19f92f00c7003fa115047ce50978bc98c3a0d - SHA384=bed835fcf11b4befa8341661b996c4f51842dfee6f7f87c9c2e767cebca0b7871a7f59435b4e92d89c2b13a659d1d737 - ALL_PLATFORMS - AUTOMAKE - ASSIGN_HOST ASSIGN_PREFIX WIN32_CC_CL - ALL - --enable-static - --enable-pic - --disable-lavf - --disable-swscale - --disable-avs - --disable-ffms - --disable-gpac - --disable-lsmash - --disable-bashcompletion - --disable-cli - --enable-strip - ) -endif() - if(FFMPEG) set(ffmpeg_configure_args # This referes to warnings in configure, not build warnings. Warnings diff --git a/.github/scripts/cmake/BuildDependency.cmake b/.github/scripts/cmake/BuildDependency.cmake index a52b58d37..3a61be189 100644 --- a/.github/scripts/cmake/BuildDependency.cmake +++ b/.github/scripts/cmake/BuildDependency.cmake @@ -171,6 +171,15 @@ function(_build_automake build_type target_bits source_dir) # Dito for libvpx, but a different kind of weird. We don't need # to pass anything extra, it's alread taken care of by # specifying a target platform in the caller. + elseif(ARG_QUIRKS STREQUAL x264) + # Configure only checks if a function is linkable, but not if + # it actually exists. That's somehow busted on 32 bit Android + # because it doesn't end up being declared in the headers, but + # either it still works fine or the code we're using never + # calls this stuff. So just disable this error. + if(target_bits EQUAL 32) + list(APPEND env "CFLAGS=-Wno-error=implicit-function-declaration") + endif() else() message(FATAL_ERROR "Unknown QUIRKS: '${ARG_QUIRKS}'") endif() diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7efd22245..25cbc7bee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,120 +43,6 @@ 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 - # 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 - packager: cmake --install build --config Release --prefix . - cross_qt_args: >- - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - "-DANDROID_HOST_PATH=$GITHUB_WORKSPACE/.github/deps/qt" - -DANDROID_ABI=arm64-v8a - cross_ffmpeg_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - -DANDROID_PLATFORM=android-23 - -DANDROID_ABI=arm64-v8a - cross_other_args: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" - "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" - -DANDROID_PLATFORM=android-23 - -DANDROID_ABI=arm64-v8a - build_flags: >- - "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" - -DANDROID_PLATFORM=android-23 - -DANDROID_ABI=arm64-v8a - -DANDROID_SDK_PLATFORM=android-31 - -DANDROID_SDK_BUILD_TOOLS_REVISION=34.0.0 - -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: '' @@ -177,6 +63,10 @@ jobs: "-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT" -DANDROID_PLATFORM=android-23 -DANDROID_ABI=armeabi-v7a + cross_ffmpeg_pre_build: > + sudo apt-get update && + sudo apt-get install --no-install-recommends + nasm yasm cross_other_args: >- "-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" "-DANDROID_SDK_ROOT=$ANDROID_SDK_ROOT" @@ -216,105 +106,12 @@ jobs: ffmpeg_pre_build: > sudo apt-get update && sudo apt-get install --no-install-recommends - yasm + nasm 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 - 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 - sccache_triplet: aarch64-apple-darwin - packager: cpack --verbose --config build/CPackConfig.cmake -C Release - - - os: windows-latest - cross_os: '' - component: '' - 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: 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 - 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 - 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: - name: Check out code uses: actions/checkout@v4