Skip to content

Commit 1d3db66

Browse files
Copilotroyshil
andauthored
Sync build system with latest OBS plugin template (#137)
* Initial plan * Update build system from OBS plugin template: workflows, actions, and scripts Co-authored-by: royshil <[email protected]> * Add gersemi config and remove cmake-format config Co-authored-by: royshil <[email protected]> * Add .gersemirc to repository and update .gitignore * Update README to reference new build-ubuntu script Co-authored-by: royshil <[email protected]> * Add explicit permissions to check-format workflow jobs for security Co-authored-by: royshil <[email protected]> * Update macOS CMake compiler config to match OBS plugin template This fixes the macOS build failure by updating the SDK version check. The template requires macOS SDK 15.0+ (Xcode 16.0+) which aligns with the workflow update to use macOS-15 and Xcode 16.1. Co-authored-by: royshil <[email protected]> * Update OBS Studio and dependencies to version 31.1.1 This resolves the macOS build failure by updating to OBS Studio 31.1.1 which includes cmake infrastructure compatible with macOS 15 and Xcode 16.1. Also updates prebuilt dependencies and Qt6 to 2025-07-11 to match the template requirements. Co-authored-by: royshil <[email protected]> * Update jsoncons and inja submodules to latest versions Updates jsoncons to latest (0dac681) which requires CMake 3.15+, fixing the build error "Compatibility with CMake < 3.5 has been removed". The old version required CMake 3.1 which is no longer supported. Also updates inja to latest (ebb7aeb) for consistency and bug fixes. Co-authored-by: royshil <[email protected]> * Fix CMake presets and buildspec for cross-platform builds - Rename Linux presets to Ubuntu presets (linux-* → ubuntu-*) to match template and build scripts expectations - Update buildspec_common.cmake to match template, fixing: - Windows arch specification to include platform version - OBS CMake version to 3.0.0 for all platforms - ENABLE_UI → ENABLE_FRONTEND flag - Modern CMake return(PROPAGATE) syntax This resolves Ubuntu preset not found error, and should fix Windows libobs package discovery and macOS plugin-support build issues. Co-authored-by: royshil <[email protected]> * Replace deprecated obs_scene_sceneitem_from_source with obs_scene_find_source OBS Studio 31.1.1 deprecated obs_scene_sceneitem_from_source(). Replaced it with obs_scene_find_source() which finds scene items by source name instead of source pointer. This fixes the Windows build error where warnings are treated as errors. Co-authored-by: royshil <[email protected]> * Replace deprecated QCheckBox::stateChanged with checkStateChanged Qt6 deprecated the stateChanged signal in favor of checkStateChanged. Updated the signal connection to use the non-deprecated API. This fixes the Windows build error where deprecation warnings are treated as errors. Co-authored-by: royshil <[email protected]> * Use QCheckBox::toggled instead of checkStateChanged for Qt6 compatibility The checkStateChanged signal was added in Qt 6.7, but older Qt6 versions on Ubuntu/macOS don't have it yet. Using the toggled signal instead, which is available in all Qt versions and provides the same functionality for checkboxes. This fixes the build error on Ubuntu and macOS while maintaining Windows compatibility. Co-authored-by: royshil <[email protected]> * Update PugiXML to version 1.15 and change URL_HASH to SHA256 * Update CMake configuration files for various components - Updated the Lexbor library version from v2.3.0 to v2.6.0 in BuildLexbor.cmake. - Simplified FetchContent_Declare calls in BuildMyCurl.cmake for better readability. - Improved formatting of CMake arguments in BuildPugiXML.cmake for consistency. - Refactored JSON string extraction in FetchWebsocketpp.cmake for clarity. - Enhanced error messaging in bootstrap.cmake for in-source build prohibition. - Cleaned up build number cache definition in buildnumber.cmake for better readability. - Standardized compiler options formatting in compiler_common.cmake and compilerconfig.cmake files. - Improved helper function formatting in helpers_common.cmake for better readability. - Streamlined toolchain files for aarch64 and x86_64 architectures by consolidating pkg-config executable definitions. - Enhanced macOS buildspec and defaults files for better readability and consistency. - Refactored install commands in windows helpers for improved clarity and consistency. * Refactor formatting checks in .run-format.zsh and improve code readability in url-source-callbacks.cpp * Add debug flag to clang-format run command for enhanced output * Update clang-format action to remove debug flag and adjust Zsh version check * Simplify Ubuntu build configuration by removing strategy matrix --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: royshil <[email protected]> Co-authored-by: Roy Shilkrot <[email protected]>
1 parent cc17753 commit 1d3db66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1668
-1192
lines changed

.cmake-format.json

Lines changed: 0 additions & 40 deletions
This file was deleted.

.gersemirc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json
2+
3+
definitions: []
4+
line_length: 120
5+
indent: 2
6+
list_expansion: favour-inlining
7+
unsafe: false
8+
warn_about_unknown_commands: false

.github/actions/build-plugin/action.yaml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
name: 'Set up and build plugin'
2-
description: 'Builds the plugin for specified architecture and build config'
1+
name: Set up and build plugin
2+
description: Builds the plugin for specified architecture and build config
33
inputs:
44
target:
5-
description: 'Target architecture for dependencies'
5+
description: Target architecture for dependencies
66
required: true
77
config:
8-
description: 'Build configuration'
8+
description: Build configuration
99
required: false
10-
default: 'RelWithDebInfo'
10+
default: RelWithDebInfo
1111
codesign:
12-
description: 'Enable codesigning (macOS only)'
12+
description: Enable codesigning (macOS only)
1313
required: false
1414
default: 'false'
1515
codesignIdent:
16-
description: 'Developer ID for application codesigning (macOS only)'
16+
description: Developer ID for application codesigning (macOS only)
1717
required: false
1818
default: '-'
19+
codesignTeam:
20+
description: Team ID for application codesigning (macOS only)
21+
required: false
22+
default: ''
1923
workingDirectory:
20-
description: 'Working directory for packaging'
24+
description: Working directory for packaging
2125
required: false
2226
default: ${{ github.workspace }}
2327
runs:
@@ -28,6 +32,7 @@ runs:
2832
shell: zsh --no-rcs --errexit --pipefail {0}
2933
working-directory: ${{ inputs.workingDirectory }}
3034
env:
35+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
3136
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
3237
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
3338
run: |
@@ -55,16 +60,18 @@ runs:
5560
if: runner.os == 'Linux'
5661
shell: zsh --no-rcs --errexit --pipefail {0}
5762
working-directory: ${{ inputs.workingDirectory }}
63+
env:
64+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
5865
run: |
5966
: Run Ubuntu Build
6067
6168
local -a build_args=(
62-
--target linux-${{ inputs.target }}
69+
--target ubuntu-${{ inputs.target }}
6370
--config ${{ inputs.config }}
6471
)
6572
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
6673
67-
.github/scripts/build-linux ${build_args}
74+
.github/scripts/build-ubuntu ${build_args}
6875
6976
- name: Run Windows Build
7077
if: runner.os == 'Windows'
@@ -86,7 +93,7 @@ runs:
8693
if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
8794
shell: zsh --no-rcs --errexit --pipefail {0}
8895
env:
89-
CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf
96+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
9097
run: |
9198
: Create Summary 📊
9299
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Check For Changed Files
2+
description: Checks for changed files compared to specific git reference and glob expression
3+
inputs:
4+
baseRef:
5+
description: Git reference to check against
6+
required: false
7+
ref:
8+
description: Git reference to check with
9+
required: false
10+
default: HEAD
11+
checkGlob:
12+
description: Glob expression to limit check to specific files
13+
required: false
14+
useFallback:
15+
description: Use fallback compare against prior commit
16+
required: false
17+
default: 'true'
18+
diffFilter:
19+
description: git diff-filter string to use
20+
required: false
21+
default: ''
22+
outputs:
23+
hasChangedFiles:
24+
value: ${{ steps.checks.outputs.hasChangedFiles }}
25+
description: True if specified files were changed in comparison to specified git reference
26+
changedFiles:
27+
value: ${{ steps.checks.outputs.changedFiles }}
28+
description: List of changed files
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Check For Changed Files ✅
33+
shell: bash
34+
id: checks
35+
env:
36+
GIT_BASE_REF: ${{ inputs.baseRef }}
37+
GIT_REF: ${{ inputs.ref }}
38+
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
39+
GITHUB_REF_BEFORE: ${{ github.event.before }}
40+
USE_FALLBACK: ${{ inputs.useFallback }}
41+
DIFF_FILTER: ${{ inputs.diffFilter }}
42+
run: |
43+
: Check for Changed Files ✅
44+
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
45+
shopt -s extglob
46+
shopt -s dotglob
47+
48+
if [[ "${GIT_BASE_REF}" ]]; then
49+
if ! git cat-file -e "${GIT_BASE_REF}" &> /dev/null; then
50+
echo "::warning::Provided base reference ${GIT_BASE_REF} is invalid"
51+
if [[ "${USE_FALLBACK}" == 'true' ]]; then
52+
GIT_BASE_REF='HEAD~1'
53+
fi
54+
fi
55+
else
56+
if ! git cat-file -e ${GITHUB_REF_BEFORE} &> /dev/null; then
57+
GITHUB_REF_BEFORE='4b825dc642cb6eb9a060e54bf8d69288fbee4904'
58+
fi
59+
60+
GIT_BASE_REF='HEAD~1'
61+
case "${GITHUB_EVENT_NAME}" in
62+
pull_request) GIT_BASE_REF="origin/${GITHUB_BASE_REF}" ;;
63+
push) if [[ "${GITHUB_EVENT_FORCED}" != 'true' ]]; then GIT_BASE_REF="${GITHUB_REF_BEFORE}"; fi ;;
64+
*) ;;
65+
esac
66+
fi
67+
68+
changes=($(git diff --name-only --diff-filter="${DIFF_FILTER}" ${GIT_BASE_REF} ${GIT_REF} -- ${{ inputs.checkGlob }}))
69+
70+
if (( ${#changes[@]} )); then
71+
file_string="${changes[*]}"
72+
echo "hasChangedFiles=true" >> $GITHUB_OUTPUT
73+
echo "changedFiles=[\"${file_string// /\",\"}\"]" >> $GITHUB_OUTPUT
74+
else
75+
echo "hasChangedFiles=false" >> $GITHUB_OUTPUT
76+
echo "changedFiles=[]" >> GITHUB_OUTPUT
77+
fi

.github/actions/package-plugin/action.yaml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: 'Package plugin'
2-
description: 'Packages the plugin for specified architecture and build config.'
1+
name: Package plugin
2+
description: Packages the plugin for specified architecture and build config.
33
inputs:
44
target:
5-
description: 'Build target for dependencies'
5+
description: Build target for dependencies
66
required: true
77
config:
8-
description: 'Build configuration'
8+
description: Build configuration
99
required: false
10-
default: 'RelWithDebInfo'
10+
default: RelWithDebInfo
1111
codesign:
12-
description: 'Enable codesigning (macOS only)'
12+
description: Enable codesigning (macOS only)
1313
required: false
1414
default: 'false'
1515
notarize:
16-
description: 'Enable notarization (macOS only)'
16+
description: Enable notarization (macOS only)
1717
required: false
1818
default: 'false'
1919
codesignIdent:
20-
description: 'Developer ID for application codesigning (macOS only)'
20+
description: Developer ID for application codesigning (macOS only)
2121
required: false
2222
default: '-'
2323
installerIdent:
24-
description: 'Developer ID for installer package codesigning (macOS only)'
24+
description: Developer ID for installer package codesigning (macOS only)
2525
required: false
2626
default: ''
2727
codesignTeam:
28-
description: 'Developer team for codesigning (macOS only)'
28+
description: Developer team for codesigning (macOS only)
2929
required: false
3030
default: ''
3131
codesignUser:
32-
description: 'Apple ID username for notarization (macOS only)'
32+
description: Apple ID username for notarization (macOS only)
3333
required: false
3434
default: ''
3535
codesignPass:
36-
description: 'Apple ID password for notarization (macOS only)'
36+
description: Apple ID password for notarization (macOS only)
3737
required: false
3838
default: ''
3939
package:
40-
description: 'Create Windows or macOS installation package'
40+
description: Create Windows or macOS installation package
4141
required: false
4242
default: 'false'
4343
workingDirectory:
44-
description: 'Working directory for packaging'
44+
description: Working directory for packaging
4545
required: false
4646
default: ${{ github.workspace }}
4747
runs:
@@ -87,14 +87,14 @@ runs:
8787
run: |
8888
: Run Ubuntu Packaging
8989
package_args=(
90-
--target linux-${{ inputs.target }}
90+
--target ubuntu-${{ inputs.target }}
9191
--config ${{ inputs.config }}
9292
)
9393
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
9494
9595
if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package)
9696
97-
.github/scripts/package-linux ${package_args}
97+
.github/scripts/package-ubuntu ${package_args}
9898
9999
- name: Run Windows Packaging
100100
if: runner.os == 'Windows'
@@ -110,8 +110,4 @@ runs:
110110
Configuration = '${{ inputs.config }}'
111111
}
112112
113-
if ( '${{ inputs.package }}' -eq 'true' ) {
114-
$PackageArgs += @{BuildInstaller = $true}
115-
}
116-
117113
.github/scripts/Package-Windows.ps1 @PackageArgs

.github/actions/run-clang-format/action.yaml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
failCondition:
55
description: Controls whether failed checks also fail the workflow run
66
required: false
7-
default: 'never'
7+
default: never
88
workingDirectory:
99
description: Working directory for checks
1010
required: false
@@ -20,42 +20,41 @@ runs:
2020
echo "::notice::run-clang-format action requires a macOS-based or Linux-based runner."
2121
exit 2
2222
23+
- name: Check for Changed Files ✅
24+
uses: ./.github/actions/check-changes
25+
id: checks
26+
with:
27+
checkGlob: "'*.c' '*.h' '*.cpp' '*.hpp' '*.m' '*.mm'"
28+
diffFilter: 'ACM'
29+
2330
- name: Install Dependencies 🛍️
24-
if: runner.os == 'Linux'
31+
if: runner.os == 'Linux' && fromJSON(steps.checks.outputs.hasChangedFiles)
2532
shell: bash
2633
run: |
2734
: Install Dependencies 🛍️
2835
echo ::group::Install Dependencies
2936
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
3037
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
31-
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@17/bin" >> $GITHUB_PATH
38+
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@19/bin" >> $GITHUB_PATH
3239
brew install --quiet zsh
3340
echo ::endgroup::
3441
3542
- name: Run clang-format 🐉
43+
if: fromJSON(steps.checks.outputs.hasChangedFiles)
3644
id: result
3745
shell: zsh --no-rcs --errexit --pipefail {0}
3846
working-directory: ${{ inputs.workingDirectory }}
3947
env:
40-
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
41-
GITHUB_REF_BEFORE: ${{ github.event.before }}
48+
CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }}
4249
run: |
4350
: Run clang-format 🐉
4451
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
4552
46-
local -a changes=($(git diff --name-only HEAD~1 HEAD))
47-
case ${GITHUB_EVENT_NAME} {
48-
pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;;
49-
push) if [[ ${GITHUB_EVENT_FORCED} != true ]] changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;;
50-
*) ;;
51-
}
52-
53-
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
54-
echo ::group::Install clang-format-17
55-
brew install --quiet obsproject/tools/clang-format@17
56-
echo ::endgroup::
53+
print ::group::Install clang-format-19
54+
brew install --quiet obsproject/tools/clang-format@19
55+
print ::endgroup::
5756
58-
echo ::group::Run clang-format-17
59-
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
60-
echo ::endgroup::
61-
}
57+
print ::group::Run clang-format-19
58+
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
59+
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes}
60+
print ::endgroup::

0 commit comments

Comments
 (0)