update libwebp and improve portfile

This commit is contained in:
Alexander Neumann 2020-01-12 00:28:39 +01:00
parent bc01338fe2
commit f6d328d857
3 changed files with 95 additions and 86 deletions

View File

@ -144,7 +144,7 @@ index 499ddce..895fda9 100644
+ 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\"' \
PROPERTIES LINK_FLAGS "-s WASM=1 \
@@ -579,7 +590,7 @@ if(WEBP_BUILD_ANIM_UTILS)
libwebpmux
webpdemux

View File

@ -1,8 +1,57 @@
Source: libwebp
Version: 1.0.2-8
Version: 1.0.3
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: all
Description: enable all webp features
Build-Depends: giflib, libjpeg-turbo, zlib, libpng, tiff, freeglut (!osx), sdl1 (windows), opengl
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.
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: webp_js
Description: Emscripten only build of webp.js. Deactivates all other options.
Build-Depends: sdl1 (windows)
Feature: swap16bitcsp
Description: Enable byte swap for 16 bit colorspaces.

View File

@ -1,10 +1,8 @@
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO webmproject/libwebp
REF v1.0.2
SHA512 27ca4e7c87d3114a5d3dba6801b5608207a9adc44d0fa62f7523d39be789d389d342d9db5e28c9301eff8fcb1471809c76680a68abd4ff97217b17dd13c4e22b
REF 0fe1a89dbf1930fc2554dbe76adad5d962054ead # v1.0.3
SHA512 824844a247d3d0d89f1721b08304624b3d3ba0060e218f5c172ffd19d19b96a71d41055fdcda7e6f01a846a95c2519f52e0f39e9f49878e74ca9bb8a1df5fb13
HEAD_REF master
PATCHES
0001-build-fixes.patch
@ -16,24 +14,24 @@ vcpkg_from_github(
0007-fix-arm-build.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
webp_js WEBP_BUILD_WEBP_JS
swap16bitcsp WEBP_ENABLE_SWAP_16BIT_CSP
unicode WEBP_UNICODE
)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "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")
@ -49,19 +47,7 @@ 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,33 @@ 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 wit webp and 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()
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("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})
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/gif2webp${EXECUTABLE_SUFFIX}")
file(RENAME ${CURRENT_PACKAGES_DIR}/bin/gif2webp${EXECUTABLE_SUFFIX} ${CURRENT_PACKAGES_DIR}/tools/libwebp/gif2webp${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)