Skip to content

Commit

Permalink
wip: full static build test
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Sep 28, 2023
1 parent 72c1617 commit f83c671
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
17 changes: 10 additions & 7 deletions wheelbuild/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit f83c671

Please sign in to comment.