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/CONTROL3
-rw-r--r--ports/libwebp/portfile.cmake31
4 files changed, 67 insertions, 0 deletions
diff --git a/ports/libwebp/0001-add-install-to-cmake.patch b/ports/libwebp/0001-add-install-to-cmake.patch
new file mode 100644
index 000000000..3f9cfc0c5
--- /dev/null
+++ b/ports/libwebp/0001-add-install-to-cmake.patch
@@ -0,0 +1,21 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3cb9c3b..f05800d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -276,6 +276,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)
+ # Example utility library.
diff --git a/ports/libwebp/0002-add-missing-directory-to-cmake.patch b/ports/libwebp/0002-add-missing-directory-to-cmake.patch
new file mode 100644
index 000000000..a1d230479
--- /dev/null
+++ b/ports/libwebp/0002-add-missing-directory-to-cmake.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9172f66..df46bd1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -249,6 +249,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 user.
diff --git a/ports/libwebp/CONTROL b/ports/libwebp/CONTROL
new file mode 100644
index 000000000..608ba2f59
--- /dev/null
+++ b/ports/libwebp/CONTROL
@@ -0,0 +1,3 @@
+Source: libwebp
+Version: 0.5.1-1
+Description: Lossy compression of digital photographic images.
diff --git a/ports/libwebp/portfile.cmake b/ports/libwebp/portfile.cmake
new file mode 100644
index 000000000..8b4c653a9
--- /dev/null
+++ b/ports/libwebp/portfile.cmake
@@ -0,0 +1,31 @@
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libwebp-0.5.1)
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://github.com/webmproject/libwebp/archive/v0.5.1.zip"
+ FILENAME "libwebp-0.5.1.zip"
+ SHA512 1d9b218e3b6df50e7bc71b1338619b142a9dcd6cb7cbde2e7a4182b12a353f4f1d830b94dbeb7e6e8aac6e6613ec1aa368ce00a6945cdb7686eb94b287b9fd4e
+)
+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
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ # dllexport support seem to be broken
+ OPTIONS -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS:BOOL=ON
+ -DCMAKE_DEBUG_POSTFIX=d
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# 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