From f83c6718927ed6e35123107e9de782c41d02087c Mon Sep 17 00:00:00 2001 From: Frankie Dintino Date: Wed, 27 Sep 2023 17:07:44 -0400 Subject: [PATCH] wip: full static build test --- wheelbuild/config.sh | 17 ++++++++++------- winbuild/build_prepare.py | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/wheelbuild/config.sh b/wheelbuild/config.sh index 6571b70..524c0d6 100644 --- a/wheelbuild/config.sh +++ b/wheelbuild/config.sh @@ -4,7 +4,7 @@ set -eo pipefail CONFIG_DIR=$(abspath $(dirname "${BASH_SOURCE[0]}")) ARCHIVE_SDIR=pillow-avif-plugin-depends -LIBAVIF_VERSION=1.0.1 +LIBAVIF_VERSION=d682ca63e6f466282b37fe65e82e382b0de9dcdd AOM_VERSION=3.7.0 DAV1D_VERSION=1.2.1 SVT_AV1_VERSION=1.7.0 @@ -23,6 +23,11 @@ alias trace_off='{ set +x; } 2>/dev/null' alias trace_suppress='{ [[ $- =~ .*x.* ]] && trace_enabled=1 || trace_enabled=0; set +x; } 2>/dev/null' alias trace_restore='{ [ $trace_enabled -eq 1 ] && trace_on || trace_off; } 2>/dev/null' +if [ -n "$IS_MACOS" ] && [ -n "$MACOSX_DEPLOYMENT_TARGET" ]; then + CFLAGS="${CFLAGS} -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" + LDFLAGS="${LDFLAGS} -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" +fi + call_and_restore_trace() { local rc local force_trace @@ -467,14 +472,11 @@ function build_libavif { group_start "Download libavif source" fetch_unpack \ - "https://github.com/AOMediaCodec/libavif/archive/v$LIBAVIF_VERSION.tar.gz" \ + "https://github.com/fdintino/libavif/archive/$LIBAVIF_VERSION.tar.gz" \ "libavif-$LIBAVIF_VERSION.tar.gz" group_end - (cd libavif-$LIBAVIF_VERSION \ - && patch -p1 -i $CONFIG_DIR/libavif-1.0.1-local-static.patch) - build_libsharpyuv mv libwebp-$LIBWEBP_SHA libavif-$LIBAVIF_VERSION/ext/libwebp LIBAVIF_CMAKE_FLAGS+=(-DAVIF_LOCAL_LIBSHARPYUV=ON) @@ -489,11 +491,12 @@ function build_libavif { (cd libavif-$LIBAVIF_VERSION/build \ && cmake .. \ + -G "Ninja" \ -DCMAKE_INSTALL_PREFIX=$BUILD_PREFIX \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -DBUILD_SHARED_LIBS=OFF \ "${LIBAVIF_CMAKE_FLAGS[@]}" \ - && make install) + && ninja -v install/strip) group_end } diff --git a/winbuild/build_prepare.py b/winbuild/build_prepare.py index 5ebf402..363e4ff 100644 --- a/winbuild/build_prepare.py +++ b/winbuild/build_prepare.py @@ -177,10 +177,10 @@ def cmd_msbuild( "libavif": { "url": ( "https://github.com/fdintino/libavif/archive/" - "217e76487e7ca81057e8de1d3a2ab095e1c4fcb1.zip" + "d682ca63e6f466282b37fe65e82e382b0de9dcdd.zip" ), - "filename": "libavif-217e76487e7ca81057e8de1d3a2ab095e1c4fcb1.zip", - "dir": "libavif-217e76487e7ca81057e8de1d3a2ab095e1c4fcb1", + "filename": "libavif-d682ca63e6f466282b37fe65e82e382b0de9dcdd.zip", + "dir": "libavif-d682ca63e6f466282b37fe65e82e382b0de9dcdd", "license": "LICENSE", "build": [ cmd_mkdir(r"ext\rav1e\build.libavif\usr"),