[lodepng,lodepng-c, libjxl] Update, merge lodepng-c into lodepng (#21846)

* Modernize lodepng portfile

* Update to 8c6a9e30

* Install LICENSE as copyright

* Don't install examples

* Remove unused parameter

* Merge lodepng-c into lodepng

* Add usage

* Omit lodepng-util: not official API

* Update versions

* [gdal] Don't use lz4: not a dependency

* [libjxl] Fix link flags

* Revise install cleanup, handle .dylib

* Add extra flags for uwp

* Workaround uwp toolchain quirks

* More dependency control, jxl_extras for tools only

* Pass the version to the build

* Update versions

* Skip CI for libjxl:arm-uwp

* Install usage file

* Update versions

* Use version-date for lodepng, mark lodepng-c as deprecated, and update version database.

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Kai Pastor 2021-12-07 06:51:01 +01:00 коммит произвёл GitHub
Родитель b1d364ed98
Коммит df8276a218
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
20 изменённых файлов: 186 добавлений и 123 удалений

Просмотреть файл

@ -277,6 +277,7 @@ else()
--with-libdeflate=no
--with-libgrass=no
--with-libkml=no
--with-lz4=no
--with-mdb=no
--with-mrsid=no
--with-mrsid_lidar=no

Просмотреть файл

@ -1,7 +1,7 @@
{
"name": "gdal",
"version-semver": "3.4.0",
"port-version": 2,
"port-version": 3,
"description": "The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data",
"homepage": "https://gdal.org",
"supports": "!(arm & windows)",

Просмотреть файл

@ -0,0 +1,14 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index a366e51..257f87d 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -132,7 +132,9 @@ endif() #!MSVC
include(jxl.cmake)
# Other libraries outside the core jxl library.
+if(JPEGXL_ENABLE_TOOLS)
include(jxl_extras.cmake)
+endif()
include(jxl_threads.cmake)
# Install all the library headers from the source and the generated ones. There

Просмотреть файл

@ -1,11 +1,13 @@
diff --git a/lib/jxl.cmake b/lib/jxl.cmake
--- a/lib/jxl.cmake
+++ b/lib/jxl.cmake
@@ -3,6 +3,16 @@
@@ -3,6 +3,18 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+if(JPEGXL_ENABLE_TOOLS)
+find_package(lodepng CONFIG REQUIRED)
+endif()
+find_package(unofficial-brotli CONFIG REQUIRED)
+find_package(lcms2 CONFIG REQUIRED)
+
@ -46,7 +48,7 @@ diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
set_property(TARGET hwy PROPERTY INTERFACE_COMPILE_OPTIONS ${HWY_CFLAGS_OTHER})
else()
target_include_directories(hwy INTERFACE ${HWY_INCLUDE_DIRS})
@@ -114,82 +112,10 @@ else()
@@ -114,82 +112,12 @@ else()
endif()
# lodepng
@ -57,7 +59,9 @@ diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt
-include(lodepng.cmake)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lodepng/LICENSE"
- ${PROJECT_BINARY_DIR}/LICENSE.lodepng COPYONLY)
+if(JPEGXL_ENABLE_TOOLS)
+find_package(lodepng CONFIG REQUIRED)
+endif()
# brotli
-if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/brotli/c/include/brotli/decode.h" OR

Просмотреть файл

@ -0,0 +1,15 @@
diff --git a/lib/jxl.cmake b/lib/jxl.cmake
index 63539cc..2e1d617 100644
--- a/lib/jxl.cmake
+++ b/lib/jxl.cmake
@@ -551,8 +551,10 @@ foreach(target IN ITEMS jxl jxl_dec)
# This hides the default visibility symbols from static libraries bundled into
# the shared library. In particular this prevents exposing symbols from hwy
# and skcms in the shared library.
+ if(NOT APPLE AND NOT MSVC)
set_property(TARGET ${target} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,--exclude-libs=ALL")
+ endif()
endforeach()
# Only install libjxl shared library. The libjxl_dec is not installed since it

Просмотреть файл

@ -1,22 +1,54 @@
set(JPEGXL_VERSION 0.6.1)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libjxl/libjxl
REF v0.6.1
REF "v${JPEGXL_VERSION}"
SHA512 302935d722160b0b288ac63301f9e95caf82eccf6ad76c4f4da6316a0314ee3562115932b1ceacb0d02708de0a07788992d3478cae73af0b90193f5769f9fb52
HEAD_REF main
PATCHES
fix-install-directories.patch
fix-dependencies.patch
fix-link-flags.patch
disable-jxl_extras.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools JPEGXL_ENABLE_TOOLS
INVERTED_FEATURES
tools CMAKE_DISABLE_FIND_PACKAGE_GIF
tools CMAKE_DISABLE_FIND_PACKAGE_JPEG
tools CMAKE_DISABLE_FIND_PACKAGE_PNG
tools CMAKE_DISABLE_FIND_PACKAGE_ZLIB
)
if(VCPKG_TARGET_IS_UWP)
string(APPEND VCPKG_C_FLAGS " -D_CRT_SECURE_NO_WARNINGS /wd4146")
string(APPEND VCPKG_CXX_FLAGS " -D_CRT_SECURE_NO_WARNINGS /wd4146")
# Temporary workaround for #9390
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
list(APPEND FEATURE_OPTIONS -DCMAKE_SYSTEM_PROCESSOR=x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
list(APPEND FEATURE_OPTIONS -DCMAKE_SYSTEM_PROCESSOR=AMD64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
list(APPEND FEATURE_OPTIONS -DCMAKE_SYSTEM_PROCESSOR=ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
list(APPEND FEATURE_OPTIONS -DCMAKE_SYSTEM_PROCESSOR=ARM64)
else()
message(FATAL_ERROR "Unsupported uwp VCPKG_TARGET_ARCHITECTURE \"${VCPKG_TARGET_ARCHITECTURE}\"")
endif()
# Workaround for vcpkg-cmake bug, proper fix in #21857
set(_TARGETTING_UWP 1)
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"-DJPEGXL_VERSION=${JPEGXL_VERSION}"
-DJPEGXL_FORCE_SYSTEM_HWY=ON
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON
${FEATURE_OPTIONS}
-DJPEGXL_ENABLE_FUZZERS=OFF
-DJPEGXL_ENABLE_MANPAGES=OFF
@ -27,9 +59,14 @@ vcpkg_cmake_configure(
-DJPEGXL_ENABLE_OPENEXR=OFF
-DJPEGXL_ENABLE_PLUGINS=OFF
-DJPEGXL_ENABLE_SKCMS=OFF
-DJPEGXL_FORCE_SYSTEM_HWY=ON
-DJPEGXL_FORCE_SYSTEM_BROTLI=ON
-DJPEGXL_ENABLE_TCMALLOC=OFF
-DBUILD_TESTING=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=1
MAYBE_UNUSED_VARIABLES
CMAKE_DISABLE_FIND_PACKAGE_GIF
CMAKE_DISABLE_FIND_PACKAGE_JPEG
CMAKE_DISABLE_FIND_PACKAGE_PNG
CMAKE_DISABLE_FIND_PACKAGE_ZLIB
)
vcpkg_cmake_install()
@ -47,32 +84,34 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
"${CURRENT_PACKAGES_DIR}/bin"
"${CURRENT_PACKAGES_DIR}/debug/bin"
)
file(REMOVE
set(FILES_TO_REMOVE
"${CURRENT_PACKAGES_DIR}/lib/jxl.lib"
"${CURRENT_PACKAGES_DIR}/lib/jxl_threads.lib"
"${CURRENT_PACKAGES_DIR}/debug/lib/jxl.lib"
"${CURRENT_PACKAGES_DIR}/debug/lib/jxl_threads.lib"
)
else()
file(GLOB FILES "${CURRENT_PACKAGES_DIR}/lib/*.so*")
file(REMOVE ${FILES})
file(GLOB FILES "${CURRENT_PACKAGES_DIR}/debug/lib/*.so*")
file(REMOVE ${FILES})
file(GLOB FILES_TO_REMOVE
"${CURRENT_PACKAGES_DIR}/lib/*.so*"
"${CURRENT_PACKAGES_DIR}/lib/*.dylib*"
"${CURRENT_PACKAGES_DIR}/debug/lib/*.so*"
"${CURRENT_PACKAGES_DIR}/debug/lib/*.dylib*"
)
endif()
else()
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB FILES "${CURRENT_PACKAGES_DIR}/lib/*-static.lib")
file(REMOVE ${FILES})
file(GLOB FILES "${CURRENT_PACKAGES_DIR}/debug/lib/*-static.lib")
file(REMOVE ${FILES})
file(GLOB FILES_TO_REMOVE
"${CURRENT_PACKAGES_DIR}/lib/*-static.lib"
"${CURRENT_PACKAGES_DIR}/debug/lib/*-static.lib"
)
else()
file(GLOB FILES "${CURRENT_PACKAGES_DIR}/lib/*.a")
file(REMOVE ${FILES})
file(GLOB FILES "${CURRENT_PACKAGES_DIR}/debug/lib/*.a")
file(REMOVE ${FILES})
file(GLOB FILES_TO_REMOVE
"${CURRENT_PACKAGES_DIR}/lib/*.a"
"${CURRENT_PACKAGES_DIR}/debug/lib/*.a"
)
endif()
endif()
file(REMOVE ${FILES_TO_REMOVE})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

Просмотреть файл

@ -1,6 +1,7 @@
{
"name": "libjxl",
"version-semver": "0.6.1",
"port-version": 1,
"description": "JPEG XL image format reference implementation",
"homepage": "https://github.com/libjxl/libjxl",
"license": "BSD-3-Clause",
@ -8,7 +9,6 @@
"brotli",
"highway",
"lcms",
"lodepng",
{
"name": "vcpkg-cmake",
"host": true
@ -16,7 +16,14 @@
],
"features": {
"tools": {
"description": "Build user tools: cjxl and djxl"
"description": "Build user tools: cjxl and djxl",
"dependencies": [
"giflib",
"libjpeg-turbo",
"libpng",
"lodepng",
"zlib"
]
}
}
}

Просмотреть файл

@ -1,23 +0,0 @@
cmake_minimum_required(VERSION 3.8.0)
project(lodepng-c C)
configure_file(${CMAKE_CURRENT_LIST_DIR}/lodepng.cpp ${CMAKE_CURRENT_LIST_DIR}/lodepng.c COPYONLY)
add_library(lodepng-c lodepng.c)
target_include_directories(lodepng-c PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
file(WRITE "${CMAKE_BINARY_DIR}/lodepng-c-config.cmake" "include(\"\${CMAKE_CURRENT_LIST_DIR}/lodepng-c-targets.cmake\")")
install(FILES "${CMAKE_BINARY_DIR}/lodepng-c-config.cmake" DESTINATION "share/lodepng-c/")
install(TARGETS lodepng-c EXPORT lodepng-c-targets)
install(EXPORT lodepng-c-targets DESTINATION share/lodepng-c/)
if(NOT DDISABLE_INSTALL_EXAMPLES)
install(DIRECTORY examples DESTINATION share/lodepng-c/)
endif()
if(NOT DISABLE_INSTALL_HEADERS)
install(FILES lodepng.h DESTINATION include)
endif()

Просмотреть файл

@ -1,33 +1 @@
if (EXISTS ${CURRENT_INSTALLED_DIR}/share/lodepng/copyright)
message(FATAL_ERROR "${PORT} conflict with lodepng, please remove lodepng before install ${PORT}.")
endif()
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lvandeve/lodepng
REF e34ac04553e51a6982ae234d98ce6b76dd57a6a1
SHA512 ab79fb2c6403e5d7bdf0b94a3f93f6513889eda8e6b74fb2b569fbc6f95fb79474654818cb0e71eff88214ca7c42ebd7c95f734a2faa77259fe06bfddcb6967a
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
-DDDISABLE_INSTALL_EXAMPLES=ON
)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
# Moves all .cmake files from /debug/share/lodepng/ to /share/lodepng/
vcpkg_fixup_cmake_targets()
file(INSTALL "${SOURCE_PATH}/lodepng.h" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

Просмотреть файл

@ -1,7 +1,8 @@
{
"name": "lodepng-c",
"version-date": "2021-03-01",
"port-version": 1,
"description": "PNG encoder and decoder in C",
"homepage": "https://github.com/lvandeve/lodepng"
"version-string": "deprecated",
"description": "Legacy port. Use port lodepng instead.",
"dependencies": [
"lodepng"
]
}

Просмотреть файл

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8.0)
project(lodepng)
add_library(lodepng lodepng.cpp lodepng_util.cpp)
add_library(lodepng lodepng.cpp)
target_include_directories(lodepng PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
@ -13,10 +13,18 @@ install(TARGETS lodepng EXPORT lodepng-targets)
install(EXPORT lodepng-targets DESTINATION share/lodepng/)
if(NOT DDISABLE_INSTALL_EXAMPLES)
install(DIRECTORY examples DESTINATION share/lodepng/)
endif()
add_library(lodepng-c lodepng.c)
target_include_directories(lodepng-c PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
file(WRITE "${CMAKE_BINARY_DIR}/lodepng-c-config.cmake" "include(\"\${CMAKE_CURRENT_LIST_DIR}/lodepng-c-targets.cmake\")")
install(FILES "${CMAKE_BINARY_DIR}/lodepng-c-config.cmake" DESTINATION "share/lodepng-c/")
install(TARGETS lodepng-c EXPORT lodepng-c-targets)
install(EXPORT lodepng-c-targets DESTINATION share/lodepng-c/)
if(NOT DISABLE_INSTALL_HEADERS)
install(FILES lodepng.h lodepng_util.h DESTINATION include)
install(FILES lodepng.h DESTINATION include)
endif()

Просмотреть файл

@ -5,28 +5,27 @@ endif()
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO lvandeve/lodepng
REF e34ac04553e51a6982ae234d98ce6b76dd57a6a1
SHA512 ab79fb2c6403e5d7bdf0b94a3f93f6513889eda8e6b74fb2b569fbc6f95fb79474654818cb0e71eff88214ca7c42ebd7c95f734a2faa77259fe06bfddcb6967a
HEAD_REF master
OUT_SOURCE_PATH SOURCE_PATH
REPO lvandeve/lodepng
REF 8c6a9e30576f07bf470ad6f09458a2dcd7a6a84a
SHA512 2e0abc063be45dc04a070656260e9a2b9fa1172433cdd7d4988f0afc11751ad28aa802350598ef0e2b27c2c011fd9d9f7ab7f267b0bfcdf28f9f708b888c4411
HEAD_REF master
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
configure_file("${SOURCE_PATH}/lodepng.cpp" "${SOURCE_PATH}/lodepng.c" COPYONLY)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DDISABLE_INSTALL_HEADERS=ON
-DDISABLE_INSTALL_TOOLS=ON
-DDDISABLE_INSTALL_EXAMPLES=ON
-DDISABLE_INSTALL_HEADERS=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
# Moves all .cmake files from /debug/share/lodepng/ to /share/lodepng/
vcpkg_fixup_cmake_targets()
vcpkg_cmake_config_fixup()
vcpkg_cmake_config_fixup(PACKAGE_NAME lodepng-c)
file(INSTALL ${SOURCE_PATH}/lodepng.h DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

9
ports/lodepng/usage Normal file
Просмотреть файл

@ -0,0 +1,9 @@
The package lodepng provides CMake targets:
# C API
find_package(lodepng-c CONFIG REQUIRED)
target_link_libraries(main PRIVATE lodepng-c)
# C++ API
find_package(lodepng CONFIG REQUIRED)
target_link_libraries(main PRIVATE lodepng)

Просмотреть файл

@ -1,7 +1,16 @@
{
"name": "lodepng",
"version-string": "2020-03-15",
"port-version": 1,
"version-date": "2021-12-04",
"description": "PNG encoder and decoder in C++",
"homepage": "https://github.com/lvandeve/lodepng"
"homepage": "https://github.com/lvandeve/lodepng",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

Просмотреть файл

@ -587,6 +587,8 @@ libigl:arm64-windows=fail
libigl:arm-uwp=fail
libigl:x64-uwp=fail
libirecovery:x64-windows-static-md=fail
# 120 min build time for libjxl arm-uwp-rel, reason unknown
libjxl:arm-uwp=skip
liblas:arm64-windows=fail
liblemon:arm-uwp=fail
liblemon:x64-uwp=fail
@ -769,16 +771,6 @@ llvm:arm-uwp=fail
llvm:x64-uwp=fail
lmdb:arm-uwp=fail
lmdb:x64-uwp=fail
# Conflict with loadpng-c
lodepng:arm64-windows = skip
lodepng:arm-uwp = skip
lodepng:x64-linux = skip
lodepng:x64-osx = skip
lodepng:x64-uwp = skip
lodepng:x64-windows = skip
lodepng:x64-windows-static = skip
lodepng:x64-windows-static-md=skip
lodepng:x86-windows = skip
log4cplus:arm-uwp=fail
log4cplus:x64-uwp=fail
log4cxx:arm-uwp=fail

Просмотреть файл

@ -2366,7 +2366,7 @@
},
"gdal": {
"baseline": "3.4.0",
"port-version": 2
"port-version": 3
},
"gdcm": {
"baseline": "3.0.7",
@ -3590,7 +3590,7 @@
},
"libjxl": {
"baseline": "0.6.1",
"port-version": 0
"port-version": 1
},
"libkeyfinder": {
"baseline": "2.2.5",
@ -4149,12 +4149,12 @@
"port-version": 1
},
"lodepng": {
"baseline": "2020-03-15",
"port-version": 1
"baseline": "2021-12-04",
"port-version": 0
},
"lodepng-c": {
"baseline": "2021-03-01",
"port-version": 1
"baseline": "deprecated",
"port-version": 0
},
"log4cplus": {
"baseline": "2.0.7",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "164700a47428c2ded10ee9dc8e28fb189fca0f94",
"version-semver": "3.4.0",
"port-version": 3
},
{
"git-tree": "f0f7e3cd7a86246d31f892678b2e06d01c455c5b",
"version-semver": "3.4.0",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ebfc043511f10c6dbe25a298b403b56ef9a57f87",
"version-semver": "0.6.1",
"port-version": 1
},
{
"git-tree": "4b89e4e9a92111a9733660afcecdfd59a6ee8d49",
"version-semver": "0.6.1",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "c25297e81ddc744ed59e77f15209cfbd726bdcdb",
"version-string": "deprecated",
"port-version": 0
},
{
"git-tree": "df7ad4d806d2308089bd2131fec061ac36ab72f9",
"version-date": "2021-03-01",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "454b1276a4855fba7699cbb07ca783d32d1baf7c",
"version-date": "2021-12-04",
"port-version": 0
},
{
"git-tree": "c80237ed99bb9821134df9802930c54fd8c8ee90",
"version-string": "2020-03-15",