Skip to content
Merged
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
30 changes: 16 additions & 14 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ env:

task:
install_script:
- pkg install -y
alsa-lib
v4l_compat swig ffmpeg curl dbus fdk-aac fontconfig
freetype2 jackit jansson luajit mbedtls pulseaudio speexdsp
libpci librist libsysinfo libudev-devd libv4l libx264 cmake ninja
mesa-libs lua52 pkgconf
srt
qt5-svg qt5-qmake qt5-buildtools qt5-x11extras qt5-xml
pipewire
- pkg-install -y
cmake ninja binutils pkgconf curl
ffmpeg qt6-base qt6-svg jansson libsysinfo e2fsprogs-libuuid pulseaudio
alsa-lib pipewire v4l_compat libpci librist srt nlohmann-json uthash
qr-code-generator websocketpp asio vlc swig luajit jackit sndio fdk-aac
script:
- mkdir build
- cd build
- cmake
-DENABLE_AJA=OFF
-GNinja ..
- ninja
-S $(pwd)
-B build
-G Ninja
-DOBS_CMAKE_VERSION=3.0
-DENABLE_JACK:BOOL=ON
-DENABLE_SNDIO:BOOL=ON
-DENABLE_LIBFDK:BOOL=ON
-DENABLE_WEBRTC:BOOL=OFF
- cmake
--build build
--config RelWithDebInfo
4 changes: 2 additions & 2 deletions .github/actions/build-obs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ runs:
local -a build_args=(
--config ${{ inputs.config }}
--target linux-${{ inputs.target }}
--target ubuntu-${{ inputs.target }}
)
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
git fetch origin --no-tags --no-recurse-submodules -q
.github/scripts/build-linux ${build_args}
.github/scripts/build-ubuntu ${build_args}
- name: Run Windows Build
if: runner.os == 'Windows'
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/package-obs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ runs:
: Run Ubuntu Packaging
local -a package_args=(
--target linux-${{ inputs.target }}
--target ubuntu-${{ inputs.target }}
--config ${{ inputs.config }}
)
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
if [[ '${{ inputs.package }}' == true ]] package_args+=(--package)
${{ inputs.workingDirectory }}/.github/scripts/package-linux ${package_args}
${{ inputs.workingDirectory }}/.github/scripts/package-ubuntu ${package_args}
- name: Run Windows packaging
if: runner.os == 'Windows'
Expand Down
28 changes: 14 additions & 14 deletions .github/scripts/.build.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ build() {
local -r -a _valid_targets=(
macos-x86_64
macos-arm64
linux-x86_64
ubuntu-x86_64
ubuntu-aarch64
)

local config='RelWithDebInfo'
Expand All @@ -66,7 +67,7 @@ build() {
local -a args
while (( # )) {
case ${1} {
-t|--target|--generator|-c|--config)
-t|--target|-c|--config)
if (( # == 1 )) || [[ ${2:0:1} == '-' ]] {
log_error "Missing value for option %B${1}%b"
exit 2
Expand Down Expand Up @@ -104,8 +105,8 @@ build() {
check_${host_os}
setup_ccache

if [[ ${host_os} == linux ]] {
autoload -Uz setup_linux && setup_linux
if [[ ${host_os} == ubuntu ]] {
autoload -Uz setup_ubuntu && setup_ubuntu
}

local product_name
Expand Down Expand Up @@ -188,21 +189,20 @@ build() {
}
popd
;;
linux-*)
ubuntu-*)
local cmake_bin='/usr/bin/cmake'
cmake_args+=(
-S ${PWD} -B build_${target##*-}
-G Ninja
-DCMAKE_BUILD_TYPE:STRING=${config}
-DCEF_ROOT_DIR:PATH="${project_root}/.deps/cef_binary_${CEF_VERSION}_${target//-/_}"
-DENABLE_AJA:BOOL=OFF
-DENABLE_WEBRTC:BOOL=OFF
-DENABLE_NATIVE_NVENC:BOOL=OFF
--preset ubuntu-ci
--toolchain ${project_root}/cmake/linux/toolchain-${target##*-}-gcc.cmake
-DENABLE_BROWSER:BOOL=ON
-DCEF_ROOT_DIR:PATH="${project_root}/.deps/cef_binary_${CEF_VERSION}_${target//ubuntu-/linux_}"
)

if (( ! UBUNTU_2210_OR_LATER )) cmake_args+=(-DENABLE_NEW_MPEGTS_OUTPUT:BOOL=OFF)
if [[ ${target##*-} == aarch64 ]] cmake-args+=(-DENABLE_QSV11:BOOL=OFF)

cmake_build_args+=(build_${target##*-} --config ${config} --parallel)
cmake_install_args+=(build_${target##*-} --prefix ${project_root}/build_${target##*-}/install/${config})
cmake_build_args+=(build_${target%%-*} --config ${config} --parallel)
cmake_install_args+=(build_${target%%-*} --prefix ${project_root}/build_${target%%-*}/install/${config})

log_group "Configuring ${product_name}..."
${cmake_bin} -S ${project_root} ${cmake_args}
Expand Down
31 changes: 22 additions & 9 deletions .github/scripts/.package.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ package() {
local -r -a _valid_targets=(
macos-x86_64
macos-arm64
linux-x86_64
ubuntu-x86_64
)

local config='RelWithDebInfo'
Expand Down Expand Up @@ -208,32 +208,45 @@ package() {

log_group

} elif [[ ${host_os} == linux ]] {
} elif [[ ${host_os} == ubuntu ]] {
local cmake_bin='/usr/bin/cmake'
local -a cmake_args=()
if (( debug )) cmake_args+=(--verbose)

if (( package )) {
log_group "Packaging obs-studio..."
pushd ${project_root}
${cmake_bin} --build build_${target##*-} --config ${config} -t package ${cmake_args}
output_name="${output_name}-${target##*-}-linux-gnu"
${cmake_bin} --build build_${target%%-*} --config ${config} --target package ${cmake_args}
output_name="${output_name}-${target##*-}-ubuntu-gnu"

pushd ${project_root}/build_${target##*-}
local -a files=(obs-studio-*-Linux*.(ddeb|deb))
pushd ${project_root}/build_${target%%-*}
local -a files=(obs-studio-*-Linux*.(ddeb|deb|ddeb.sha256|deb.sha256))
for file (${files}) {
mv ${file} ${file//obs-studio-*-Linux/${output_name}}
}
popd
popd
} else {
log_group "Archiving obs-studio..."
output_name="${output_name}-${target##*-}-linux-gnu"
output_name="${output_name}-${target##*-}-ubuntu-gnu"

pushd ${project_root}/build_${target##*-}/install/${config}
XZ_OPT=-T0 tar -cvJf ${project_root}/build_${target##*-}/${output_name}.tar.xz (bin|lib|share)
pushd ${project_root}/build_${target%%-*}/install/${config}
XZ_OPT=-T0 tar -cvJf ${project_root}/build_${target%%-*}/${output_name}.tar.xz (bin|lib|share)
popd
}

pushd ${project_root}
${cmake_bin} --build build_${target%%-*} --config ${config} --target package_source ${cmake_args}
output_name="${output_name}-sources"

pushd ${project_root}/build_${target%%-*}
local -a files=(obs-studio-*-sources.tar.*)
for file (${files}) {
mv ${file} ${file//obs-studio-*-sources/${output_name}}
}
popd
popd

log_group
}
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
autoload -Uz log_debug log_group

log_group 'Check Linux build requirements'
log_debug 'Checking Linux distribution name and version...'
log_group 'Check Ubuntu build requirements'
log_debug 'Checking Ubuntu distribution name and version...'

# Check for Ubuntu version 22.10 or later, which have srt and librist available via apt-get
typeset -g -i UBUNTU_2210_OR_LATER=0
if [[ -f /etc/os_release ]] {
if [[ -f /etc/os-release ]] {
local dist_name
local dist_version
read -r dist_name dist_version <<< "$(source /etc/os_release; print "${NAME} ${VERSION_ID}")"
read -r dist_name dist_version <<< "$(source /etc/os-release; print "${NAME} ${VERSION_ID}")"

if [[ ${dist_name} != Ubuntu ]] {
log_error "Not running on an Ubuntu distribution. Aborting"
log_group
return 2
}

autoload -Uz is-at-least
if [[ ${dist_name} == Ubuntu ]] && is-at-least 22.10 ${dist_version}; then
if is-at-least 22.10 ${dist_version}; then
typeset -g -i UBUNTU_2210_OR_LATER=1
fi
} else {
log_error "Unable to determine local Linux distribution, but Ubuntu is required. Aborting"
log_group
return 2
}

local -a dependencies=("${(fA)$(<${SCRIPT_HOME}/.Aptfile)}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ if (( ! deps_version )) {
log_group 'Setting up pre-built Chromium Embedded Framework...'

pushd ${project_root}/.deps
local _filename="cef_binary_${deps_version}_${target//-/_}${deps_revision:+"_v${deps_revision}"}.tar.xz"
local _filename="cef_binary_${deps_version}_${target//ubuntu-/linux_}${deps_revision:+"_v${deps_revision}"}.tar.xz"
local _url=${deps_baseurl}/${_filename}
local _target="cef_binary_${deps_version}_${target//-/_}"
local _target="cef_binary_${deps_version}_${target//ubuntu-/linux_}"
typeset -g CEF_VERSION=${deps_version}

log_debug "Running curl ${curl_opts} ${_url}"
Expand Down Expand Up @@ -75,14 +75,14 @@ if [[ ${CPUTYPE} != ${target##*-} ]] {
}

sudo apt-get install -y --no-install-recommends \
build-essential \
build-essential libglib2.0-dev \
lsb-release dh-cmake \
libcurl4-openssl-dev \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev \
libswresample-dev libswscale-dev \
libjansson-dev \
libx11-xcb-dev \
libgles2-mesa-dev libgles2-mesa \
libgles2-mesa-dev \
libwayland-dev \
libpipewire-0.3-dev \
libpulse-dev \
Expand All @@ -95,11 +95,13 @@ sudo apt-get install -y --no-install-recommends \
libx11-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-xinerama0-dev \
libxcb-composite0-dev libxinerama-dev libxcb1-dev libx11-xcb-dev libxcb-xfixes0-dev \
swig libcmocka-dev libxss-dev libglvnd-dev \
libxkbcommon-dev \
libxkbcommon-dev libatk1.0-dev libatk-bridge2.0-dev libxcomposite-dev libxdamage-dev \
libasound2-dev libfdk-aac-dev libfontconfig-dev libfreetype6-dev libjack-jackd2-dev \
libpulse-dev libsndio-dev libspeexdsp-dev libudev-dev libv4l-dev libva-dev libvlc-dev \
libpci-dev libdrm-dev \
nlohmann-json3-dev libwebsocketpp-dev libasio-dev libvpl-dev libvpl2 libqrcodegencpp-dev
nlohmann-json3-dev libwebsocketpp-dev libasio-dev libqrcodegencpp-dev

if [[ ${target##*-} == x86_64 ]] sudo apt-get install -y --no-install-recommends libvpl-dev libvpl2

if (( UBUNTU_2210_OR_LATER )) sudo apt-get install -y --no-install-recommends librist-dev libsrt-openssl-dev

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,22 @@ jobs:

- name: Upload Source Tarball 🗜️
uses: actions/upload-artifact@v4
if: ${{ ! always() }}
with:
name: obs-studio-*-sources-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/build_x86_64/obs-studio-*-sources.*
name: obs-studio-ubuntu-22.04-sources-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/build_ubuntu/obs-studio-*-sources.*

- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: obs-studio-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/build_x86_64/obs-studio-*-x86_64-linux-gnu.*
path: ${{ github.workspace }}/build_ubuntu/obs-studio-*-x86_64-ubuntu-gnu.*

- name: Upload Debug Symbol Artifacts 🪲
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.check-event.outputs.package) }}
with:
name: obs-studio-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
path: ${{ github.workspace }}/build_x86_64/obs-studio-*-x86_64-linux-gnu-dbgsym.ddeb
path: ${{ github.workspace }}/build_ubuntu/obs-studio-*-x86_64-ubuntu-gnu-dbgsym.ddeb

- uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ jobs:
macos_intel_dsym_artifact_name="obs-studio-macos-x86_64-${commit_hash}-dSYMs"
ubuntu_x86_64_artifact_name="obs-studio-ubuntu-22.04-x86_64-${commit_hash}"
ubuntu_x86_64_debug_name="obs-studio-ubuntu-22.04-x86_64-${commit_hash}-dbgsym"
ubuntu_sources_name="obs-studio-ubuntu-22.04-sources-${commit_hash}"

echo '::group::Renaming Artifacts'
mv -v "${macos_arm64_artifact_name}/"obs-studio-*-macos-apple.dmg \
Expand All @@ -278,6 +279,8 @@ jobs:
"${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-x86_64.deb
mv -v "${ubuntu_x86_64_debug_name}/"obs-studio-*-x86_64-linux-gnu-dbgsym.ddeb \
"${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-x86_64-dbsym.ddeb
mv -v "${ubuntu_sources_name}/"obs-studio-*-sources.tar.gz \
"${root_dir}"/OBS-Studio-${{ steps.check.outputs.version }}-Sources.tar.gz
echo '::endgroup::'

- name: Generate Checksums 🪪
Expand All @@ -288,7 +291,7 @@ jobs:
shopt -s extglob

echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
for file in ${{ github.workspace }}/@(*.deb|*.ddeb|*.dmg|*.tar.xz); do
for file in ${{ github.workspace }}/@(*.deb|*.ddeb|*.dmg|*.tar.xz|*.tar.gz); do
echo " ${file##*/}: $(sha256sum "${file}" | cut -d " " -f 1)" >> ${{ github.workspace }}/CHECKSUMS.txt
done

Expand All @@ -307,3 +310,4 @@ jobs:
${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-macOS-*-dSYMs.tar.xz
${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-*.deb
${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Ubuntu-*.ddeb
${{ github.workspace }}/OBS-Studio-${{ steps.check.outputs.version }}-Sources.tar.gz
Loading