Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build obs merge #619

Open
wants to merge 12 commits into
base: streamlabs
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/actions/run-clang-format/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,12 @@ runs:

print ::group::Run clang-format-17
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes}
local issues
issues=$(./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes} || true)

if [[ -n "$issues" ]]; then
echo "::error::clang-format issues found:\n$issues"
else
echo "No formatting issues detected."
fi
print ::endgroup::
2 changes: 2 additions & 0 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:

ubuntu-build:
name: Ubuntu 🐧
if: github.repository == 'obsproject/obs-studio'
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
Expand Down Expand Up @@ -241,6 +242,7 @@ jobs:

flatpak-build:
name: Flatpak 📦
if: github.repository == 'obsproject/obs-studio'
runs-on: ubuntu-22.04
needs: check-event
defaults:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
paths-ignore: ['**.md']
branches-ignore: [streamlabs]
branches: [skippy]
pull_request:
paths-ignore: ['**.md']
branches-ignore: [streamlabs]
branches: [skippy]

jobs:
clang-format-check:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main-streamlabs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
push:
paths-ignore:
- '**.md'
branches: [ "streamlabs" ]
branches: [ "skippy" ]
tags:
- '*'
pull_request:
paths-ignore:
- '**.md'
branches: [ "streamlabs" ]
branches: [ "skippy" ]

env:
InstallPath: "packed_build"
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ on:
push:
paths-ignore: ['**.md']
branches:
- "streamlabs"
- 'release/**'
- "skippy"
tags: ['*']
pull_request:
paths-ignore: ['**.md']
branches: ['streamlabs']
branches: ['skippy']
merge_group:
branches: ['streamlabs']
branches: ['skippy']

env:
InstallPath: "packed_build"
Expand Down Expand Up @@ -243,6 +242,12 @@ jobs:
# name: 'obs-studio-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}'
# path: ${{env.PACKAGE_NAME}}-macos-release-${{ steps.setup.outputs.commitHash }}-${{ matrix.arch }}.tar.gz

- name: 'Upload debug files to Sentry'
if: startsWith(github.ref, 'refs/tags/')
run: 'python ./slobs_CI/sentry-osx.py'
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
BUILDCONFIG: RelWithDebInfo

linux_build:
name: '02 - Linux'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-pull.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
paths-ignore:
- '**.md'
branches: [master]
branches: [streamlabs]
types: [ opened, synchronize, reopened ]
permissions:
contents: read
Expand All @@ -28,7 +28,7 @@ jobs:

compatibility-validation:
name: Validate Compatibility 🕵️
if: github.base_ref == 'master'
if: github.base_ref == 'streamlabs'
runs-on: ubuntu-22.04
permissions:
checks: write
Expand All @@ -50,7 +50,7 @@ jobs:

services-validation:
name: Validate Services 🕵️
if: github.base_ref == 'master'
if: github.base_ref == 'streamlabs'
runs-on: ubuntu-22.04
permissions:
checks: write
Expand Down
72 changes: 72 additions & 0 deletions CI/macos/fix_deps_paths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Check if a file path is passed as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <path_to_binary>"
exit 1
fi

BINARY_PATH=$1

# Use otool to get the list of linked libraries
LIB_PATHS=$(otool -L "$BINARY_PATH" | grep "obs-deps" | awk '{print $1}')

# Check if any obs-deps libraries were found
if [ -z "$LIB_PATHS" ]; then
echo "No obs-deps libraries found in $BINARY_PATH."
else
# Loop through each library path and change it to @loader_path, removing version from the name
for OLD_PATH in $LIB_PATHS; do
# Extract the base library name without version
LIB_NAME=$(basename "$OLD_PATH" | sed -E 's/\.[0-9]+\.dylib$/.dylib/')

# Construct the new path using @loader_path
NEW_PATH="@loader_path/$LIB_NAME"

# Print what we are changing for logging
echo "Changing $OLD_PATH to $NEW_PATH"

# Run the install_name_tool command to make the change
install_name_tool -change "$OLD_PATH" "$NEW_PATH" "$BINARY_PATH"
done

echo "All obs-deps libraries have been updated to use @loader_path and version-less names in $BINARY_PATH."
fi

# Additional libraries that use @rpath should be converted to @loader_path
OTHER_LIBS=$(otool -L "$BINARY_PATH" | grep "@rpath" | awk '{print $1}')

if [ -n "$OTHER_LIBS" ]; then
for OLD_PATH in $OTHER_LIBS; do
# Extract the base library name without version
LIB_NAME=$(basename "$OLD_PATH" | sed -E 's/\.[0-9]+\.dylib$/.dylib/')

# Construct the new path using @loader_path
NEW_PATH="@loader_path/$LIB_NAME"

# Print what we are changing for logging
echo "Changing $OLD_PATH to $NEW_PATH"

# Run the install_name_tool command to make the change
install_name_tool -change "$OLD_PATH" "$NEW_PATH" "$BINARY_PATH"
done

echo "All @rpath libraries have been updated to use @loader_path in $BINARY_PATH."
else
echo "No @rpath libraries found."
fi

# Add @executable_path/../Frameworks to rpath as a fallback
echo "Adding @executable_path/../Frameworks as an rpath fallback"
install_name_tool -add_rpath "@executable_path/../Frameworks" "$BINARY_PATH"

# Check if the binary is signed (for macOS app distribution)
CODESIGN_STATUS=$(codesign -vv "$BINARY_PATH" 2>&1)

if [[ "$CODESIGN_STATUS" == *"not signed"* ]]; then
echo "Binary is not signed. Please sign it for distribution if necessary."
else
echo "Binary is already signed."
fi

echo "All modifications are done."
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ if(WIN32)
-P "${CMAKE_SOURCE_DIR}/slobs_CI/check_libraries.cmake" )
endif()

#Configure 32-bit projects
if(ENABLE_32_TARGETS)
#Configure 32-bit projects
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
#message(FATAL_ERROR "CURL_INCLUDE_DIR: ${CURL_INCLUDE_DIR}, CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}, PREFIX_PATH_X86: ${PREFIX_PATH_X86}, OBS_VERSION: ${OBS_VERSION}, OBS_VERSION_OVERRIDE: ${OBS_VERSION_OVERRIDE}")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand Down Expand Up @@ -193,3 +194,4 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
RESULT_VARIABLE _process_result COMMAND_ERROR_IS_FATAL ANY)
endif()
endif()
endif()
106 changes: 85 additions & 21 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 3,
"version": 5,
"cmakeMinimumRequired": {
"major": 3,
"minor": 22,
Expand All @@ -10,10 +10,10 @@
"name": "environmentVars",
"hidden": true,
"cacheVariables": {
"RESTREAM_CLIENTID": {"type": "STRING", "value": "$penv{RESTREAM_CLIENTID}"},
"RESTREAM_HASH": {"type": "STRING", "value": "$penv{RESTREAM_HASH}"},
"TWITCH_CLIENTID": {"type": "STRING", "value": "$penv{TWITCH_CLIENTID}"},
"TWITCH_HASH": {"type": "STRING", "value": "$penv{TWITCH_HASH}"},
"RESTREAM_CLIENTID": {"type": "STRING", "value": "$penv{RESTREAM_CLIENTID}"},
"RESTREAM_HASH": {"type": "STRING", "value": "$penv{RESTREAM_HASH}"},
"YOUTUBE_CLIENTID": {"type": "STRING", "value": "$penv{YOUTUBE_CLIENTID}"},
"YOUTUBE_CLIENTID_HASH": {"type": "STRING", "value": "$penv{YOUTUBE_CLIENTID_HASH}"},
"YOUTUBE_SECRET": {"type": "STRING", "value": "$penv{YOUTUBE_SECRET}"},
Expand All @@ -33,8 +33,16 @@
"generator": "Xcode",
"binaryDir": "${sourceDir}/build_macos",
"cacheVariables": {
"ENABLE_BROWSER": true,
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "11.0"},
"ENABLE_BROWSER": true
"OBS_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{CODESIGN_TEAM}"},
"OBS_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{CODESIGN_IDENT}"},
"OBS_PROVISIONING_PROFILE": {"type": "STRING", "value": "$penv{PROVISIONING_PROFILE}"},
"VIRTUALCAM_DEVICE_UUID": {"type": "STRING", "value": ""},
"VIRTUALCAM_SOURCE_UUID": {"type": "STRING", "value": ""},
"VIRTUALCAM_SINK_UUID": {"type": "STRING", "value": ""},
"SPARKLE_APPCAST_URL": {"type": "STRING", "value": ""},
"SPARKLE_PUBLIC_KEY": {"type": "STRING", "value": ""}
}
},
{
Expand All @@ -48,35 +56,75 @@
}
},
{
"name": "ubuntu",
"displayName": "Ubuntu",
"description": "obs-studio for Ubuntu",
"name": "linux-aarch64",
"displayName": "Linux aarch64",
"description": "obs-studio for Linux (aarch64)",
"inherits": ["environmentVars"],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"binaryDir": "${sourceDir}/build_ubuntu",
"binaryDir": "${sourceDir}/build_aarch64",
"generator": "Ninja",
"warnings": {"dev": true, "deprecated": true},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_INSTALL_LIBDIR": "lib/CMAKE_SYSTEM_PROCESSOR-linux-gnu",
"OBS_CMAKE_VERSION": {"type": "STRING", "value": "3.0.0"},
"ENABLE_AJA": false,
"ENABLE_NATIVE_NVENC": false,
"ENABLE_WAYLAND": true,
"ENABLE_VLC": true,
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "linux-ci-aarch64",
"inherits": ["linux-aarch64"],
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "linux-release-aarch64",
"displayName": "Linux aarch64 (Release)",
"description": "obs-studio for Linux (aarch64) - Release Configuration",
"inherits": "linux-aarch64",
"cacheVariables": {
"ENABLE_RELEASE_BUILD": true
}
},
{
"name": "linux-x86_64",
"displayName": "Linux x86_64",
"description": "obs-studio for Linux (x86_64)",
"inherits": ["environmentVars"],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"binaryDir": "${sourceDir}/build_x86_64",
"generator": "Ninja",
"warnings": {"dev": true, "deprecated": true},
"cacheVariables": {
"ENABLE_WAYLAND": true,
"ENABLE_WEBRTC": false
"ENABLE_VLC": true,
"CMAKE_BUILD_TYPE": {"type": "STRING", "value": "Debug"}
}
},
{
"name": "ubuntu-ci",
"inherits": ["ubuntu"],
"name": "linux-ci-x86_64",
"inherits": ["linux-x86_64"],
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_COMPILE_WARNING_AS_ERROR": true
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "linux-release-x86_64",
"displayName": "Linux x86_64 (Release)",
"description": "obs-studio for Linux (x86_64) - Release Configuration",
"inherits": "linux-x86_64",
"cacheVariables": {
"ENABLE_RELEASE_BUILD": true,
"ENABLE_BROWSER": true
}
},
{
Expand All @@ -94,10 +142,12 @@
"generator": "Visual Studio 17 2022",
"cacheVariables": {
"OBS_CMAKE_VERSION": {"type": "STRING", "value": "3.0.0"},
"GPU_PRIORITY_VAL": {"type": "STRING", "value": "$penv{GPU_PRIORITY_VAL}"},
"VIRTUALCAM_GUID": {"type": "STRING", "value": "A3FCE0F5-3493-419F-958A-ABA1250EC20B"},
"ENABLE_BROWSER": true,
"ENABLE_CCACHE": false
"VIRTUALCAM_GUID": {"type": "STRING", "value": "A3FCE0F5-3493-419F-958A-ABA1250EC20B"},
"GPU_PRIORITY_VAL": {"type": "STRING", "value": "$penv{GPU_PRIORITY_VAL}"},
"ENABLE_CCACHE": false,
"ENABLE_32_TARGETS": false,
"ENABLE_UI": false
}
},
{
Expand All @@ -113,6 +163,20 @@
}
],
"buildPresets": [
{
"name": "linux-aarch64",
"configurePreset": "linux-aarch64",
"displayName": "Linux aarch64",
"description": "Linux build for aarch64 (aka arm64)",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-x86_64",
"configurePreset": "linux-x86_64",
"displayName": "Linux x86_64",
"description": "Linux build for x86_64 (aka amd64)",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-x64",
"configurePreset": "windows-x64",
Expand Down
Loading
Loading