From bd91d16b2754e6c6936febbad0f1c02ab7e197f2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 31 May 2024 15:07:59 +0200 Subject: [PATCH] CI: common live555 handling --- .github/scripts/Linux/install_others.sh | 12 +-------- .github/scripts/Windows/build_live555.sh | 19 ------------- .github/scripts/install-common-deps.sh | 34 ++++++++++++++++++++++++ .github/scripts/macOS/install_others.sh | 10 +------ .github/workflows/ccpp.yml | 17 +++++------- 5 files changed, 42 insertions(+), 50 deletions(-) delete mode 100755 .github/scripts/Windows/build_live555.sh diff --git a/.github/scripts/Linux/install_others.sh b/.github/scripts/Linux/install_others.sh index 226d049a8..db012d976 100755 --- a/.github/scripts/Linux/install_others.sh +++ b/.github/scripts/Linux/install_others.sh @@ -30,16 +30,6 @@ install_gpujpeg() {( sudo ldconfig )} -# Install live555 -install_live555() {( - git clone https://github.com/xanview/live555/ - cd live555 - git checkout 35c375 - ./genMakefiles linux-64bit - make -j "$(nproc)" CPLUSPLUS_COMPILER="c++ -DXLOCALE_NOT_USED" - sudo make install -)} - # Install NDI install_ndi() {( if [ ! -f "Install_NDI_SDK_Linux.tar.gz" ]; then # it should be already cached in a CI step @@ -107,7 +97,7 @@ if [ $# -eq 1 ] && { [ "$1" = -h ] || [ "$1" = --help ] || [ "$1" = help ]; }; t fi if [ $# -eq 0 ] || [ $show_help ]; then - set -- gpujpeg live555 ndi pipewire rav1e vulkan ximea + set -- gpujpeg ndi pipewire rav1e vulkan ximea fi if [ $show_help ]; then diff --git a/.github/scripts/Windows/build_live555.sh b/.github/scripts/Windows/build_live555.sh deleted file mode 100755 index eb47880f8..000000000 --- a/.github/scripts/Windows/build_live555.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -ex - -export CC=gcc -export CXX=g++ - -cd /c -rm -rf live555 -git clone https://github.com/xanview/live555/ -cd live555 -git checkout 35c375 -./genMakefiles mingw - -# ensure binutils ld is used (not lld) -pacman -Sy --noconfirm binutils -PATH=/usr/bin:$PATH - -make -j "$(nproc)" -pacman -Rs --noconfirm binutils - diff --git a/.github/scripts/install-common-deps.sh b/.github/scripts/install-common-deps.sh index 28b2085e5..cea67bc40 100755 --- a/.github/scripts/install-common-deps.sh +++ b/.github/scripts/install-common-deps.sh @@ -75,6 +75,39 @@ install_juice() { ) } +download_build_live555() { + CPLUSPLUS_COMPILER=c++ # default + if is_win; then + export CC=gcc + export CXX=g++ + target=mingw + PATH=/usr/bin:$PATH + # ensure binutils ld is used (not lld) + pacman -Sy --noconfirm binutils + elif [ "$(uname -s)" = Linux ]; then + target=linux-64bit + CPLUSPLUS_COMPILER="c++ -DXLOCALE_NOT_USED" + else + target=macosx + fi + + git clone https://github.com/xanview/live555/ + cd live555 + git checkout 35c375 + ./genMakefiles "$target" + + make -j "$(nproc)" CPLUSPLUS_COMPILER="$CPLUSPLUS_COMPILER" + is_win && pacman -Rs --noconfirm binutils + cd .. +} + +install_live555() {( + if [ ! -d live555 ]; then + download_build_live555 + fi + sudo make -C live555 install +)} + install_pcp() { git clone https://github.com/libpcp/pcp.git ( @@ -99,6 +132,7 @@ fi install_aja install_ews install_juice +install_live555 install_pcp install_zfec diff --git a/.github/scripts/macOS/install_others.sh b/.github/scripts/macOS/install_others.sh index 0bd2e3992..a5c66e250 100755 --- a/.github/scripts/macOS/install_others.sh +++ b/.github/scripts/macOS/install_others.sh @@ -77,14 +77,6 @@ LIBRARY_PATH=$LIBRARY_PATH\nMY_DYLD_LIBRARY_PATH=$MY_DYLD_LIBRARY_PATH\n" >> \ "$GITHUB_ENV" } -install_live555() {( - git clone https://github.com/xanview/live555/ - cd live555 - git checkout 35c375 - ./genMakefiles macosx - sudo make -j "$(sysctl -n hw.ncpu)" install -)} - install_soundfont() {( sf_dir="$srcroot/data/template/macOS-bundle/Contents/share/soundfonts" mkdir -p "$sf_dir" @@ -112,7 +104,7 @@ if [ $# -eq 1 ] && { [ "$1" = -h ] || [ "$1" = --help ] || [ "$1" = help ]; }; t fi if [ $# -eq 0 ] || [ $show_help ]; then - set -- deltacast glfw live555 ndi soundfont syphon ximea + set -- deltacast glfw ndi soundfont syphon ximea fi if [ $show_help ]; then diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 642375cd2..da852fda5 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -273,6 +273,12 @@ jobs: with: path: 'libajantv2' key: cache-aja-${{ runner.os }}-${{ hashFiles('.github/scripts/install-common-deps.sh') }} + - name: Cache live555 + id: cache-live555 + uses: actions/cache@main + with: + path: 'live555' + key: cache-live555-${{ runner.os }}-${{ hashFiles('.github/scripts/install-common-deps.sh') }} - name: bootsrap run: .github/scripts/Windows/prepare.ps1 @@ -289,17 +295,6 @@ jobs: shell: pwsh -command ". '{0}'" - name: bootsrap MSYS2 run: $GITHUB_WORKSPACE/.github/scripts/Windows/prepare_msys.sh - - name: Cache live555 - id: cache-live555 - uses: actions/cache@main - with: - path: 'C:\live555' - key: cache-live555-${{ runner.os }}-${{ hashFiles('.github/scripts/Windows/build_live555.sh') }} - - name: Build live555 - if: steps.cache-live555.outputs.cache-hit != 'true' - run: $GITHUB_WORKSPACE/.github/scripts/Windows/build_live555.sh - - name: Install live555 - run: make -C /c/live555 install - name: Cache Spout build id: cache-spout