[libpng] Update to 1.6.44, add feature tools (#42058)

Co-authored-by: Kai Pastor <dg0yt@darc.de>
This commit is contained in:
Osyotr 2024-11-14 14:10:41 +03:00 committed by GitHub
parent 91302cec22
commit a469702fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 65 additions and 29 deletions

View File

@ -1,17 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index eaba327..dbd31d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1126,6 +1126,12 @@ if(NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL)
install(EXPORT libpng
DESTINATION ${CMAKE_INSTALL_LIBDIR}/libpng
FILE libpng${PNGLIB_ABI_VERSION}.cmake)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libpng-config.cmake" "
+ include(CMakeFindDependencyMacro)
+ find_dependency(ZLIB)
+ include(\"\${CMAKE_CURRENT_LIST_DIR}/libpng${PNGLIB_ABI_VERSION}.cmake\")
+ ")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libpng-config.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/libpng")
endif()
# TODO: Create MSVC import lib for MinGW-compiled shared lib.

View File

@ -5,7 +5,7 @@ index 3857b82..4c68989 100644
@@ -221,8 +221,8 @@ endif()
# Set definitions and sources for MIPS.
if(TARGET_ARCH MATCHES "^(mipsel|mips64el)")
if(PNG_TARGET_ARCHITECTURE MATCHES "^(mipsel|mips64el)")
- set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
- set(PNG_MIPS_MSA "on"
+ set(PNG_MIPS_MSA_POSSIBLE_VALUES on off check)

View File

@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3857b82..4c68989 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -963,9 +963,9 @@
FILES ${PNGSUITE_PNGS})
endif()
-if(PNG_SHARED AND PNG_TOOLS)
+if(PNG_TOOLS)
add_executable(pngfix ${pngfix_sources})
- target_link_libraries(pngfix PRIVATE png_shared)
+ target_link_libraries(pngfix PRIVATE $<TARGET_NAME_IF_EXISTS:png_shared> $<TARGET_NAME_IF_EXISTS:png_static>) # in vcpkg there's only one
set(PNG_BIN_TARGETS pngfix)
add_executable(png-fix-itxt ${png_fix_itxt_sources})

View File

@ -0,0 +1,12 @@
file(READ "${CMAKE_CURRENT_LIST_DIR}/usage" usage)
message(WARNING "find_package(libpng) is deprecated.\n${usage}")
include(CMakeFindDependencyMacro)
find_dependency(PNG CONFIG)
if(NOT TARGET png_shared)
add_library(png_shared ALIAS PNG::PNG)
endif()
if(NOT TARGET png_static)
add_library(png_static ALIAS PNG::PNG)
endif()

View File

@ -12,7 +12,7 @@ if ("apng" IN_LIST FEATURES)
vcpkg_download_distfile(LIBPNG_APNG_PATCH_ARCHIVE
URLS "https://downloads.sourceforge.net/project/libpng-apng/libpng16/${VERSION}/${LIBPNG_APNG_PATCH_NAME}.gz"
FILENAME "${LIBPNG_APNG_PATCH_NAME}.gz"
SHA512 a724f7de486920cb119818f7172fb589bc2c3c1cc1f81bb5c4da0609ab108ef9ef7406cf689a20bc4e8da69647847f550ed497b3fa99a10539e9a0abf492c053
SHA512 ea89018a02ed171b82af9644ec2ff658c8a288e99b5470c7a3fd142c6fa95bbe19cd34c4fae654bc8783b41c3eb3b2d15b486bda3b0307ec3090e99f34465e20
)
set(LIBPNG_APNG_PATCH_PATH "${CURRENT_BUILDTREES_DIR}/src/${LIBPNG_APNG_PATCH_NAME}")
if (NOT EXISTS "${LIBPNG_APNG_PATCH_PATH}")
@ -30,20 +30,28 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO glennrp/libpng
REF v${VERSION}
SHA512 3bb2a7b73113be42b09c2116e6c6f5a7ddb4e2ab06e0b13e10b7314acdccc4bb624ff602e16140c0484f6cde80efa190296226be3da195c6926819f07c723c12
SHA512 c023bc7dcf3d0ea045a63204f2266b2c53b601b99d7c5f5a7b547bc9a48b205a277f699eefa47f136483f495175b226527097cd447d6b0fbceb029eb43638f63
HEAD_REF master
PATCHES
"${LIBPNG_APNG_PATCH_PATH}"
cmake.patch
fix-export-targets.patch
libm.patch
pkgconfig.patch
fix-msa-support-for-mips.patch
fix-tools-static.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PNG_SHARED)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PNG_STATIC)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools PNG_TOOLS
INVERTED_FEATURES
tools SKIP_INSTALL_PROGRAMS
)
vcpkg_list(SET LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION)
if(VCPKG_TARGET_IS_IOS)
vcpkg_list(APPEND LIBPNG_HARDWARE_OPTIMIZATIONS_OPTION "-DPNG_HARDWARE_OPTIMIZATIONS=OFF")
@ -77,18 +85,22 @@ vcpkg_cmake_configure(
-DPNG_SHARED=${PNG_SHARED}
-DPNG_FRAMEWORK=OFF
-DPNG_TESTS=OFF
-DSKIP_INSTALL_PROGRAMS=ON
-DSKIP_INSTALL_EXECUTABLES=ON
-DSKIP_INSTALL_FILES=OFF
${FEATURE_OPTIONS}
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
MAYBE_UNUSED_VARIABLES
PNG_ARM_NEON
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME png CONFIG_PATH lib/cmake/PNG)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/libpng)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/png")
# unofficial legacy usage
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/libpng-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_fixup_pkgconfig()
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(NOT VCPKG_BUILD_TYPE)
@ -103,6 +115,11 @@ endif()
file(INSTALL "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libpng16.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig" RENAME "libpng.pc")
vcpkg_copy_pdbs()
if(PNG_TOOLS)
vcpkg_copy_tools(TOOL_NAMES "pngfix" "png-fix-itxt" AUTO_CLEAN)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

View File

@ -1,4 +1,4 @@
The package libpng is compatible with built-in CMake targets:
libpng provides CMake targets:
find_package(PNG REQUIRED)
target_link_libraries(main PRIVATE PNG::PNG)
find_package(PNG REQUIRED)
target_link_libraries(main PRIVATE PNG::PNG)

View File

@ -1,7 +1,6 @@
{
"name": "libpng",
"version": "1.6.43",
"port-version": 3,
"version": "1.6.44",
"description": "libpng is a library implementing an interface for reading and writing PNG (Portable Network Graphics) format files",
"homepage": "https://github.com/glennrp/libpng",
"license": "libpng-2.0",
@ -24,6 +23,10 @@
"features": {
"apng": {
"description": "This is backward compatible with the regular libpng, both in library usage and format"
},
"tools": {
"description": "Build the libpng tools",
"supports": "!android & !ios"
}
}
}

View File

@ -4969,8 +4969,8 @@
"port-version": 1
},
"libpng": {
"baseline": "1.6.43",
"port-version": 3
"baseline": "1.6.44",
"port-version": 0
},
"libpopt": {
"baseline": "1.16",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bda480fe3c3cef1113fe8bfdecda127a5b3b2a77",
"version": "1.6.44",
"port-version": 0
},
{
"git-tree": "9c7fd06f1cdd1dfc08b35ca9d6b0ba470cdd2470",
"version": "1.6.43",