Skip to content

Commit

Permalink
deps.ffmpeg: Add missing fixup step for libdatachannel
Browse files Browse the repository at this point in the history
Every dynamic library shipped with OBS Studio needs to properly
stripped, its debug information converted into a dSYM file and also
its versioned filename removed from the library ID.

Also fixes a build issue with its dependency mbedtls when using
Release configuration.
  • Loading branch information
PatTheMav authored and RytoEX committed Aug 16, 2023
1 parent cc4cbb9 commit ace0d9f
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps.ffmpeg/60-mbedtls.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ config() {
-DGEN_FILES=OFF
)

if [[ ${config} == Release ]] args+=(-DCMAKE_C_FLAGS="${c_flags} -std=c17 -g")
if [[ ${config} == Release ]] args+=(-DCMAKE_C_FLAGS="-std=c17 -g")

log_info "Config (%F{3}${target}%f)"
cd "${dir}"
Expand Down
47 changes: 46 additions & 1 deletion deps.ffmpeg/70-libdatachannel.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,50 @@ install() {
}

fixup() {
}
cd ${dir}

log_info "Fixup (%F{3}${target}%f)"

local strip_tool
local -a strip_files

case ${target} {
macos*)
if (( shared_libs )) {
local -a dylib_files=(${target_config[output_dir]}/lib/libdatachannel*.dylib(.))

autoload -Uz fix_rpaths && fix_rpaths ${dylib_files}

if [[ ${config} == Release ]] dsymutil ${dylib_files}

strip_tool=strip
strip_files=(${dylib_files})
} else {
rm -rf -- ${target_config[output_dir]}/lib/libdatachannel*.(dylib|dSYM)(N)
}
;;
linux*)
if (( shared_libs )) {
strip_tool=strip
strip_files=(${target_config[output_dir]}/lib/libdatachannel.so*(.))
} else {
rm -rf -- ${target_config[output_dir]}/lib/libdatachannel.so*(N)
}
;;
windows-x*)
if (( shared_libs )) {
autoload -Uz create_importlibs
create_importlibs ${target_config[output_dir]}/bin/libdatachannel*.dll(.)

strip_tool=${target_config[cross_prefix]}-w64-mingw32-strip
strip_files=(${target_config[output_dir]}/bin/libdatachannel*.dll(.))
} else {
rm -rf -- ${target_config[output_dir]}/bin/libdatachannel*.dll(N)
}

autoload -Uz restore_dlls && restore_dlls
;;
}

if (( #strip_files )) && [[ ${config} == (Release|MinSizeRel) ]] ${strip_tool} -x ${strip_files}
}

0 comments on commit ace0d9f

Please sign in to comment.