Skip to content

Commit

Permalink
chore: update libavif to v1.0.3 (#43)
Browse files Browse the repository at this point in the history
Update libavif to v1.0.3 and update transitive dependencies (versions changed from previous release bolded in the table below).

|             |            |
|-------------|------------|
| **libavif** | **1.0.3** |
| **libaom**  | **3.8.1**  |
| **dav1d**   | **1.3.0**  |
| SVT-AV1 | 1.7.0  |
| **rav1e**   | **0.7.0**  |
  • Loading branch information
fdintino authored Feb 7, 2024
1 parent 0864e2c commit 53732f0
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 308 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Test

on: [push, pull_request]

on:
pull_request:
push:
branches:
- main
tags:
- '*'
jobs:
build:

Expand All @@ -26,7 +31,7 @@ jobs:
include:
- python-version: "3.9"
os: "ubuntu-20.04"
libavif-version: "1.0.1"
libavif-version: "88d3dccda111f6ccbcccd925179f67e7d6fdf4ff"
- python-version: "3.7"
PYTHONOPTIMIZE: 1
- python-version: "3.8"
Expand Down
25 changes: 15 additions & 10 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
name: Wheels

on: [push, pull_request]

on:
pull_request:
push:
branches:
- main
tags:
- '*'
env:
REPO_DIR: pillow-avif-plugin
BUILD_DEPENDS: ""
TEST_DEPENDS: "pytest pillow"
MACOSX_DEPLOYMENT_TARGET: "10.10"
WHEEL_SDIR: wheelhouse
CONFIG_PATH: pillow-avif-plugin/wheelbuild/config.sh
LIBAVIF_VERSION: ee29bec775ab8e6d555f602775301c14302b96e7
LIBAVIF_VERSION: 88d3dccda111f6ccbcccd925179f67e7d6fdf4ff

jobs:
build:
Expand Down Expand Up @@ -120,13 +125,13 @@ jobs:
export GITHUB_ACTIONS=1"
EOF
- name: Cache build
id: build-cache
uses: actions/cache@v3
with:
path: pillow-avif-plugin/depends/libavif-${{ env.LIBAVIF_VERSION }}
key:
${{ env.LIBAVIF_VERSION }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*') }}-${{ matrix.os }}-${{ env.PLAT }}
# - name: Cache build
# id: build-cache
# uses: actions/cache@v3
# with:
# path: pillow-avif-plugin/depends/libavif-${{ env.LIBAVIF_VERSION }}
# key:
# ${{ env.LIBAVIF_VERSION }}-${{ hashFiles('pillow-avif-plugin/wheelbuild/*.sh', 'pillow-avif-plugin/.github/workflows/wheels.yml', 'pillow-avif-plugin/depends/*') }}-${{ matrix.os }}-${{ env.PLAT }}

- name: Cache ccache/sccache
uses: actions/cache@v3
Expand Down
11 changes: 7 additions & 4 deletions depends/install_libavif.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export CXXFLAGS="-fPIC -O3 $CXXFLAGS"
ARCHIVE="${LIBAVIF_VERSION}.tar.gz"
if [[ "$LIBAVIF_VERSION" == *"."* ]]; then
ARCHIVE="v${ARCHIVE}"
HAS_EXT_DIR=1
fi

echo "::group::Fetching libavif"
Expand Down Expand Up @@ -67,10 +68,12 @@ if $PKGCONFIG --exists aom; then
fi

if [ "$HAS_ENCODER" != 1 ] || [ "$HAS_DECODER" != 1 ]; then
echo "::group::Building aom"
pushd ext > /dev/null
bash aom.cmd
popd > /dev/null
if [ -n "${HAS_EXT_DIR}" ]; then
echo "::group::Building aom"
pushd ext > /dev/null
bash aom.cmd
popd > /dev/null
fi
LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=ON -DAVIF_LOCAL_AOM=ON)
echo "::endgroup::"
fi
Expand Down
15 changes: 14 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ def readme():
IS_DEBUG = hasattr(sys, "gettotalrefcount")
PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version

libraries = ["avif"]
if sys.platform == "win32":
libraries.extend(
[
"advapi32",
"bcrypt",
"ntdll",
"userenv",
"ws2_32",
"kernel32",
]
)

setup(
name="pillow-avif-plugin",
description="A pillow plugin that adds avif support via libavif",
Expand All @@ -39,7 +52,7 @@ def readme():
"pillow_avif._avif",
["src/pillow_avif/_avif.c"],
depends=["avif/avif.h"],
libraries=["avif"],
libraries=libraries,
),
],
package_data={"": ["README.rst"]},
Expand Down
12 changes: 0 additions & 12 deletions wheelbuild/aom-fix-stack-size.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,3 @@ index a749a22..8411569 100644
Error:
aom_free(worker->impl_);
worker->impl_ = NULL;
diff --git a/aom_util/aom_thread.h b/aom_util/aom_thread.h
index 8d04312..efbed78 100644
--- a/aom_util/aom_thread.h
+++ b/aom_util/aom_thread.h
@@ -32,6 +32,7 @@
#include <process.h> // NOLINT
#include <windows.h> // NOLINT
typedef HANDLE pthread_t;
+typedef int pthread_attr_t;
typedef CRITICAL_SECTION pthread_mutex_t;

#if _WIN32_WINNT < 0x0600
Loading

0 comments on commit 53732f0

Please sign in to comment.