From f5467237aede2da5dbc1d60a5b983bd6cb4c5b7e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 20 Mar 2024 10:08:08 +0100 Subject: [PATCH] CI Linux: download rav1e build instead of building own Building rav1e requires nasm 2.15 (if asm is not disabled) while U20 has just 2.14.02, so that the build in CI currently fails, anyways. Pick sse4 for now but expect using avx2 version later, depending on UG_ARCH value. \+ populate PKG_CONFIG_PATH immediately --- .github/scripts/Linux/install_others.sh | 17 ++++++++++++++++- .github/scripts/Linux/prepare.sh | 3 ++- .github/scripts/Linux/rav1e.sh | 11 ----------- .github/workflows/ccpp.yml | 13 ------------- 4 files changed, 18 insertions(+), 26 deletions(-) delete mode 100755 .github/scripts/Linux/rav1e.sh diff --git a/.github/scripts/Linux/install_others.sh b/.github/scripts/Linux/install_others.sh index 8fc91e551..6d7184c95 100755 --- a/.github/scripts/Linux/install_others.sh +++ b/.github/scripts/Linux/install_others.sh @@ -78,6 +78,21 @@ install_pipewire() {( fi )} +install_rav1e() {( + # TODO: use avx2 later + if expr "${UG_ARCH-}" : '.*avx' >/dev/null; then + avx2=avx2 + fi + fpattern="librav1e.*linux-${avx2-sse4}.tar.gz" + "${GITHUB_WORKSPACE-.}"/.github/scripts/download-gh-asset.sh xiph/rav1e \ + "$fpattern" librav1e.tar.gz + sudo tar xaf librav1e.tar.gz -C /usr/local + sudo rm -rf /usr/local/lib/librav1e.so* + sudo sed -i -e 's-prefix=dist-prefix=/usr/local-' \ + -e 's/-lrav1e/-lrav1e -lm -pthread/' \ + /usr/local/lib/pkgconfig/rav1e.pc +)} + # FFmpeg master needs at least v1.3.238 as for 23th Aug '23 install_vulkan() {( # TOREMOVE: FFmpeg doesn't currently build with main (2024-02-09) @@ -101,7 +116,7 @@ if [ $# -eq 1 ] && { [ "$1" = -h ] || [ "$1" = --help ] || [ "$1" = help ]; }; t fi if [ $# -eq 0 ] || [ $show_help ]; then - set -- aja gpujpeg live555 ndi pipewire vulkan ximea + set -- aja gpujpeg live555 ndi pipewire rav1e vulkan ximea fi if [ $show_help ]; then diff --git a/.github/scripts/Linux/prepare.sh b/.github/scripts/Linux/prepare.sh index bf1d6e192..b44a6d16f 100755 --- a/.github/scripts/Linux/prepare.sh +++ b/.github/scripts/Linux/prepare.sh @@ -1,9 +1,10 @@ #!/bin/bash -eux +export PKG_CONFIG_PATH=/usr/local/qt/lib/pkgconfig:/usr/local/lib/pkgconfig printf "%b" "AJA_DIRECTORY=/var/tmp/ntv2\n\ CPATH=/usr/local/qt/include\n\ LIBRARY_PATH=/usr/local/qt/lib\n\ -PKG_CONFIG_PATH=/usr/local/qt/lib/pkgconfig\n" >> "$GITHUB_ENV" +PKG_CONFIG_PATH=$PKG_CONFIG_PATH\n" >> "$GITHUB_ENV" printf "/usr/local/qt/bin\n" >> "$GITHUB_PATH" git config --global user.name "UltraGrid Builder" diff --git a/.github/scripts/Linux/rav1e.sh b/.github/scripts/Linux/rav1e.sh deleted file mode 100755 index 26e0547a0..000000000 --- a/.github/scripts/Linux/rav1e.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -eux -# -# Builds rav1e but doesn't install it - -rustup update -cargo install cargo-c -git clone --depth 1 https://github.com/xiph/rav1e.git -cd rav1e -cargo build --release -cargo cinstall --release --destdir=install - diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 22bd7d4e9..40d1286ee 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -76,19 +76,6 @@ jobs: run: | . .github/scripts/environment.sh .github/scripts/Linux/prepare.sh - - name: Cache rav1e - id: cache-rav1e - uses: actions/cache@main - with: - path: rav1e - key: cache-rav1e-${{ runner.os }}-${{ hashFiles('.github/scripts/Linux/rav1e.sh') }} - - name: Build rav1e - if: steps.cache-rav1e.outputs.cache-hit != 'true' - run: .github/scripts/Linux/rav1e.sh - - name: Install rav1e - run: | - sudo cp -r rav1e/install/* / - sudo ldconfig - name: Cache FFmpeg id: cache-ffmpeg uses: actions/cache@main