aboutsummaryrefslogtreecommitdiff
path: root/ports/libwebp
diff options
context:
space:
mode:
Diffstat (limited to 'ports/libwebp')
-rw-r--r--ports/libwebp/0001-add-install-to-cmake.patch21
-rw-r--r--ports/libwebp/0002-add-missing-directory-to-cmake.patch12
-rw-r--r--ports/libwebp/CONTROL2
-rw-r--r--ports/libwebp/FindWebP.cmake27
-rw-r--r--ports/libwebp/build_fixes.patch33
-rw-r--r--ports/libwebp/portfile.cmake32
6 files changed, 77 insertions, 50 deletions
diff --git a/ports/libwebp/0001-add-install-to-cmake.patch b/ports/libwebp/0001-add-install-to-cmake.patch
deleted file mode 100644
index 206e87fc3..000000000
--- a/ports/libwebp/0001-add-install-to-cmake.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 0c62dd19..a2f72106 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -95,6 +95,16 @@ foreach(I_FILE RANGE ${WEBP_SIMD_FILES_TO_INCLUDE_RANGE})
- )
- endforeach()
-
-+# Install the headers
-+file(GLOB PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/*.h)
-+install(FILES ${PUBLIC_HEADERS} DESTINATION include/webp)
-+
-+# Install the library
-+install(TARGETS webp
-+ RUNTIME DESTINATION bin
-+ LIBRARY DESTINATION lib
-+ ARCHIVE DESTINATION lib)
-+
- # Build the executables if asked for.
- if(WEBP_BUILD_CWEBP OR WEBP_BUILD_DWEBP OR
- WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
diff --git a/ports/libwebp/0002-add-missing-directory-to-cmake.patch b/ports/libwebp/0002-add-missing-directory-to-cmake.patch
deleted file mode 100644
index 92c52a9c7..000000000
--- a/ports/libwebp/0002-add-missing-directory-to-cmake.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index a2f72106..469f03b4 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -68,6 +68,7 @@ parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/dec "WEBP_SRCS")
- parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/demux "WEBP_SRCS")
- parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/dsp "WEBP_SRCS")
- parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/enc "WEBP_SRCS")
-+parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_SRCS")
- parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/utils "WEBP_SRCS")
-
- # Remove the files specific to SIMD we don't use.
diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL
index 2b3c36554..3e3ae16d8 100644
--- a/ports/libwebp/CONTROL
+++ b/ports/libwebp/CONTROL
@@ -1,3 +1,3 @@
Source: libwebp
-Version: 0.6.0-1
+Version: 0.6.1-2
Description: Lossy compression of digital photographic images.
diff --git a/ports/libwebp/FindWebP.cmake b/ports/libwebp/FindWebP.cmake
new file mode 100644
index 000000000..c39a0eb05
--- /dev/null
+++ b/ports/libwebp/FindWebP.cmake
@@ -0,0 +1,27 @@
+include(SelectLibraryConfigurations)
+include(FindPackageHandleStandardArgs)
+
+# If the user has provided ``WEBP_ROOT``, use it! Choose items found
+# at this location over system locations.
+if( EXISTS "$ENV{WEBP_ROOT}" )
+ file( TO_CMAKE_PATH "$ENV{WEBP_ROOT}" WEBP_ROOT )
+ set( WEBP_ROOT "${WEBP_ROOT}" CACHE PATH "Prefix for WebP installation." )
+elseif(EXISTS "$ENV{WEBP_DIR}" )
+ file( TO_CMAKE_PATH "$ENV{WEBP_DIR}" WEBP_ROOT )
+ set( WEBP_ROOT "${WEBP_ROOT}" CACHE PATH "Prefix for WebP installation." )
+endif()
+
+if(NOT WEBP_INCLUDE_DIR)
+ FIND_PATH(WEBP_INCLUDE_DIR NAMES webp/decode.h)
+endif()
+
+if(NOT WEBP_LIBRARY)
+ find_library(WEBP_LIBRARY_RELEASE NAMES webp PATHS ${WEBP_ROOT} PATH_SUFFIXES webp )
+ find_library(WEBP_LIBRARY_DEBUG NAMES webpd PATHS ${WEBP_ROOT} PATH_SUFFIXES debug webp webp/debug debug/webp)
+ select_library_configurations(WEBP)
+endif()
+
+SET(WEBP_LIBRARIES ${WEBP_LIBRARY})
+SET(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR})
+
+find_package_handle_standard_args(WEBP REQUIRED_VARS WEBP_LIBRARY WEBP_INCLUDE_DIR)
diff --git a/ports/libwebp/build_fixes.patch b/ports/libwebp/build_fixes.patch
new file mode 100644
index 000000000..72cb304a9
--- /dev/null
+++ b/ports/libwebp/build_fixes.patch
@@ -0,0 +1,33 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3b105e37..f9b806c4 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -106,6 +106,9 @@ endforeach()
+ if(MSVC)
+ # avoid security warnings for e.g., fopen() used in the examples.
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
++ if(BUILD_SHARED_LIBS)
++ add_definitions(-DWEBP_EXTERN=__declspec\(dllexport\))
++ endif()
+ else()
+ add_definitions(-Wall)
+ endif()
+@@ -235,6 +238,10 @@ if(WEBP_BUILD_GIF2WEBP AND NOT GIF_FOUND)
+ endif()
+
+ if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
++ set(WEBP_BUILD_MUX ON)
++endif()
++
++if(WEBP_BUILD_MUX)
+ parse_Makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS"
+ "")
+ add_library(webpmux ${WEBP_MUX_SRCS})
+@@ -322,6 +329,7 @@ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/decode.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h
+ DESTINATION include/webp)
+ install(TARGETS ${INSTALLED_LIBRARIES}
++ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake
index 2c70513b8..e4f5dbbc8 100644
--- a/ports/libwebp/portfile.cmake
+++ b/ports/libwebp/portfile.cmake
@@ -1,37 +1,37 @@
include(vcpkg_common_functions)
-set(WEBP_VERSION 0.6.0)
-set(WEBP_HASH 59491b3837c7c96e56407c479722ad48b08b6133b123b61f66c5f0b61a1e8222ed20006b5c6fc708791bed72ac65e707aa25635e07fd11c81f26cc1e23892f48)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebp-${WEBP_VERSION})
-
-vcpkg_download_distfile(ARCHIVE
- URLS "https://github.com/webmproject/libwebp/archive/v${WEBP_VERSION}.zip"
- FILENAME "libwebp-${WEBP_VERSION}.zip"
- SHA512 ${WEBP_HASH}
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO webmproject/libwebp
+ REF v0.6.1
+ SHA512 313b345a01c91eb07c2e4d46b93fcda9c50dca9e05e39f757238a679355514a2e9bc9bc220f3d3eb6d6a55148957cb2be14dac330203953337759841af1a32bf
+ HEAD_REF master
)
-vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
- PATCHES ${CMAKE_CURRENT_LIST_DIR}/0001-add-install-to-cmake.patch
- ${CMAKE_CURRENT_LIST_DIR}/0002-add-missing-directory-to-cmake.patch
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/build_fixes.patch
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
- # dllexport support seem to be broken
- OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON
- -DCMAKE_DEBUG_POSTFIX=d
+ OPTIONS
+ -DCMAKE_DEBUG_POSTFIX=d
+ -DWEBP_BUILD_MUX=ON
)
-vcpkg_build_cmake()
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share)
# Handle copyright
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libwebp/COPYING ${CURRENT_PACKAGES_DIR}/share/libwebp/copyright)
-vcpkg_copy_pdbs() \ No newline at end of file
+vcpkg_copy_pdbs()
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindWebP.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp)