Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix
Browse files Browse the repository at this point in the history
radarhere committed Dec 6, 2024
1 parent 700f955 commit 7ae3a4b
Showing 1 changed file with 37 additions and 7 deletions.
44 changes: 37 additions & 7 deletions .github/workflows/wheels-dependencies.sh
Original file line number Diff line number Diff line change
@@ -106,13 +106,43 @@ function build_libavif {

python3 -m pip install meson ninja

curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"
if [[ -z "$IS_MACOS" ]] && [[ "$MB_ML_VER" == 2014 ]]; then
# This can be removed once Amazon 2 is EOL on 30 June 2025
if [[ "$PLAT" == "aarch64" ]]; then
suffix="aarch64"
else
suffix="generic"
fi

curl -sLo - \
https://github.com/xiph/rav1e/releases/download/v$RAV1E_VERSION/librav1e-$RAV1E_VERSION-linux-$suffix.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

rav1e=SYSTEM
else
curl https://sh.rustup.rs -sSf | sh -s -- -y
. "$HOME/.cargo/env"

if [ -z "$IS_ALPINE" ] && [ -z "$IS_MACOS" ]; then
yum install -y perl
fi

if [ -n "$IS_ALPINE" ]; then
apk add perl
elif [ -z "$IS_MACOS" ]; then
yum install -y perl
rav1e=LOCAL
fi

local out_dir=$(fetch_unpack https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$LIBAVIF_VERSION.tar.gz libavif-$LIBAVIF_VERSION.tar.gz)
@@ -124,7 +154,7 @@ function build_libavif {
-DBUILD_SHARED_LIBS=OFF \
-DAVIF_LIBSHARPYUV=LOCAL \
-DAVIF_LIBYUV=LOCAL \
-DAVIF_CODEC_RAV1E=LOCAL \
-DAVIF_CODEC_RAV1E=$rav1e \
-DAVIF_CODEC_AOM=LOCAL \
-DAVIF_CODEC_DAV1D=LOCAL \
-DAVIF_CODEC_SVT=LOCAL \

0 comments on commit 7ae3a4b

Please sign in to comment.