From f7892cd41e6cc68fc864df119dc03b9d2b1ce9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Egidio?= Date: Tue, 14 Jul 2026 22:49:49 +0100 Subject: [PATCH] [libavif] Add svt feature for SVT-AV1 encoding (#52859) --- ports/libavif/dependencies.diff | 7 ++++++- ports/libavif/portfile.cmake | 3 +++ ports/libavif/vcpkg.json | 8 ++++++++ versions/baseline.json | 2 +- versions/l-/libavif.json | 5 +++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/ports/libavif/dependencies.diff b/ports/libavif/dependencies.diff index 2a0f48992d..adaa0fc2c3 100644 --- a/ports/libavif/dependencies.diff +++ b/ports/libavif/dependencies.diff @@ -10,7 +10,7 @@ index a28e6c3..aaeb5d2 100644 set(AVIF_LIB_USE_CXX ON) endif(AVIF_LIBYUV_ENABLED) -@@ -849,13 +850,38 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) +@@ -849,13 +850,43 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) # Enable CMake configs in VCPKG mode if(BUILD_SHARED_LIBS OR VCPKG_TARGET_TRIPLET) @@ -25,6 +25,11 @@ index a28e6c3..aaeb5d2 100644 + list(APPEND avif_static_link_libs AOM::aom) + string(APPEND avif_find_dependencies "find_dependency(AOM CONFIG)\n") + endif() ++ if(AVIF_CODEC_SVT_ENABLED) ++ find_package(SVT-AV1 CONFIG REQUIRED) ++ list(APPEND avif_static_link_libs SVT-AV1::SVT-AV1) ++ string(APPEND avif_find_dependencies "find_dependency(SVT-AV1 CONFIG)\n") ++ endif() + if(AVIF_CODEC_DAV1D_ENABLED) + list(APPEND avif_static_link_libs ${DAV1D_LIBRARIES} ${CMAKE_DL_LIBS}) + endif() diff --git a/ports/libavif/portfile.cmake b/ports/libavif/portfile.cmake index 690bc33e45..2b8e42622c 100644 --- a/ports/libavif/portfile.cmake +++ b/ports/libavif/portfile.cmake @@ -17,6 +17,9 @@ endif() if("dav1d" IN_LIST FEATURES) list(APPEND FEATURE_OPTIONS "-DAVIF_CODEC_DAV1D=SYSTEM") endif() +if("svt" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS "-DAVIF_CODEC_SVT=SYSTEM") +endif() vcpkg_find_acquire_program(PKGCONFIG) diff --git a/ports/libavif/vcpkg.json b/ports/libavif/vcpkg.json index 93d36b22db..10925a60bf 100644 --- a/ports/libavif/vcpkg.json +++ b/ports/libavif/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libavif", "version-semver": "1.4.2", + "port-version": 1, "description": "Library for encoding and decoding AVIF files", "homepage": "https://github.com/AOMediaCodec/libavif", "license": "BSD-2-Clause AND Apache-2.0", @@ -27,6 +28,13 @@ "dependencies": [ "dav1d" ] + }, + "svt": { + "description": "SVT-AV1 encoder library", + "supports": "!x86 & !arm32 & !uwp", + "dependencies": [ + "svt-av1" + ] } } } diff --git a/versions/baseline.json b/versions/baseline.json index 8e8883c6cf..526b8c6de7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4798,7 +4798,7 @@ }, "libavif": { "baseline": "1.4.2", - "port-version": 0 + "port-version": 1 }, "libb2": { "baseline": "0.98.1", diff --git a/versions/l-/libavif.json b/versions/l-/libavif.json index 29db57f032..077470cd6f 100644 --- a/versions/l-/libavif.json +++ b/versions/l-/libavif.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "cad3f5196a32c420fb9aebfc2a8a5876e5c36129", + "version-semver": "1.4.2", + "port-version": 1 + }, { "git-tree": "cc1d820f4db3384d7184714b82878fe8fa5b71fc", "version-semver": "1.4.2",