From 6d8470685daf6dd1dad2b7d498e717d697e55053 Mon Sep 17 00:00:00 2001 From: xurei Date: Mon, 28 Oct 2024 11:13:54 +0100 Subject: [PATCH] CI : Linux build fix (#9) --- .github/scripts/.build.zsh | 9 +++++++++ .github/scripts/utils.zsh/check_linux | 3 ++- .github/scripts/utils.zsh/setup_linux | 4 +++- .github/workflows/build-project.yaml | 8 ++++---- cmake/linux/defaults.cmake | 8 ++++++-- 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/scripts/.build.zsh b/.github/scripts/.build.zsh index 708fdcf..1067a20 100755 --- a/.github/scripts/.build.zsh +++ b/.github/scripts/.build.zsh @@ -186,6 +186,15 @@ ${_usage_host:-}" if [[ ${host_os} == linux ]] { autoload -Uz setup_linux && setup_linux + + # Install OBS 31.0.0 from github if installed OBS is < 31 + obs --version + obs_major_version=$(echo $(obs --version) | grep -oP '(?<=OBS Studio - )\d+') + if (( $obs_major_version < 31 )) { + log_info "Installed OBS is too old. Installing version 31.0.0.beta2 from github..." + curl -L -o obs-studio_31.0.0.beta2.deb https://github.com/obsproject/obs-studio/releases/download/31.0.0-beta2/obs-studio_31.0.0.beta2-0obsproject1.noble_amd64.deb + sudo dpkg --force-all -i obs-studio_31.0.0.beta2.deb + } } local product_name diff --git a/.github/scripts/utils.zsh/check_linux b/.github/scripts/utils.zsh/check_linux index a141c7c..72411a3 100755 --- a/.github/scripts/utils.zsh/check_linux +++ b/.github/scripts/utils.zsh/check_linux @@ -41,7 +41,8 @@ for dependency (${dependencies}) { binary=${tokens[2]} } - if (( ! ${+commands[${binary}]} )) install_list+=(${tokens[2]}) + local dep="${tokens[2]//[$'\t\r\n']}" + if (( ! ${+commands[${binary}]} )) install_list+=(${dep}) } log_debug "List of dependencies to install: ${install_list}" diff --git a/.github/scripts/utils.zsh/setup_linux b/.github/scripts/utils.zsh/setup_linux index 9efe243..4a4d66c 100755 --- a/.github/scripts/utils.zsh/setup_linux +++ b/.github/scripts/utils.zsh/setup_linux @@ -35,7 +35,9 @@ if (( ! (${skips[(Ie)all]} + ${skips[(Ie)deps]}) )) { sudo apt-get install ${apt_args} gcc-${${target##*-}//_/-}-linux-gnu g++-${${target##*-}//_/-}-linux-gnu } - sudo add-apt-repository --yes ppa:obsproject/obs-studio + if [[ "${CI}" ]]; then + sudo add-apt-repository --yes ppa:obsproject/obs-studio + fi sudo apt update sudo apt-get install ${apt_args} \ diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index b298347..d56437c 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -221,15 +221,15 @@ jobs: - name: Upload Artifacts 📡 uses: actions/upload-artifact@v4 with: - name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }} - path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.* + name: obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }} + path: ${{ github.workspace }}/release/obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.* - name: Upload debug symbol artifacts 🪲 uses: actions/upload-artifact@v4 if: ${{ fromJSON(needs.check-event.outputs.package) }} with: - name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym - path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*-dbgsym.ddeb + name: obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym + path: ${{ github.workspace }}/release/obs-${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*-dbgsym.ddeb windows-build: name: Build for Windows 🪟 diff --git a/cmake/linux/defaults.cmake b/cmake/linux/defaults.cmake index 72437a1..c8e7701 100644 --- a/cmake/linux/defaults.cmake +++ b/cmake/linux/defaults.cmake @@ -12,12 +12,16 @@ include(GNUInstallDirs) # Enable find_package targets to become globally available targets set(CMAKE_FIND_PACKAGE_TARGETS_GLOBAL TRUE) -set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") +set(CPACK_PACKAGE_NAME "obs-${CMAKE_PROJECT_NAME}") set(CPACK_PACKAGE_VERSION "${CMAKE_PROJECT_VERSION}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_C_LIBRARY_ARCHITECTURE}") +set(CPACK_DEBIAN_PACKAGE_ENHANCES "obs-studio") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Plugin for OBS Studio to add Source Profiler to tools menu") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "This plugin adds a Source Profiler to tools menu. Based on the source profiling ui (https://github.com/derrod/obs-studio/tree/source-profiling-ui)") set(CPACK_GENERATOR "DEB") -set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF) +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.14), libgcc-s1 (>= 3.0), libstdc++6 (>= 5), obs-studio (>= 31.0.0~beta2)") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${PLUGIN_EMAIL}") set(CPACK_SET_DESTDIR ON)