--- Begin Message ---
I think we only need the following CMake change on 4.4.x branch, the source 
code changes only apply to 4.6:
```
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e3eaa697fe..5cb3bf9fd8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -353,16 +353,22 @@ if(USE_WEBP)
 endif(USE_WEBP)
 
 if (USE_AVIF)
-    find_package(libavif 0.8.2 CONFIG)
-    if (TARGET avif)
-        list(APPEND LIBS avif)
-        add_definitions(-DHAVE_LIBAVIF=1)
-        list(APPEND SOURCES "imageio/imageio_avif.c")
-        set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} avif CACHE 
INTERNAL "")
+  # no version check in config mode because of major only match policy
+  find_package(libavif CONFIG)
+  if (TARGET avif)
+    if(libavif_VERSION VERSION_GREATER_EQUAL 0.8.2)
+      list(APPEND LIBS avif)
+      add_definitions(-DHAVE_LIBAVIF=1)
+      list(APPEND SOURCES "imageio/imageio_avif.c")
+      set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} avif CACHE 
INTERNAL "")
+    else()
+      set(libavif_FOUND NOTFOUND)
     endif()
+  endif()
 endif()
 
 if(USE_HEIF)
+  # no version check in config mode because of exact match policy
   find_package(libheif CONFIG)
   if(NOT TARGET heif)
     find_package(libheif 1.13.0 MODULE)
@@ -373,7 +379,7 @@ if(USE_HEIF)
       add_definitions(-DHAVE_LIBHEIF=1)
       list(APPEND SOURCES "imageio/imageio_heif.c")
       set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} heif heic hif 
CACHE INTERNAL "")
-      if(NOT TARGET avif)
+      if(NOT libavif_FOUND)
         # libheif can handle avif, too
         set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} avif CACHE 
INTERNAL "")
       endif()

```
I'll let @TurboGit decide if he wants to commit this to the branch...

P.S. Arch e.g. already patched this in a more minimal way: 
https://gitlab.archlinux.org/archlinux/packaging/packages/darktable/-/commit/9826742182bf9ebf8c8ea3c51f0545a60bcdec23

-- 
Reply to this email directly or view it on GitHub:
https://github.com/darktable-org/darktable/pull/15128#issuecomment-1752830715
You are receiving this because you commented.

Message ID: <darktable-org/darktable/pull/15128/c1752830...@github.com>

--- End Message ---

Reply via email to