Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ports/sail/avif.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/src/sail-codecs/avif/CMakeLists.txt b/src/sail-codecs/avif/CMakeLists.txt
index 3f36e0c8..7a24ad25 100644
--- a/src/sail-codecs/avif/CMakeLists.txt
+++ b/src/sail-codecs/avif/CMakeLists.txt
@@ -1,7 +1,6 @@
-find_library(AVIF_LIBRARY avif ${SAIL_CODEC_AVIF_REQUIRED_OPTION})
-find_path(AVIF_INCLUDE_DIRS avif/avif.h ${SAIL_CODEC_AVIF_REQUIRED_OPTION})
+find_package(libavif CONFIG ${SAIL_CODEC_AVIF_REQUIRED_OPTION})

-if (NOT AVIF_LIBRARY OR NOT AVIF_INCLUDE_DIRS)
+if (NOT libavif_FOUND)
return()
endif()

@@ -18,5 +17,4 @@ set(SAIL_CODECS_FIND_DEPENDENCIES ${SAIL_CODECS_FIND_DEPENDENCIES} "find_depende
sail_codec(NAME avif
SOURCES helpers.h helpers.c io.h io.c avif.c
ICON avif.png
- DEPENDENCY_INCLUDE_DIRS ${AVIF_INCLUDE_DIRS}
- DEPENDENCY_LIBS ${AVIF_LIBRARY})
+ DEPENDENCY_LIBS avif)
3 changes: 3 additions & 0 deletions ports/sail/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ vcpkg_from_github(
REF v0.9.0-rc3
SHA512 5de94277d57b862d4ab99266c2608cd37d7ca9eb89ef753ddddf47e4cebffab54b2cfb9c28d0c3bb7721f0d24c1310377c4b42adab477568e6965bd7ebc55b17
HEAD_REF master
PATCHES
avif.patch
webp.patch
)

# Enable selected codecs
Expand Down
2 changes: 1 addition & 1 deletion ports/sail/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sail",
"version-semver": "0.9.0-rc3",
"port-version": 1,
"port-version": 2,
"description": "The missing small and fast image decoding library for humans (not for machines)",
"homepage": "https://github.com/HappySeaFox/sail",
"license": "MIT",
Expand Down
39 changes: 39 additions & 0 deletions ports/sail/webp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/src/sail-codecs/webp/CMakeLists.txt b/src/sail-codecs/webp/CMakeLists.txt
index 64d31e5a..40c33084 100644
--- a/src/sail-codecs/webp/CMakeLists.txt
+++ b/src/sail-codecs/webp/CMakeLists.txt
@@ -1,28 +1,20 @@
-find_library(WEBP_RELEASE_LIBRARY NAMES webp ${SAIL_CODEC_WEBP_REQUIRED_OPTION})
-find_library(WEBP_DEBUG_LIBRARY NAMES webpd webp ${SAIL_CODEC_WEBP_REQUIRED_OPTION})
-find_library(WEBP_DEMUX_RELEASE_LIBRARY NAMES webpdemux ${SAIL_CODEC_WEBP_REQUIRED_OPTION})
-find_library(WEBP_DEMUX_DEBUG_LIBRARY NAMES webpdemuxd webpdemux ${SAIL_CODEC_WEBP_REQUIRED_OPTION})
-find_path(WEBP_INCLUDE_DIRS webp/decode.h ${SAIL_CODEC_WEBP_REQUIRED_OPTION})
+find_package(WebP CONFIG ${SAIL_CODEC_WEBP_REQUIRED_OPTION})

-if ((NOT WEBP_RELEASE_LIBRARY AND NOT WEBP_DEBUG_LIBRARY) OR (NOT WEBP_DEMUX_RELEASE_LIBRARY AND NOT WEBP_DEMUX_DEBUG_LIBRARY) OR NOT WEBP_INCLUDE_DIRS)
+if (NOT WebP_FOUND)
return()
endif()

# This will add the following CMake rules to the CMake config for static builds so a client
# application links against the required dependencies:
#
-# find_library(webp_RELEASE_LIBRARY NAMES webp)
-# find_library(webp_DEBUG_LIBRARY NAMES webpd webp)
-# set_property(TARGET SAIL::sail-codecs APPEND PROPERTY INTERFACE_LINK_LIBRARIES $<$<CONFIG:Release>:${webp_RELEASE_LIBRARY}> $<$<CONFIG:Debug>:${webp_DEBUG_LIBRARY}>)
+# find_dependency(LIBWEBP REQUIRED)
+# set_property(TARGET SAIL::sail-codecs APPEND PROPERTY INTERFACE_LINK_LIBRARIES WebP::webp WebP::webpdecoder WebP::webpdemux)
#
-# Same to webpdemux.
-#
-set(SAIL_CODECS_FIND_DEPENDENCIES ${SAIL_CODECS_FIND_DEPENDENCIES} "find_library,webp,webpd" "find_library,webpdemux,webpdemuxd" PARENT_SCOPE)
+set(SAIL_CODECS_FIND_DEPENDENCIES ${SAIL_CODECS_FIND_DEPENDENCIES} "find_dependency,WEBP,WebP::webp WebP::webpdecoder WebP::webpdemux" PARENT_SCOPE)

# Common codec configuration
#
sail_codec(NAME webp
SOURCES helpers.h helpers.c webp.c
ICON webp.png
- DEPENDENCY_INCLUDE_DIRS ${WEBP_INCLUDE_DIRS}
- DEPENDENCY_LIBS optimized ${WEBP_RELEASE_LIBRARY} debug ${WEBP_DEBUG_LIBRARY} optimized ${WEBP_DEMUX_RELEASE_LIBRARY} debug ${WEBP_DEMUX_DEBUG_LIBRARY})
+ DEPENDENCY_LIBS WebP::webp WebP::webpdecoder WebP::webpdemux)
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7086,7 +7086,7 @@
},
"sail": {
"baseline": "0.9.0-rc3",
"port-version": 1
"port-version": 2
},
"sais": {
"baseline": "2.4.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/sail.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0c604af0721281506a77f887d07abca30fe350c3",
"version-semver": "0.9.0-rc3",
"port-version": 2
},
{
"git-tree": "66576c788934d4684f862ba663b49f1bb80c4d4d",
"version-semver": "0.9.0-rc3",
Expand Down