From 76f82f0ac0757a43d35b32c2666299774b4a72c0 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Fri, 24 Mar 2023 18:26:21 -0400 Subject: [PATCH 1/9] deps.windows: Disable IPO in SpeexDSP build Interprocedural Optimization (INTERPROCEDURAL_OPTIMIZATION / IPO) is interpreted by CMake as Link-time code generation (LTCG). This causes build problems on Windows when Visual Studio versions mismatch, so let's remove it. --- deps.windows/30-speexdsp.ps1 | 2 +- .../patches/speexdsp/0001-Add-CMakeLists.patch | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/deps.windows/30-speexdsp.ps1 b/deps.windows/30-speexdsp.ps1 index 20fb11293..f5ad3032c 100644 --- a/deps.windows/30-speexdsp.ps1 +++ b/deps.windows/30-speexdsp.ps1 @@ -6,7 +6,7 @@ param( [array] $Patches = @( @{ PatchFile = "${PSScriptRoot}/patches/speexdsp/0001-Add-CMakeLists.patch" - HashSum = 'a7e625bdf83fea2c0d0a215e7e04a44c0ac0f892217895481723e33e0008ba18' + HashSum = 'e8814dbc5683ce6a3c70553147fbdca92b74aab45ceb06e0040127754fe991c5' } ) ) diff --git a/deps.windows/patches/speexdsp/0001-Add-CMakeLists.patch b/deps.windows/patches/speexdsp/0001-Add-CMakeLists.patch index 6cc1d1739..87ff3e767 100644 --- a/deps.windows/patches/speexdsp/0001-Add-CMakeLists.patch +++ b/deps.windows/patches/speexdsp/0001-Add-CMakeLists.patch @@ -1,6 +1,6 @@ ---- null 2022-11-22 18:00:00.000000000 -0500 -+++ ./CMakeLists.txt 2022-11-22 18:00:00.000000000 -0500 -@@ -0,0 +1,90 @@ +--- null 2023-03-24 18:30:00.000000000 -0400 ++++ ./CMakeLists.txt 2023-03-24 18:30:00.000000000 -0400 +@@ -0,0 +1,83 @@ +cmake_minimum_required(VERSION 3.16) + +project(speexdsp) @@ -79,13 +79,6 @@ + "include" + ) + -+ include(CheckIPOSupported) -+ check_ipo_supported(RESULT HasIPOSupport) -+ if(HasIPOSupport) -+ set_target_properties(speexdsp PROPERTIES -+ INTERPROCEDURAL_OPTIMIZATION ON) -+ endif() -+ + install(TARGETS speexdsp + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/speex" From 4aa7eeff06a522db6f5e1c1a73075bbb4c83b147 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Sun, 26 Mar 2023 00:25:35 -0400 Subject: [PATCH 2/9] Revert "deps.ffmpeg: Update mbedTLS to 3.3.0" This reverts commit a050e86d64cace723849b68afeba35d4b3637353. --- deps.ffmpeg/60-mbedtls.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deps.ffmpeg/60-mbedtls.zsh b/deps.ffmpeg/60-mbedtls.zsh index 6052a52dd..bca245c30 100644 --- a/deps.ffmpeg/60-mbedtls.zsh +++ b/deps.ffmpeg/60-mbedtls.zsh @@ -3,15 +3,15 @@ autoload -Uz log_debug log_error log_info log_status log_output ## Dependency Information local name='mbedtls' local -A versions=( - macos 3.3.0 - linux 3.3.0 - windows 3.3.0 + macos 3.2.1 + linux 3.2.1 + windows 3.2.1 ) local url='https://github.com/Mbed-TLS/mbedtls.git' local -A hashes=( - macos 8c89224991adff88d53cd380f42a2baa36f91454 - linux 8c89224991adff88d53cd380f42a2baa36f91454 - windows 8c89224991adff88d53cd380f42a2baa36f91454 + macos 869298bffeea13b205343361b7a7daf2b210e33d + linux 869298bffeea13b205343361b7a7daf2b210e33d + windows 869298bffeea13b205343361b7a7daf2b210e33d ) local -a patches=( "macos ${0:a:h}/patches/mbedtls/0001-enable-posix-threading-support.patch \ From 1a977b8ac95ac2bab5e6dbfd34e029ad06933548 Mon Sep 17 00:00:00 2001 From: Ryan Foster Date: Wed, 29 Mar 2023 12:16:14 -0400 Subject: [PATCH 3/9] deps.ffmpeg: Update FFmpeg to 3980415627 FFmpeg n6.0 has a bug with NVENC that causes OBS to crash. It was fixed in the commit immediatley after the n6.0 tag. There is currently no n6.0.1 tag, so update to the latest release/6.0 commit so that OBS does not crash when using FFmpeg NVENC. --- deps.ffmpeg/99-ffmpeg.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.ffmpeg/99-ffmpeg.zsh b/deps.ffmpeg/99-ffmpeg.zsh index f19e25ebc..f9cb0f7fe 100644 --- a/deps.ffmpeg/99-ffmpeg.zsh +++ b/deps.ffmpeg/99-ffmpeg.zsh @@ -4,7 +4,7 @@ autoload -Uz log_debug log_error log_info log_status log_output local name='FFmpeg' local version='6.0' local url='https://github.com/FFmpeg/FFmpeg.git' -local hash='ea3d24bbe3c58b171e55fe2151fc7ffaca3ab3d2' +local hash='3980415627a187d188dc25669cea6b12912eb178' local -a patches=( "* ${0:a:h}/patches/FFmpeg/0001-FFmpeg-6.0-OBS.patch \ 7fcb67d5e68a6ca3102c3a6aaba56750b22850552ccd8704c6636c174968ef56" From f0c64ac0e24c16ab1ef0c4a00c1058943b286f15 Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 2 Apr 2023 03:18:23 +0200 Subject: [PATCH 4/9] deps.ffmpeg: Split FFmpeg patch files --- deps.ffmpeg/99-ffmpeg.zsh | 6 ++++-- .../patches/FFmpeg/0001-flvdec-handle-unknown.patch | 11 +++++++++++ ...peg-6.0-OBS.patch => 0002-libaomenc-presets.patch} | 11 ----------- 3 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 deps.ffmpeg/patches/FFmpeg/0001-flvdec-handle-unknown.patch rename deps.ffmpeg/patches/FFmpeg/{0001-FFmpeg-6.0-OBS.patch => 0002-libaomenc-presets.patch} (59%) diff --git a/deps.ffmpeg/99-ffmpeg.zsh b/deps.ffmpeg/99-ffmpeg.zsh index f9cb0f7fe..47dfded2d 100644 --- a/deps.ffmpeg/99-ffmpeg.zsh +++ b/deps.ffmpeg/99-ffmpeg.zsh @@ -6,8 +6,10 @@ local version='6.0' local url='https://github.com/FFmpeg/FFmpeg.git' local hash='3980415627a187d188dc25669cea6b12912eb178' local -a patches=( - "* ${0:a:h}/patches/FFmpeg/0001-FFmpeg-6.0-OBS.patch \ - 7fcb67d5e68a6ca3102c3a6aaba56750b22850552ccd8704c6636c174968ef56" + "* ${0:a:h}/patches/FFmpeg/0001-flvdec-handle-unknown.patch \ + 5a5185f54cbcf4672763cce687d1b6ddb662549b69637da826279ce4797f57ef" + "* ${0:a:h}/patches/FFmpeg/0002-libaomenc-presets.patch \ + d5f1410efb31fe31e8e905ec3f10ccb7841dd5594cb3591c3b205e77232fd183" ) ## Build Steps diff --git a/deps.ffmpeg/patches/FFmpeg/0001-flvdec-handle-unknown.patch b/deps.ffmpeg/patches/FFmpeg/0001-flvdec-handle-unknown.patch new file mode 100644 index 000000000..852f286ba --- /dev/null +++ b/deps.ffmpeg/patches/FFmpeg/0001-flvdec-handle-unknown.patch @@ -0,0 +1,11 @@ +--- ./libavformat/flvdec.c 2021-10-24 22:47:07.000000000 +0200 ++++ ./libavformat/flvdec.c 2021-11-08 13:13:47.000000000 +0100 +@@ -1077,7 +1077,7 @@ + int type; + meta_pos = avio_tell(s->pb); + type = flv_read_metabody(s, next); +- if (type == 0 && dts == 0 || type < 0) { ++ if (type == 0 && dts == 0 || type < 0 || type == TYPE_UNKNOWN) { + if (type < 0 && flv->validate_count && + flv->validate_index[0].pos > next && + flv->validate_index[0].pos - 4 < next) { diff --git a/deps.ffmpeg/patches/FFmpeg/0001-FFmpeg-6.0-OBS.patch b/deps.ffmpeg/patches/FFmpeg/0002-libaomenc-presets.patch similarity index 59% rename from deps.ffmpeg/patches/FFmpeg/0001-FFmpeg-6.0-OBS.patch rename to deps.ffmpeg/patches/FFmpeg/0002-libaomenc-presets.patch index 35ca4f261..e0baa16dc 100644 --- a/deps.ffmpeg/patches/FFmpeg/0001-FFmpeg-6.0-OBS.patch +++ b/deps.ffmpeg/patches/FFmpeg/0002-libaomenc-presets.patch @@ -1,14 +1,3 @@ ---- ./libavformat/flvdec.c 2021-10-24 22:47:07.000000000 +0200 -+++ ./libavformat/flvdec.c 2021-11-08 13:13:47.000000000 +0100 -@@ -1077,7 +1077,7 @@ - int type; - meta_pos = avio_tell(s->pb); - type = flv_read_metabody(s, next); -- if (type == 0 && dts == 0 || type < 0) { -+ if (type == 0 && dts == 0 || type < 0 || type == TYPE_UNKNOWN) { - if (type < 0 && flv->validate_count && - flv->validate_index[0].pos > next && - flv->validate_index[0].pos - 4 < next) { --- ./libavcodec/libaomenc.c 2021-10-24 22:47:07.000000000 +0200 +++ ./libavcodec/libaomenc.c 2021-11-08 13:15:54.000000000 +0100 @@ -1337,7 +1337,7 @@ From 0d2af15d7e5191acde1f74b9eaa3057407614a22 Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 3 Apr 2023 14:24:27 +0200 Subject: [PATCH 5/9] deps.ffmpeg: Update FFmpeg to a6dc929 --- deps.ffmpeg/99-ffmpeg.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.ffmpeg/99-ffmpeg.zsh b/deps.ffmpeg/99-ffmpeg.zsh index 47dfded2d..ca2629afa 100644 --- a/deps.ffmpeg/99-ffmpeg.zsh +++ b/deps.ffmpeg/99-ffmpeg.zsh @@ -4,7 +4,7 @@ autoload -Uz log_debug log_error log_info log_status log_output local name='FFmpeg' local version='6.0' local url='https://github.com/FFmpeg/FFmpeg.git' -local hash='3980415627a187d188dc25669cea6b12912eb178' +local hash='a6dc92968a325d331bb6dcf9b3b2248026cd1d6c' local -a patches=( "* ${0:a:h}/patches/FFmpeg/0001-flvdec-handle-unknown.patch \ 5a5185f54cbcf4672763cce687d1b6ddb662549b69637da826279ce4797f57ef" From 55b333baa4c0f8a6ec6c5a7fdae34474bdfa9085 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Fri, 31 Mar 2023 21:31:48 +0200 Subject: [PATCH 6/9] deps.qt: Backport macOS disabled combobox items fix Backports qt/qtbase@9f44553b3 which will only be in Qt 6.5.1 and later. --- .../patches/Qt6/mac/0002-QTBUG-56064.patch | 30 +++++++++++++++++++ deps.qt/qt6.zsh | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 deps.qt/patches/Qt6/mac/0002-QTBUG-56064.patch diff --git a/deps.qt/patches/Qt6/mac/0002-QTBUG-56064.patch b/deps.qt/patches/Qt6/mac/0002-QTBUG-56064.patch new file mode 100644 index 000000000..2e9b64a32 --- /dev/null +++ b/deps.qt/patches/Qt6/mac/0002-QTBUG-56064.patch @@ -0,0 +1,30 @@ +From 9f44553b3d297f7a423c51451c4e18c0e5a25d19 Mon Sep 17 00:00:00 2001 +From: Sebastian Beckmann +Date: Wed, 29 Mar 2023 04:20:38 +0200 +Subject: [PATCH] QComboBox: Disable items marked as disabled in native popups + +Fixes: QTBUG-56064 +Pick-to: 6.5 6.2 5.15 +Change-Id: I00a17a19b4c14c874e16ec863e794218f0570346 +Reviewed-by: Volker Hilsheimer +--- + a/qtbase/src/widgets/widgets/qcombobox.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/qtbase/src/widgets/widgets/qcombobox.cpp b/qtbase/src/widgets/widgets/qcombobox.cpp +index 80206b24acb..7c99e8983c6 100644 +--- a/qtbase/src/widgets/widgets/qcombobox.cpp ++++ b/qtbase/src/widgets/widgets/qcombobox.cpp +@@ -2501,10 +2501,12 @@ bool QComboBoxPrivate::showNativePopup() + QVariant textVariant = model->data(rowIndex, Qt::EditRole); + item->setText(textVariant.toString()); + QVariant iconVariant = model->data(rowIndex, Qt::DecorationRole); ++ const Qt::ItemFlags itemFlags = model->flags(rowIndex); + if (iconVariant.canConvert()) + item->setIcon(iconVariant.value()); + item->setCheckable(true); + item->setChecked(i == currentIndex); ++ item->setEnabled(itemFlags & Qt::ItemIsEnabled); + if (!currentItem || i == currentIndex) + currentItem = item; + diff --git a/deps.qt/qt6.zsh b/deps.qt/qt6.zsh index 486607088..c968bd6e6 100644 --- a/deps.qt/qt6.zsh +++ b/deps.qt/qt6.zsh @@ -8,6 +8,8 @@ local hash="${0:a:h}/checksums" local -a patches=( "macos ${0:a:h}/patches/Qt6/mac/0001-QTBUG-106369.patch \ f96ce8408b03e752708c606df10d6473aeed78843a6acb0a90c05f0a9fc913af" + "macos ${0:a:h}/patches/Qt6/mac/0002-QTBUG-56064.patch \ + 08a2e4f384d21e169d6ddb6e37084bc8b8701bb3e6a675b76843784a88250ad7" ) local -a qt_components=( From 6c21c6ef69b393df04c43d22a40f173fa3bb6d13 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Fri, 7 Apr 2023 18:34:27 +0200 Subject: [PATCH 7/9] deps.qt: Add missing obs-deps version file for Qt packages --- build-deps.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-deps.zsh b/build-deps.zsh index 6c7007e41..173907b3c 100755 --- a/build-deps.zsh +++ b/build-deps.zsh @@ -100,9 +100,9 @@ package() { if [[ -d cmake ]] rm -rf cmake if [[ -d man ]] rm -rf man - mkdir -p share/obs-deps - echo "${current_date}" >! share/obs-deps/VERSION } + mkdir -p share/obs-deps + echo "${current_date}" >! share/obs-deps/VERSION log_status "Create archive ${filename}" local -a _tarflags=() From 24e25fd83e6938cfe3cc5020230430b31ba5df59 Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Fri, 7 Apr 2023 19:52:25 +0200 Subject: [PATCH 8/9] CI: Add detection for single-arch static libraries Fixes issue with static libraries not properly packaged for universal builds. --- .github/actions/create-universal/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/create-universal/action.yml b/.github/actions/create-universal/action.yml index 050a4080d..2e40b4954 100644 --- a/.github/actions/create-universal/action.yml +++ b/.github/actions/create-universal/action.yml @@ -65,7 +65,7 @@ runs: for file (**/*(.)) { magic=$(xxd -ps -l 4 ${file}) - if [[ ${magic} == "cffaedfe" ]] fixups+=(${file}) + if [[ ${magic} == "cffaedfe" || ${magic} == "213c6172" ]] fixups+=(${file}) } for file (${fixups}) { From 5c35b4ba87eb407ba80804dc5d0f5a2727c4f253 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 31 Aug 2023 16:24:46 -0700 Subject: [PATCH 9/9] obs 29 merge (#1) --- .github/actions/build-macos-deps/action.yml | 5 ++- .github/actions/create-single-arch/action.yml | 2 +- .github/workflows/main.yml | 33 ++++++++++++++----- build-deps.zsh | 10 +++--- deps.ffmpeg/99-ffmpeg.zsh | 8 ++++- .../FFmpeg/0004-FFmpeg-5.0.1-cuvid.patch | 29 ++++++++++++++++ utils.zsh/10-bootstrap.zsh | 1 - utils.zsh/functions/universal_build | 2 +- 8 files changed, 71 insertions(+), 19 deletions(-) create mode 100644 deps.ffmpeg/patches/FFmpeg/0004-FFmpeg-5.0.1-cuvid.patch diff --git a/.github/actions/build-macos-deps/action.yml b/.github/actions/build-macos-deps/action.yml index 9f738494a..b7f8e9016 100644 --- a/.github/actions/build-macos-deps/action.yml +++ b/.github/actions/build-macos-deps/action.yml @@ -56,8 +56,11 @@ runs: if: ${{ steps.deps-cache.outputs.cache-hit == 'true' }} shell: zsh {0} run: ./build-deps.zsh --skip-build --skip-unpack --target ${{ inputs.target }} --config ${{ inputs.config }} --${{ inputs.type }} - + env: + github_hash: ${{ github.sha }} - name: Build and Install macOS Dependencies if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }} shell: zsh {0} run: ./build-deps.zsh --target ${{ inputs.target }} --config ${{ inputs.config }} --${{ inputs.type }} + env: + github_hash: ${{ github.sha }} diff --git a/.github/actions/create-single-arch/action.yml b/.github/actions/create-single-arch/action.yml index 202e6a8cf..3f58d1bcf 100644 --- a/.github/actions/create-single-arch/action.yml +++ b/.github/actions/create-single-arch/action.yml @@ -56,7 +56,7 @@ runs: local -A other_arch=(arm64 x86_64 x86_64 arm64) local -a fixups=( - lib/**/(*.a|*.dylib)(.) + lib/**/(*.a|*.dylib|ffmpeg|ffprobe)(.) lib/**/*.framework/Versions/A/*(.) plugins/**/*.dylib(.) ) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d2a987f57..9e570dceb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,7 +5,7 @@ on: branches: - streamlabs tags: - - '20[2-9][0-9]-[0-9][0-9]-[0-9][0-9]' + - '20[2-9][0-9]-[0-9][0-9]-[0-9][0-9]*' pull_request: paths-ignore: - '**.md' @@ -81,7 +81,7 @@ jobs: target='${{ matrix.target }}' artifact_name="ffmpeg-${target}-${{ github.sha }}" - file_name="${target%%-*}-ffmpeg-$(date +"%Y-%m-%d")-${target##*-}.tar.xz" + file_name="${target%%-*}-ffmpeg-${{ github.sha }}-${target##*-}.tar.xz" echo "artifactName=${artifact_name}" >> $GITHUB_OUTPUT echo "artifactFileName=${file_name}" >> $GITHUB_OUTPUT @@ -113,6 +113,8 @@ jobs: type: ${{ matrix.type }} config: ${{ matrix.config }} cacheRevision: ${{ env.CACHE_REVISION }} + env: + github_hash: ${{ github.sha }} - name: Publish Build Artifacts if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }} @@ -183,7 +185,7 @@ jobs: target='${{ matrix.target }}' artifact_name="deps-${target}-${{ github.sha }}" - file_name="${target%%-*}-deps-$(date +"%Y-%m-%d")-${target##*-}.tar.xz" + file_name="${target%%-*}-deps-${{ github.sha }}-${target##*-}.tar.xz" echo "artifactName=${artifact_name}" >> $GITHUB_OUTPUT echo "artifactFileName=${file_name}" >> $GITHUB_OUTPUT @@ -283,7 +285,7 @@ jobs: target='${{ matrix.target }}' artifact_name="qt5-${target}-${{ github.sha }}" - file_name="${target%%-*}-deps-qt5-$(date +"%Y-%m-%d")-${target##*-}.tar.xz" + file_name="${target%%-*}-deps-qt5-${{ github.sha }}-${target##*-}.tar.xz" echo "artifactName=${artifact_name}" >> $GITHUB_OUTPUT echo "artifactFileName=${file_name}" >> $GITHUB_OUTPUT @@ -315,6 +317,8 @@ jobs: config: ${{ matrix.config }} qtVersion: 5 cacheRevision: ${{ env.CACHE_REVISION }} + env: + github_hash: ${{ github.sha }} - name: Publish Build Artifacts if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }} @@ -374,7 +378,7 @@ jobs: target='macos-universal' artifact_name="qt6-${target}-${{ github.sha }}" - file_name="${target%%-*}-deps-qt6-$(date +"%Y-%m-%d")-${target##*-}.tar.xz" + file_name="${target%%-*}-deps-qt6-${{ github.sha }}-${target##*-}.tar.xz" echo "artifactName=${artifact_name}" >> $GITHUB_OUTPUT echo "artifactFileName=${file_name}" >> $GITHUB_OUTPUT @@ -406,6 +410,8 @@ jobs: config: Release qtVersion: 6 cacheRevision: ${{ env.CACHE_REVISION }} + env: + github_hash: ${{ github.sha }} - name: Publish Build Artifacts if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }} @@ -628,6 +634,8 @@ jobs: make-release: name: 'Create and upload release' + env: + RELEASE_BUCKET: "obs-studio-deployment" runs-on: ubuntu-20.04 if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') needs: [ffmpeg-package-universal, macos-package-universal, macos-qt5-package-universal, macos-qt6-package, windows-build, windows-qt-package] @@ -639,7 +647,6 @@ jobs: id: metadata run: | echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - echo "date=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT - name: 'Download build artifacts' uses: actions/download-artifact@v3 @@ -711,11 +718,10 @@ jobs: mv macos-deps-${{ steps.metadata.outputs.version }}-${arch}.tar.xz ${{ github.workspace }} popd > /dev/null + mv ${{ github.workspace }}/qt5-macos-${arch}-*/*.tar.xz ${{ github.workspace }}/macos-deps-qt5-${{ steps.metadata.outputs.version }}-${arch}.tar.xz + mv ${{ github.workspace }}/qt6-macos-${arch}-*/*.tar.xz ${{ github.workspace }}/macos-deps-qt6-${{ steps.metadata.outputs.version }}-${arch}.tar.xz done - mv ${{ github.workspace }}/qt5-macos-*/*.tar.xz ${{ github.workspace }} - mv ${{ github.workspace }}/qt6-macos-*/*.tar.xz ${{ github.workspace }} - - name: 'Generate Checksums' run: | shopt -s extglob @@ -740,3 +746,12 @@ jobs: ${{ github.workspace }}/macos-*-x86_64.tar.xz ${{ github.workspace }}/macos-*-universal.tar.xz ${{ github.workspace }}/linux-*-x86_64.tar.xz + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1-node16 + with: + aws-access-key-id: ${{secrets.AWS_RELEASE_ACCESS_KEY_ID}} + aws-secret-access-key: ${{secrets.AWS_RELEASE_SECRET_ACCESS_KEY}} + aws-region: us-west-2 + - name: Upload to S3 + run: aws s3 sync ${{ github.workspace }} s3://${{env.RELEASE_BUCKET}} --acl public-read --exclude "*" --include "windows-*.zip" --include "macos-*.tar.xz" diff --git a/build-deps.zsh b/build-deps.zsh index 6c7007e41..7e4e70d35 100755 --- a/build-deps.zsh +++ b/build-deps.zsh @@ -72,9 +72,9 @@ run_stages() { package() { autoload -Uz log_info log_status if [[ ${PACKAGE_NAME} == 'qt'* ]] { - local filename="${target%%-*}-deps-${PACKAGE_NAME}-${current_date}-${target_config[arch]}.tar.xz" + local filename="${target%%-*}-deps-${PACKAGE_NAME}-${github_hash}-${target_config[arch]}.tar.xz" } else { - local filename="${target%%-*}-${PACKAGE_NAME}-${current_date}-${target_config[arch]}.tar.xz" + local filename="${target%%-*}-${PACKAGE_NAME}-${github_hash}-${target_config[arch]}.tar.xz" } pushd ${PWD} @@ -85,9 +85,9 @@ package() { if [[ ${PACKAGE_NAME} != 'qt'* ]] { log_status "Cleanup unnecessary files" - rm -rf lib/^(*.dylib|libajantv*|*.a|*.so*|*.lib|*.framework|*.dSYM|cmake)(N) + rm -rf lib/^(*.dylib|libajantv*|*.a|ffmpeg|ffprobe|*.so*|*.lib|*.framework|*.dSYM|cmake)(N) rm -rf lib/(libpcre*|libpng*)(N) - rm -rf bin/^(*.exe|*.dll|*.pdb|swig)(N) + rm -rf bin/^(*.exe|*.dll|*.pdb|ffmpeg|ffprobe|swig)(N) if [[ -f bin/swig ]] { swig_lib=(share/swig/*(/)) @@ -101,7 +101,7 @@ package() { if [[ -d man ]] rm -rf man mkdir -p share/obs-deps - echo "${current_date}" >! share/obs-deps/VERSION + echo "${github_hash}" >! share/obs-deps/VERSION } log_status "Create archive ${filename}" diff --git a/deps.ffmpeg/99-ffmpeg.zsh b/deps.ffmpeg/99-ffmpeg.zsh index f19e25ebc..931801b5d 100644 --- a/deps.ffmpeg/99-ffmpeg.zsh +++ b/deps.ffmpeg/99-ffmpeg.zsh @@ -8,6 +8,8 @@ local hash='ea3d24bbe3c58b171e55fe2151fc7ffaca3ab3d2' local -a patches=( "* ${0:a:h}/patches/FFmpeg/0001-FFmpeg-6.0-OBS.patch \ 7fcb67d5e68a6ca3102c3a6aaba56750b22850552ccd8704c6636c174968ef56" + "* ${0:a:h}/patches/FFmpeg/0004-FFmpeg-5.0.1-cuvid.patch \ + d44609a43f7f09819c74cdfa6fa90c9a1de61b3673aa95e87a294c259f203717" ) ## Build Steps @@ -205,9 +207,13 @@ config() { --disable-sdl2 --disable-doc --disable-postproc + --disable-encoder="hevc" + --disable-decoder="hevc" ) - if (( ! shared_libs )) args+=(--pkg-config-flags="--static") + if (( ! shared_libs )) { + args+=(--pkg-config-flags="--static") + } log_info "Config (%F{3}${target}%f)" cd "${dir}" diff --git a/deps.ffmpeg/patches/FFmpeg/0004-FFmpeg-5.0.1-cuvid.patch b/deps.ffmpeg/patches/FFmpeg/0004-FFmpeg-5.0.1-cuvid.patch new file mode 100644 index 000000000..72833a53e --- /dev/null +++ b/deps.ffmpeg/patches/FFmpeg/0004-FFmpeg-5.0.1-cuvid.patch @@ -0,0 +1,29 @@ +diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c +index f03bbd8..7b8ec3a 100644 +--- a/libavcodec/cuviddec.c ++++ b/libavcodec/cuviddec.c +@@ -817,7 +817,7 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) + &ctx->resize.width, &ctx->resize.height) != 2) { + av_log(avctx, AV_LOG_ERROR, "Invalid resize expressions\n"); + ret = AVERROR(EINVAL); +- goto error; ++ return ret; + } + + if (ctx->crop_expr && sscanf(ctx->crop_expr, "%dx%dx%dx%d", +@@ -825,13 +825,13 @@ static av_cold int cuvid_decode_init(AVCodecContext *avctx) + &ctx->crop.left, &ctx->crop.right) != 4) { + av_log(avctx, AV_LOG_ERROR, "Invalid cropping expressions\n"); + ret = AVERROR(EINVAL); +- goto error; ++ return ret; + } + + ret = cuvid_load_functions(&ctx->cvdl, avctx); + if (ret < 0) { + av_log(avctx, AV_LOG_ERROR, "Failed loading nvcuvid.\n"); +- goto error; ++ return ret; + } + + ctx->frame_queue = av_fifo_alloc(ctx->nb_surfaces * sizeof(CuvidParsedFrame)); diff --git a/utils.zsh/10-bootstrap.zsh b/utils.zsh/10-bootstrap.zsh index de069cebf..c506a3460 100644 --- a/utils.zsh/10-bootstrap.zsh +++ b/utils.zsh/10-bootstrap.zsh @@ -35,7 +35,6 @@ bootstrap() { typeset -g -a skips=() typeset -g -i shared_libs=0 typeset -g -i clean_build=0 - typeset -g -r current_date=$(date +"%Y-%m-%d") local -i _verbosity=1 diff --git a/utils.zsh/functions/universal_build b/utils.zsh/functions/universal_build index 7642a0fa3..7ce85f5aa 100644 --- a/utils.zsh/functions/universal_build +++ b/utils.zsh/functions/universal_build @@ -21,7 +21,7 @@ if [[ -d "build_universal" ]] rm -rf "build_universal" cp -cpR "build_x86_64" "build_universal" cd "build_universal" -local -a candidates=(./**/*.(dylib|so|a)(D)) +local -a candidates=(./**/(*.dylib|*.so|*.a|ffmpeg|ffprobe)(D)) local c for c (${candidates}) { [[ -e ../build_arm64/"${c}" ]] || continue