From 75aba66db74b01d7d447bc55e388e561c566278b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 6 Dec 2024 11:32:05 +1100 Subject: [PATCH] usebuildonaarch64 --- .github/workflows/wheels-dependencies.sh | 49 +++++++++++++++++------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 446caedea23..f1259db14ea 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -99,21 +99,42 @@ function build_harfbuzz { function build_rav1e { if [ -e rav1e-stamp ]; then return; fi - curl https://sh.rustup.rs -sSf | sh -s -- -y - . "$HOME/.cargo/env" - - if [ -n "$IS_ALPINE" ]; then - apk add openssl-dev openssl-libs-static - elif [ -z "$IS_MACOS" ]; then - yum install -y openssl-devel - fi - - local out_dir=$(fetch_unpack https://github.com/xiph/rav1e/archive/refs/tags/v$RAV1E_VERSION.tar.gz) - cargo install cargo-c - if [ -n "$IS_MACOS" ]; then - (cd $out_dir && sudo cargo cinstall --release) + if [[ "$PLAT" == "aarch64" ]]; then + curl -sLo - \ + https://github.com/xiph/rav1e/releases/download/v$RAV1E_VERSION/librav1e-$RAV1E_VERSION-linux-aarch64.tar.gz \ + | tar -C $BUILD_PREFIX --exclude LICENSE --exclude '*.so' --exclude '*.dylib' -zxf - + + if [ -z "$IS_MACOS" ]; then + sed -i 's/-lgcc_s/-lgcc_eh/g' "${BUILD_PREFIX}/lib/pkgconfig/rav1e.pc" + fi + + # Force libavif to treat system rav1e as if it were local + mkdir -p /tmp/cmake/Modules + cat < /tmp/cmake/Modules/Findrav1e.cmake + add_library(rav1e::rav1e STATIC IMPORTED GLOBAL) + set_target_properties(rav1e::rav1e PROPERTIES + IMPORTED_LOCATION "$BUILD_PREFIX/lib/librav1e.a" + AVIF_LOCAL ON + INTERFACE_INCLUDE_DIRECTORIES "$BUILD_PREFIX/include/rav1e" + ) +EOF else - (cd $out_dir && cargo cinstall --release) + curl https://sh.rustup.rs -sSf | sh -s -- -y + . "$HOME/.cargo/env" + + if [ -n "$IS_ALPINE" ]; then + apk add openssl-dev openssl-libs-static + elif [ -z "$IS_MACOS" ]; then + yum install -y openssl-devel + fi + + local out_dir=$(fetch_unpack https://github.com/xiph/rav1e/archive/refs/tags/v$RAV1E_VERSION.tar.gz) + cargo install cargo-c + if [ -n "$IS_MACOS" ]; then + (cd $out_dir && sudo cargo cinstall --release) + else + (cd $out_dir && cargo cinstall --release) + fi fi touch rav1e-stamp }