Merge pull request #9635 from Neumann-A/improve_libwebp

[libwebp] Update to 1.1.0 and improve portfile
This commit is contained in:
Robert Schumacher 2020-02-05 17:52:51 -08:00 committed by GitHub
commit 0ba50612fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 242 additions and 290 deletions

View File

@ -1,5 +1,5 @@
Source: freeimage
Version: 3.18.0-8
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp[all] (!uwp), libraw, jxrlib, openexr
Version: 3.18.0-9
Build-Depends: zlib, libpng, libjpeg-turbo, tiff, openjpeg, libwebp (!uwp), libraw, jxrlib, openexr
Homepage: https://sourceforge.net/projects/freeimage/
Description: Support library for graphics image formats

View File

@ -1,5 +1,5 @@
Source: libgd
Version: 2.2.5-3
Version: 2.2.5-4
Homepage: https://github.com/libgd/libgd
Description: Open source code library for the dynamic creation of images by programmers.
Default-Features: fontconfig, freetype, jpeg, png, tiff, webp

13
ports/libgd/intrin.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/src/gd_interpolation.c b/src/gd_interpolation.c
index b9a206551..f75469329 100644
--- a/src/gd_interpolation.c
+++ b/src/gd_interpolation.c
@@ -75,7 +75,7 @@ TODO:
#ifdef _MSC_VER
# pragma optimize("t", on)
-# include <emmintrin.h>
+# include <intrin.h>
#endif
static gdImagePtr gdImageScaleBilinear(gdImagePtr im,

View File

@ -9,6 +9,7 @@ vcpkg_from_github(
PATCHES
0001-fix-cmake.patch
no-write-source-dir.patch
intrin.patch
)
#delete CMake builtins modules

View File

@ -1,165 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 499ddce..895fda9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -159,6 +159,12 @@ add_definitions(-DHAVE_CONFIG_H)
if(MSVC)
# avoid security warnings for e.g., fopen() used in the examples.
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+ add_definitions(-DWEBP_HAVE_JUST_SDL_H)
+ if(BUILD_SHARED_LIBS)
+ add_definitions(-DWEBP_EXTERN=__declspec\(dllexport\))
+ else()
+ add_definitions(-DFREEGLUT_STATIC)
+ endif()
else()
add_definitions(-Wall)
endif()
@@ -342,19 +346,23 @@ if(WEBP_BUILD_ANIM_UTILS
"example_util_[^ ]*")
list(APPEND EXAMPLEUTIL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/examples/stopwatch.h)
add_library(exampleutil ${EXAMPLEUTIL_SRCS})
+ set_target_properties(exampleutil PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
target_include_directories(
exampleutil
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
+ target_link_libraries(exampleutil imageioutil)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEIOUTILS_SRCS"
"imageio_util_[^ ]*")
add_library(imageioutil ${IMAGEIOUTILS_SRCS})
+ set_target_properties(imageioutil PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
target_link_libraries(imageioutil webp)
# Image-decoding utility library.
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEDEC_SRCS"
"imagedec_[^ ]*")
add_library(imagedec ${IMAGEDEC_SRCS})
+ set_target_properties(imagedec PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
target_link_libraries(imagedec
imageioutil
webpdemux
@@ -365,7 +373,8 @@ if(WEBP_BUILD_ANIM_UTILS
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/imageio "IMAGEENC_SRCS"
"imageenc_[^ ]*")
add_library(imageenc ${IMAGEENC_SRCS})
- target_link_libraries(imageenc webp)
+ set_target_properties(imageenc PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+ target_link_libraries(imageenc imageioutil webp)
set_property(TARGET exampleutil
imageioutil
@@ -380,7 +389,7 @@ if(WEBP_BUILD_DWEBP)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "DWEBP_SRCS" "dwebp")
add_executable(dwebp ${DWEBP_SRCS})
target_link_libraries(dwebp exampleutil imagedec imageenc)
- target_include_directories(dwebp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(dwebp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
install(TARGETS dwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
@@ -389,13 +398,14 @@ if(WEBP_BUILD_CWEBP)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/examples "CWEBP_SRCS" "cwebp")
add_executable(cwebp ${CWEBP_SRCS})
target_link_libraries(cwebp exampleutil imagedec webp)
- target_include_directories(cwebp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(cwebp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "")
add_library(libwebpmux ${WEBP_MUX_SRCS})
+ set_target_properties(libwebpmux PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
target_link_libraries(libwebpmux webp)
target_include_directories(libwebpmux
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
@@ -411,7 +421,7 @@ if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
"${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux.h;\
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h;\
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h;")
- set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME webpmux)
+ #set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME webpmux)
list(APPEND INSTALLED_LIBRARIES libwebpmux)
configure_pkg_config("src/mux/libwebpmux.pc")
endif()
@@ -428,7 +438,7 @@ if(WEBP_BUILD_GIF2WEBP)
webp
libwebpmux
${WEBP_DEP_GIF_LIBRARIES})
- target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(gif2webp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
install(TARGETS gif2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
@@ -444,7 +454,7 @@ if(WEBP_BUILD_IMG2WEBP)
imageioutil
webp
libwebpmux)
- target_include_directories(img2webp PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(img2webp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
install(TARGETS img2webp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
@@ -464,6 +474,7 @@ if(WEBP_BUILD_VWEBP)
webpdemux)
target_include_directories(vwebp
PRIVATE GLUT::GLUT
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/src
${OPENGL_INCLUDE_DIR})
install(TARGETS vwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -483,7 +494,7 @@ if(WEBP_BUILD_WEBPINFO)
"webpinfo")
add_executable(webpinfo ${WEBPINFO_SRCS})
target_link_libraries(webpinfo exampleutil imageioutil)
- target_include_directories(webpinfo PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(webpinfo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
install(TARGETS webpinfo RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
@@ -493,7 +504,7 @@ if(WEBP_BUILD_WEBPMUX)
"webpmux")
add_executable(webpmux ${WEBPMUX_SRCS})
target_link_libraries(webpmux exampleutil imageioutil libwebpmux webp)
- target_include_directories(webpmux PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(webpmux PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
install(TARGETS webpmux RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
@@ -540,7 +551,7 @@ if(WEBP_BUILD_WEBP_JS)
# JavaScript version
add_executable(webp_js ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
target_link_libraries(webp_js webpdecoder SDL)
- target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set(WEBP_HAVE_SDL 1)
set_target_properties(
webp_js
@@ -553,7 +564,7 @@ if(WEBP_BUILD_WEBP_JS)
# WASM version
add_executable(webp_wasm ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
target_link_libraries(webp_wasm webpdecoder SDL)
- target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
set_target_properties(
webp_wasm
PROPERTIES LINK_FLAGS "-s WASM=1 -s 'BINARYEN_METHOD=\"native-wasm\"' \
@@ -579,7 +590,7 @@ if(WEBP_BUILD_ANIM_UTILS)
libwebpmux
webpdemux
${WEBP_DEP_GIF_LIBRARIES})
- target_include_directories(anim_diff PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(anim_diff PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
# anim_dump
include_directories(${WEBP_DEP_IMG_INCLUDE_DIRS} ${WEBP_DEP_GIF_INCLUDE_DIRS})
@@ -595,7 +606,7 @@ if(WEBP_BUILD_ANIM_UTILS)
libwebpmux
webpdemux
${WEBP_DEP_GIF_LIBRARIES})
- target_include_directories(anim_dump PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/src)
+ target_include_directories(anim_dump PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR}/src)
endif()
# Install the different headers and libraries.

View File

@ -0,0 +1,46 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9503daacb..2fb9ef137 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -167,6 +167,9 @@ add_definitions(-DHAVE_CONFIG_H)
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)" "-DWEBP_DLL")
+ endif()
else()
add_definitions(-Wall)
endif()
@@ -420,9 +423,9 @@ if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
"${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux.h;\
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/mux_types.h;\
${CMAKE_CURRENT_SOURCE_DIR}/src/webp/types.h;")
- set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME webpmux)
+ set_target_properties(libwebpmux PROPERTIES OUTPUT_NAME $<$<PLATFORM_ID:Windows>:lib>webpmux)
list(APPEND INSTALLED_LIBRARIES libwebpmux)
configure_pkg_config("src/mux/libwebpmux.pc")
endif()
if(WEBP_BUILD_GIF2WEBP)
@@ -524,7 +528,11 @@ if(WEBP_BUILD_EXTRAS)
# webp_quality
add_executable(webp_quality ${WEBP_QUALITY_SRCS} ${WEBP_EXTRAS_SRCS})
target_link_libraries(webp_quality exampleutil imagedec)
+ if(BUILD_SHARED_LIBS)
+ target_link_libraries(webp_quality webpdspdecode)
+ endif()
target_include_directories(webp_quality
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR})
@@ -573,7 +573,7 @@ if(WEBP_BUILD_WEBP_JS)
"-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \
-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
set_target_properties(webp_js PROPERTIES OUTPUT_NAME webp)
- target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
+ target_compile_definitions(webp_js PUBLIC EMSCRIPTEN WEBP_HAVE_SDL WEBP_HAVE_JUST_SDL_H)
# WASM version
add_executable(webp_wasm ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)

View File

@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f6c8eca2..00366ae53 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -405,7 +405,7 @@ if(WEBP_BUILD_CWEBP)
install(TARGETS cwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
-if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP)
+if(WEBP_BUILD_GIF2WEBP OR WEBP_BUILD_IMG2WEBP OR TRUE)
parse_makefile_am(${CMAKE_CURRENT_SOURCE_DIR}/src/mux "WEBP_MUX_SRCS" "")
add_library(libwebpmux ${WEBP_MUX_SRCS})
target_link_libraries(libwebpmux webp)

View File

@ -1,13 +0,0 @@
diff --git a/examples/gifdec.c b/examples/gifdec.c
index 4219352..ab0592a 100644
--- a/examples/gifdec.c
+++ b/examples/gifdec.c
@@ -310,7 +310,7 @@ void GIFDisplayError(const GifFileType* const gif, int gif_error) {
#else
(void)gif;
fprintf(stderr, "GIFLib Error %d: ", gif_error);
- PrintGifError();
+ //PrintGifError();
fprintf(stderr, "\n");
#endif
}

View File

@ -3,7 +3,7 @@ index a98540c..a3697cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -479,6 +479,10 @@ if(WEBP_BUILD_VWEBP)
${CMAKE_CURRENT_SOURCE_DIR}/src
PRIVATE ${GLUT_INCLUDE_DIR}
${CMAKE_CURRENT_BINARY_DIR}/src
${OPENGL_INCLUDE_DIR})
+ if(UNIX AND NOT(ANDROID OR BLACKBERRY OR APPLE))

View File

@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7585fac..83edb3a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -540,7 +540,7 @@ if(WEBP_BUILD_EXTRAS)
find_package(SDL)
if(SDL_FOUND)
add_executable(vwebp_sdl ${VWEBP_SDL_SRCS})
- target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp)
+ target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp dxguid winmm)
target_include_directories(vwebp_sdl
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src

View File

@ -2,15 +2,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt
index 83edb3a..f634094 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -540,7 +540,10 @@ if(WEBP_BUILD_EXTRAS)
@@ -540,7 +540,11 @@ if(WEBP_BUILD_EXTRAS)
find_package(SDL)
if(SDL_FOUND)
add_executable(vwebp_sdl ${VWEBP_SDL_SRCS})
- target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp dxguid winmm)
- target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp)
+ target_link_libraries(vwebp_sdl ${SDL_LIBRARY} imageioutil webp)
+ if (MSVC)
+ target_link_libraries(vwebp_sdl dxguid winmm)
+ endif()
+ target_compile_definitions(vwebp_sdl PRIVATE WEBP_HAVE_JUST_SDL_H)
target_include_directories(vwebp_sdl
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src

View File

@ -0,0 +1,36 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b0d2fa55..efd10887b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -563,10 +563,11 @@ if(WEBP_BUILD_EXTRAS)
endif()
if(WEBP_BUILD_WEBP_JS)
+ find_package(SDL REQUIRED)
# JavaScript version
add_executable(webp_js ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
- target_link_libraries(webp_js webpdecoder SDL)
- target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(webp_js webpdecoder ${SDL_LIBRARY})
+ target_include_directories(webp_js PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR})
set(WEBP_HAVE_SDL 1)
set_target_properties(
webp_js
@@ -578,14 +579,14 @@ if(WEBP_BUILD_WEBP_JS)
# WASM version
add_executable(webp_wasm ${CMAKE_CURRENT_SOURCE_DIR}/extras/webp_to_sdl.c)
- target_link_libraries(webp_wasm webpdecoder SDL)
- target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(webp_wasm webpdecoder ${SDL_LIBRARY})
+ target_include_directories(webp_wasm PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${SDL_INCLUDE_DIR})
set_target_properties(
webp_wasm
PROPERTIES LINK_FLAGS "-s WASM=1 \
-s EXPORTED_FUNCTIONS='[\"_WebpToSDL\"]' -s INVOKE_RUN=0 \
-s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]'")
- target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL)
+ target_compile_definitions(webp_wasm PUBLIC EMSCRIPTEN WEBP_HAVE_SDL WEBP_HAVE_JUST_SDL_H)
target_compile_definitions(webpdspdecode PUBLIC EMSCRIPTEN)
endif()

View File

@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index efd10887b..8b41cc1ba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -470,7 +470,7 @@ if(WEBP_BUILD_VWEBP)
target_link_libraries(vwebp
${OPENGL_LIBRARIES}
exampleutil
- ${GLUT_glut_LIBRARY}
+ GLUT::GLUT
imageioutil
webp
webpdemux)
@@ -481,6 +481,9 @@ if(WEBP_BUILD_VWEBP)
if(UNIX AND NOT(ANDROID OR BLACKBERRY OR APPLE))
find_package(X11 REQUIRED)
target_link_libraries(vwebp ${X11_LIBRARIES} ${X11_Xxf86vm_LIB})
+ if(X11_Xrandr_FOUND) # due to glut linking xrandr if found
+ target_link_libraries(vwebp ${X11_Xrandr_LIB})
+ endif()
endif()
install(TARGETS vwebp RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")

View File

@ -1,8 +1,58 @@
Source: libwebp
Version: 1.0.2-8
Version: 1.1.0
Homepage: https://github.com/webmproject/libwebp
Description: Lossy compression of digital photographic images.
Description: WebP codec: library to encode and decode images in WebP format
Default-Features: simd, nearlossless
Build-Depends: libwebp[unicode] (windows)
Feature: anim
Description: Build animation utilities.
Build-Depends: libwebp[mux, img2webp]
Feature: gif2webp
Description: Build the gif2webp conversion tool.
Build-Depends: giflib
Feature: img2webp
Description: Build the img2webp animation tool.
Build-Depends: libjpeg-turbo, libpng, tiff
Feature: vwebp
Description: Build the vwebp viewer tool.
Build-Depends: opengl, freeglut (!osx)
Feature: vwebp_sdl
Description: Build the vwebp viewer tool.
Build-Depends: libwebp[vwebp], sdl1 (windows)
Feature: info
Description: Build the webpinfo command line tool.
Feature: mux
Description: Build the webpmux command line tool.
Feature: extras
Description: Build extras.
Build-Depends: sdl1 (windows), libwebp[vwebp]
Feature: nearlossless
Description: Enable near-lossless encoding
Feature: unicode
Description: Build Unicode executables. (Adds definition UNICODE and _UNICODE)
Feature: simd
Description: Enable any SIMD optimization.
Feature: cwebp
Description: Build the cwebp command line tool.
Feature: dwebp
Description: Build the dwebp command line tool.
Feature: swap16bitcsp
Description: Enable byte swap for 16 bit colorspaces.
Feature: all
Description: enable all webp features
Build-Depends: giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows), opengl
Description: enable all features except for swap16bitcsp
Build-Depends: libwebp[anim, gif2webp, img2webp, info, mux, nearlossless, simd, cwebp, dwebp], libwebp[vwebp_sdl] (!osx), libwebp[extras] (!osx)

View File

@ -1,67 +1,53 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO webmproject/libwebp
REF v1.0.2
SHA512 27ca4e7c87d3114a5d3dba6801b5608207a9adc44d0fa62f7523d39be789d389d342d9db5e28c9301eff8fcb1471809c76680a68abd4ff97217b17dd13c4e22b
REF d7844e9762b61c9638c263657bd49e1690184832 # v1.1.0
SHA512 13692970e7dd909cd6aaa03c9a0c863243baac1885644794362dec0c0b0721d6807f281f746215bfd856c6e0cb742b01a731a33fe075a32ff24496e10c1a94b4
HEAD_REF master
PATCHES
0001-build-fixes.patch
0001-build.patch
0002-cmake-config-add-backwards-compatibility.patch
0003-remove-missing-symbol.patch
0003-always-mux.patch #always build libwebpmux
0004-add-missing-linked-library.patch
0005-fix-static-build.patch
0006-fix-dependecies-platform.patch
0007-fix-arm-build.patch
0008-sdl.patch
0009-glut.patch
)
set(WEBP_BUILD_ANIM_UTILS OFF)
set(WEBP_BUILD_GIF2WEBP OFF)
set(WEBP_BUILD_IMG2WEBP OFF)
set(WEBP_BUILD_VWEBP OFF)
set(WEBP_BUILD_WEBPINFO OFF)
set(WEBP_BUILD_WEBPMUX OFF)
set(WEBP_BUILD_EXTRAS OFF)
set(WEBP_NEAR_LOSSLESS OFF)
if("all" IN_LIST FEATURES)
set(WEBP_BUILD_ANIM_UTILS ON)
set(WEBP_NEAR_LOSSLESS ON)
set(WEBP_BUILD_GIF2WEBP ON)
set(WEBP_BUILD_IMG2WEBP ON)
set(WEBP_BUILD_VWEBP ON)
set(WEBP_BUILD_WEBPINFO ON)
set(WEBP_BUILD_WEBPMUX ON)
set(WEBP_BUILD_EXTRAS ON)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES # <- Keyword FEATURES is required because INVERTED_FEATURES are being used
anim WEBP_BUILD_ANIM_UTILS
gif2webp WEBP_BUILD_GIF2WEBP
img2webp WEBP_BUILD_IMG2WEBP
vwebp WEBP_BUILD_VWEBP
info WEBP_BUILD_WEBPINFO
mux WEBP_BUILD_WEBPMUX
extras WEBP_BUILD_EXTRAS
nearlossless WEBP_NEAR_LOSSLESS
simd WEBP_ENABLE_SIMD
cwebp WEBP_BUILD_CWEBP
dwebp WEBP_BUILD_DWEBP
swap16bitcsp WEBP_ENABLE_SWAP_16BIT_CSP
unicode WEBP_UNICODE
)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(VCPKG_TARGET_IS_LINUX)
message("WebP currently requires the following library from the system package manager:\n Xxf86vm\n\nThis can be installed on Ubuntu systems via apt-get install libxxf86vm-dev")
endif()
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(WEBP_BUILD_VWEBP OFF)
set(WEBP_BUILD_EXTRAS OFF)
message("Due to GLUT Framework problems with CMake, at the moment it's not possible to build VWebP on Mac. It has been disabled together with extras.")
if(VCPKG_TARGET_IS_OSX)
if("vwebp" IN_LIST FEATURES OR "extras" IN_LIST FEATURES)
message(FATAL_ERROR "Due to GLUT Framework problems with CMake, at the moment it's not possible to build VWebP or extras on Mac!")
endif()
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DWEBP_ENABLE_SIMD:BOOL=ON
-DWEBP_BUILD_ANIM_UTILS:BOOL=${WEBP_BUILD_ANIM_UTILS}
-DWEBP_BUILD_CWEBP:BOOL=OFF
-DWEBP_BUILD_DWEBP:BOOL=OFF
-DWEBP_BUILD_GIF2WEBP:BOOL=${WEBP_BUILD_GIF2WEBP}
-DWEBP_BUILD_IMG2WEBP:BOOL=${WEBP_BUILD_IMG2WEBP}
-DWEBP_BUILD_VWEBP:BOOL=${WEBP_BUILD_VWEBP}
-DWEBP_BUILD_WEBPINFO:BOOL=${WEBP_BUILD_WEBPINFO}
-DWEBP_BUILD_WEBPMUX:BOOL=${WEBP_BUILD_WEBPMUX}
-DWEBP_BUILD_EXTRAS:BOOL=${WEBP_BUILD_EXTRAS}
-DWEBP_BUILD_WEBP_JS:BOOL=OFF
-DWEBP_NEAR_LOSSLESS:BOOL=${WEBP_NEAR_LOSSLESS}
-DWEBP_ENABLE_SWAP_16BIT_CSP:BOOL=OFF
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=d
)
@ -71,59 +57,32 @@ vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/WebP/cmake)
vcpkg_fixup_cmake_targets(CONFIG_PATH share/WebP/cmake TARGET_PATH share/WebP) # find_package is called with WebP not libwebp
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/WebP)
file(GLOB CMAKE_FILES ${CURRENT_PACKAGES_DIR}/share/${PORT}/*)
file(COPY ${CMAKE_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/share/webp/)
#somehow the native CMAKE_EXECUTABLE_SUFFIX does not work, so here we emulate it
if(CMAKE_HOST_WIN32)
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
endif()
if("all" IN_LIST FEATURES)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/get_disto${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/gif2webp${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/img2webp${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vwebp${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/vwebp_sdl${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webpinfo${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webpmux${EXECUTABLE_SUFFIX})
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/webp_quality${EXECUTABLE_SUFFIX})
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/libwebp/)
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/get_disto${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/get_disto${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/get_disto${EXECUTABLE_SUFFIX})
set(BIN_NAMES get_disto gif2webp img2webp vwebp vwebp_sdl webpinfo webpmux webp_quality cwebp dwebp)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/webp/")
foreach(tool ${BIN_NAMES})
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/gif2webp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/gif2webp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/gif2webp${EXECUTABLE_SUFFIX})
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}" "${CURRENT_PACKAGES_DIR}/tools/webp/${tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/img2webp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/img2webp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/img2webp${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/vwebp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vwebp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/vwebp${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/vwebp_sdl${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/vwebp_sdl${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/vwebp_sdl${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/webpinfo${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webpinfo${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/webpinfo${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/webpmux${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webpmux${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/webpmux${EXECUTABLE_SUFFIX})
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/webp_quality${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/webp_quality${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/webp_quality${EXECUTABLE_SUFFIX})
endif()
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/libwebp)
endforeach()
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/webp")
#No tools
file(GLOB_RECURSE RESULT "${CURRENT_PACKAGES_DIR}/tools/")
list(LENGTH RESULT RES_LEN)
if(RES_LEN EQUAL 0)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libwebp RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/libwebp" RENAME copyright)

View File

@ -680,6 +680,7 @@ lcm:x64-linux=fail
lcm:x64-osx=fail
leptonica:x64-uwp=fail
leptonica:arm-uwp=fail
leptonica:arm64-windows=fail
leveldb:arm-uwp=fail
leveldb:x64-uwp=fail
libaiff:x64-linux=fail