Skip to content

Commit

Permalink
usebuildonaarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 6, 2024
1 parent 1a36509 commit 75aba66
Showing 1 changed file with 35 additions and 14 deletions.
49 changes: 35 additions & 14 deletions .github/workflows/wheels-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF > /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
}
Expand Down

0 comments on commit 75aba66

Please sign in to comment.