From 5f11402d9f70f149c2b259e0ffca33b6c26cc596 Mon Sep 17 00:00:00 2001 From: Frankie Dintino Date: Tue, 13 Aug 2024 22:43:16 -0400 Subject: [PATCH] fixup2 --- .github/workflows/wheels-dependencies.sh | 2 +- depends/install_libavif.sh | 48 ++++++++---------------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/.github/workflows/wheels-dependencies.sh b/.github/workflows/wheels-dependencies.sh index 5ce2ef5e6fe..3fded6046a0 100755 --- a/.github/workflows/wheels-dependencies.sh +++ b/.github/workflows/wheels-dependencies.sh @@ -96,7 +96,7 @@ EOF function build_libavif { install_rav1e - $PYTHON_EXE -m pip install meson + python -m pip install meson ninja if [[ "$CIBW_ARCHS" != "arm64" ]]; then build_simple nasm 2.15.05 https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/ diff --git a/depends/install_libavif.sh b/depends/install_libavif.sh index 05d1d082d27..5d4b59d9735 100755 --- a/depends/install_libavif.sh +++ b/depends/install_libavif.sh @@ -1,77 +1,59 @@ #!/usr/bin/env bash set -eo pipefail -LIBAVIF_VERSION=${LIBAVIF_VERSION:-12e066686892df1c8201cfb0d8d6c68ad248c872} +version=1.1.1 -LIBAVIF_CMAKE_FLAGS=() +./download-and-extract.sh libavif-$version https://github.com/AOMediaCodec/libavif/archive/refs/tags/v$version.tar.gz + +pushd libavif-$version if uname -s | grep -q Darwin; then - PREFIX=/usr/local + PREFIX=$(brew --prefix) else PREFIX=/usr fi -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" - PKGCONFIG=${PKGCONFIG:-pkg-config} -mkdir -p libavif-$LIBAVIF_VERSION -curl -sLo - \ - https://github.com/AOMediaCodec/libavif/archive/$LIBAVIF_VERSION.tar.gz \ - | tar --strip-components=1 -C libavif-$LIBAVIF_VERSION -zxf - -pushd libavif-$LIBAVIF_VERSION - +LIBAVIF_CMAKE_FLAGS=() HAS_DECODER=0 HAS_ENCODER=0 if $PKGCONFIG --exists dav1d; then - LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_DAV1D=ON) + LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_DAV1D=SYSTEM) HAS_DECODER=1 fi if $PKGCONFIG --exists rav1e; then - LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_RAV1E=ON) + LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_RAV1E=SYSTEM) HAS_ENCODER=1 fi if $PKGCONFIG --exists SvtAv1Enc; then - LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_SVT=ON) + LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_SVT=SYSTEM) HAS_ENCODER=1 fi if $PKGCONFIG --exists libgav1; then - LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_LIBGAV1=ON) + LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_LIBGAV1=SYSTEM) HAS_DECODER=1 fi if $PKGCONFIG --exists aom; then - LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=ON) + LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=SYSTEM) HAS_ENCODER=1 HAS_DECODER=1 fi if [ "$HAS_ENCODER" != 1 ] || [ "$HAS_DECODER" != 1 ]; then - pushd ext > /dev/null - bash aom.cmd - popd > /dev/null - LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON) + LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=LOCAL) fi -if uname -s | grep -q Darwin; then - # Prevent cmake from using @rpath in install id, so that delocate can - # find and bundle the libavif dylib - LIBAVIF_CMAKE_FLAGS+=("-DCMAKE_INSTALL_NAME_DIR=$PREFIX/lib" -DCMAKE_MACOSX_RPATH=OFF) -fi - -mkdir build -pushd build -cmake .. \ +cmake -S . -B build \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_INSTALL_NAME_DIR=$PREFIX/lib \ + -DCMAKE_MACOSX_RPATH=OFF \ "${LIBAVIF_CMAKE_FLAGS[@]}" -make -make install || sudo make install -popd popd