[leptonica] update to 1.84.1 (#35984)

<!-- If your PR fixes issues, please note that here by adding "Fixes
#NNNNNN." for each fixed issue on separate lines. -->
Fixes https://github.com/microsoft/vcpkg/issues/35941

The contents in the patch have been merged in upstream, so I remove
them.
No feature needs to be tested.
<!-- If you are still working on the PR, open it as a Draft:
https://github.blog/2019-02-14-introducing-draft-pull-requests/ -->

- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md)
- [x] SHA512s are updated for each updated download
- [ ] ~~The "supports" clause reflects platforms that may be fixed by
this new version~~
- [ ] ~~Any fixed [CI
baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt)
entries are removed from that file.~~
- [x] Any patches that are no longer applied are deleted from the port's
directory.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is added to each modified port's versions file.

<!-- If this PR adds a new port, please uncomment and fill out this
checklist:

- [ ] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md)
- [ ] The name of the port matches an existing name for this component
on https://repology.org/ if possible, and/or is strongly associated with
that component on search engines.
- [ ] Optional dependencies are resolved in exactly one way. For
example, if the component is built with CMake, all `find_package` calls
are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or
disabled with
[CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html)
- [ ] The versioning scheme in `vcpkg.json` matches what upstream says.
- [ ] The license declaration in `vcpkg.json` matches what upstream
says.
- [ ] The installed as the "copyright" file matches what upstream says.
- [ ] The source code of the component installed comes from an
authoritative source.
- [ ] The generated "usage text" is accurate. See
[adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md)
for context.
- [ ] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [ ] Only one version is in the new port's versions file.
- [ ] Only one version is added to each modified port's versions file.

END OF NEW PORT CHECKLIST (delete this line) -->
This commit is contained in:
Cheney Wang 2024-02-22 14:33:32 +08:00 committed by GitHub
parent a5ffeda89e
commit deb4361235
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 72 additions and 290 deletions

View File

@ -1,147 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e09f53..61ce7b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,19 +70,19 @@ if(NOT SW_BUILD)
endif()
find_package(JPEG)
if(JPEG_FOUND)
- set(libs_private "${libs_private} -ljpeg")
+ set(pkgs_private "${pkgs_private} libjpeg")
endif()
find_package(PNG)
if(PNG_FOUND)
- set(libs_private "${libs_private} -lpng")
+ set(pkgs_private "${pkgs_private} libpng")
endif()
find_package(TIFF)
if(TIFF_FOUND)
- set(libs_private "${libs_private} -ltiff")
+ set(pkgs_private "${pkgs_private} libtiff-4")
endif()
find_package(ZLIB)
if(ZLIB_FOUND)
- set(libs_private "${libs_private} -lz")
+ set(pkgs_private "${pkgs_private} zlib")
endif()
find_package(PkgConfig QUIET)
if(LIBWEBP_SUPPORT)
@@ -118,30 +118,16 @@ if(NOT SW_BUILD)
endif()
endif()
if(WEBP)
- set(libs_private "${libs_private} -lwebp")
+ set(pkgs_private "${pkgs_private} libwebp")
endif(WEBP)
if(WEBPMUX)
- set(libs_private "${libs_private} -lwebpmux")
+ set(pkgs_private "${pkgs_private} libwebpmux")
endif(WEBPMUX)
endif(LIBWEBP_SUPPORT)
if(OPENJPEG_SUPPORT)
- find_package(OpenJPEG)
- # we need absolute path in some cases on Windows
- find_library(JP2K_LIBRARY NAMES openjp2)
- if(OpenJPEG_FOUND AND JP2K_LIBRARY)
- set(JP2K_FOUND TRUE)
- set(JP2K_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})
- get_filename_component(JP2K_HEADER_DIR "${JP2K_INCLUDE_DIRS}" NAME)
- else()
- if(PKG_CONFIG_FOUND)
- pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)
- endif(PKG_CONFIG_FOUND)
- endif()
- if(JP2K_FOUND)
- set(JP2K_LIBRARIES ${JP2K_LIBRARY})
- set(libs_private "${libs_private} -lopenjp2")
- message(STATUS "FOUND OpenJPEG: ${JP2K_LIBRARIES}")
- endif()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(JP2K libopenjp2>=2.0 REQUIRED)
+ set(pkgs_private "${pkgs_private} libopenjp2")
endif(OPENJPEG_SUPPORT)
else() # SW_BUILD=ON
find_package(SW REQUIRED)
@@ -158,8 +144,7 @@ else() # SW_BUILD=ON
-DHAVE_LIBWEBP=1
-DHAVE_LIBWEBP_ANIM=1
-DHAVE_LIBZ=1
- -DHAVE_LIBJP2K=1
- -DLIBJP2K_HEADER="openjpeg.h")
+ -DHAVE_LIBJP2K=1)
endif()
set(libs_private "${libs_private} -lm")
@@ -299,7 +284,10 @@ get_target_property(leptonica_NAME leptonica NAME)
set(leptonica_VERSION ${VERSION_PLAIN})
get_target_property(leptonica_OUTPUT_NAME leptonica OUTPUT_NAME)
-configure_file(lept.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/lept.pc @ONLY)
+configure_file(lept.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/lept.pc.in @ONLY)
+# to resolve generator expression in OUTPUT_NAME
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lept.pc INPUT ${CMAKE_CURRENT_BINARY_DIR}/lept.pc.in)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/LeptonicaConfig-version.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig-version.cmake @ONLY)
diff --git a/cmake/Configure.cmake b/cmake/Configure.cmake
index b75cf19..4941187 100644
--- a/cmake/Configure.cmake
+++ b/cmake/Configure.cmake
@@ -96,7 +96,6 @@ endif()
if (JP2K_FOUND)
set(HAVE_LIBJP2K 1)
- set(LIBJP2K_HEADER <${JP2K_HEADER_DIR}/openjpeg.h>)
endif()
if (PNG_FOUND)
@@ -122,7 +121,6 @@ file(APPEND ${AUTOCONFIG_SRC} "
/* Define to 1 if you have libopenjp2. */
#cmakedefine HAVE_LIBJP2K 1
-#cmakedefine LIBJP2K_HEADER <${JP2K_HEADER_DIR}/openjpeg.h>
/* Define to 1 if you have jpeg. */
#cmakedefine HAVE_LIBJPEG 1
diff --git a/lept.pc.cmake b/lept.pc.cmake
index 9140d50..3e19307 100644
--- a/lept.pc.cmake
+++ b/lept.pc.cmake
@@ -6,6 +6,7 @@ includedir=${prefix}/include
Name: @leptonica_NAME@
Description: An open source C library for efficient image processing and image analysis operations
Version: @leptonica_VERSION@
+Requires.private: @pkgs_private@
Libs: -L${libdir} -l@leptonica_OUTPUT_NAME@
Libs.private: @libs_private@
Cflags: -I${includedir} -I${includedir}/leptonica
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e2c2f15..3d7e852 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,13 +19,8 @@ string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
add_library (leptonica ${src} ${hdr})
set_target_properties (leptonica PROPERTIES VERSION 6.0.0)
set_target_properties (leptonica PROPERTIES SOVERSION 6)
-if (WIN32)
-set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica-${VERSION_PLAIN})
-set_target_properties (leptonica PROPERTIES DEBUG_OUTPUT_NAME leptonica-${VERSION_PLAIN}d)
-else()
-set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica)
-set_target_properties (leptonica PROPERTIES DEBUG_OUTPUT_NAME leptonica)
-endif()
+
+set_target_properties (leptonica PROPERTIES OUTPUT_NAME leptonica$<$<BOOL:${WIN32}>:-${VERSION_PLAIN}$<$<CONFIG:DEBUG>:d>>)
if (BUILD_SHARED_LIBS)
target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS)
@@ -41,7 +36,7 @@ if (JPEG_LIBRARIES)
endif()
if (JP2K_FOUND)
target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIRS})
- target_link_libraries (leptonica ${JP2K_LIBRARIES})
+ target_link_libraries (leptonica ${JP2K_LINK_LIBRARIES})
endif()
if (PNG_LIBRARIES)
target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS})

View File

@ -0,0 +1,61 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58c70f4..93b983d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -358,7 +358,7 @@ configure_file(lept.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/lept.pc.in @ONLY)
# to resolve generator expression in OUTPUT_NAME
file(
GENERATE
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lept_$<CONFIG>.pc
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lept.pc
INPUT ${CMAKE_CURRENT_BINARY_DIR}/lept.pc.in)
configure_file(
@@ -368,7 +368,7 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/LeptonicaConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake @ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lept_$<CONFIG>.pc
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lept.pc
DESTINATION lib/pkgconfig)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/LeptonicaConfig-version.cmake
diff --git a/cmake/Configure.cmake b/cmake/Configure.cmake
index da41b1b..a2d163a 100644
--- a/cmake/Configure.cmake
+++ b/cmake/Configure.cmake
@@ -94,7 +94,7 @@ if (JPEG_FOUND)
set(HAVE_LIBJPEG 1)
endif()
-if (OPENJPEG_SUPPORT)
+if (OpenJPEG_FOUND)
set(HAVE_LIBJP2K 1)
endif()
@@ -106,7 +106,7 @@ if (TIFF_FOUND)
set(HAVE_LIBTIFF 1)
endif()
-if (LIBWEBP_SUPPORT)
+if (WebP_FOUND)
set(HAVE_LIBWEBP 1)
set(HAVE_LIBWEBP_ANIM 1)
endif()
diff --git a/cmake/templates/LeptonicaConfig.cmake.in b/cmake/templates/LeptonicaConfig.cmake.in
index cee3a0f..8602931 100644
--- a/cmake/templates/LeptonicaConfig.cmake.in
+++ b/cmake/templates/LeptonicaConfig.cmake.in
@@ -21,10 +21,10 @@
# ===================================================================================
include(CMakeFindDependencyMacro)
-if (@OPENJPEG_SUPPORT@)
+if (@ENABLE_OPENJPEG@)
find_dependency(OpenJPEG CONFIG)
endif()
-if (@LIBWEBP_SUPPORT@)
+if (@ENABLE_WEBP@)
find_dependency(WebP @MINIMUM_WEBPMUX_VERSION@ CONFIG)
endif()

View File

@ -1,13 +1,11 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO DanBloomberg/leptonica
REF b667978e86c4bf74f7fdd75f833127d2de327550 # 1.83.1
SHA512 fe4ea74aea024a4e522a5f985e51c5b110b5b4a3b3086e6fa7204129caf09b842f85041c386ee9bf2e878034ac2ebd2506396063771b677e931296ec6d76490b
REF ${VERSION}
SHA512 968a88d2074717e6f379d2f9b8f7f0d5193fe9b8856051e09e2b31c939689b196a4a9b2cde595ce76ff8ae2784680ef5e68c40709c051d3d23738e862968016f
HEAD_REF master
PATCHES
fix-build-and-pkgconfig.patch # See https://github.com/DanBloomberg/leptonica/pull/664 and https://github.com/DanBloomberg/leptonica/pull/662
private.patch # See https://github.com/DanBloomberg/leptonica/pull/666
webp.patch # See https://github.com/DanBloomberg/leptonica/pull/667
fix-pc-and-config.patch
)
vcpkg_find_acquire_program(PKGCONFIG)
@ -34,4 +32,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/leptonica-license.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/leptonica-license.txt")

View File

@ -1,65 +0,0 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3d7e852..1fab56c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,36 +27,36 @@ if (BUILD_SHARED_LIBS)
endif()
if (GIF_LIBRARIES)
- target_include_directories (leptonica PUBLIC ${GIF_INCLUDE_DIR})
- target_link_libraries (leptonica ${GIF_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${GIF_INCLUDE_DIR})
+ target_link_libraries (leptonica PRIVATE ${GIF_LIBRARIES})
endif()
if (JPEG_LIBRARIES)
- target_include_directories (leptonica PUBLIC ${JPEG_INCLUDE_DIR})
- target_link_libraries (leptonica ${JPEG_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${JPEG_INCLUDE_DIR})
+ target_link_libraries (leptonica PRIVATE ${JPEG_LIBRARIES})
endif()
if (JP2K_FOUND)
- target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIRS})
- target_link_libraries (leptonica ${JP2K_LINK_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${JP2K_INCLUDE_DIRS})
+ target_link_libraries (leptonica PRIVATE ${JP2K_LINK_LIBRARIES})
endif()
if (PNG_LIBRARIES)
- target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS})
- target_link_libraries (leptonica ${PNG_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${PNG_INCLUDE_DIRS})
+ target_link_libraries (leptonica PRIVATE ${PNG_LIBRARIES})
endif()
if (TIFF_LIBRARIES)
- target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR})
- target_link_libraries (leptonica ${TIFF_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${TIFF_INCLUDE_DIR})
+ target_link_libraries (leptonica PRIVATE ${TIFF_LIBRARIES})
endif()
if (WEBP_FOUND)
- target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS})
- target_link_libraries (leptonica ${WEBP_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${WEBP_INCLUDE_DIRS})
+ target_link_libraries (leptonica PRIVATE ${WEBP_LIBRARIES})
endif()
if (ZLIB_LIBRARIES)
- target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIRS})
- target_link_libraries (leptonica ${ZLIB_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${ZLIB_INCLUDE_DIRS})
+ target_link_libraries (leptonica PRIVATE ${ZLIB_LIBRARIES})
endif()
if (UNIX)
- target_link_libraries (leptonica m)
+ target_link_libraries (leptonica PRIVATE m)
set(lib ${CMAKE_SHARED_LIBRARY_PREFIX})
set(dll ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(old_target ${lib}lept${dll})
@@ -72,7 +72,7 @@ endif()
if (NOT SW_BUILD)
export(TARGETS leptonica FILE ${CMAKE_BINARY_DIR}/LeptonicaTargets.cmake)
else()
- target_link_libraries (leptonica
+ target_link_libraries (leptonica PRIVATE
org.sw.demo.gif
org.sw.demo.jpeg
org.sw.demo.glennrp.png

View File

@ -1,6 +1,6 @@
{
"name": "leptonica",
"version": "1.83.1",
"version": "1.84.1",
"description": "An open source library containing software that is broadly useful for image processing and image analysis applications",
"homepage": "https://github.com/DanBloomberg/leptonica",
"license": null,

View File

@ -1,70 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7330046..464e0fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,45 +84,12 @@ if(NOT SW_BUILD)
if(ZLIB_FOUND)
set(pkgs_private "${pkgs_private} zlib")
endif()
- find_package(PkgConfig QUIET)
if(LIBWEBP_SUPPORT)
- if(PKG_CONFIG_FOUND)
- pkg_check_modules(WEBP libwebp QUIET)
- pkg_check_modules(WEBPMUX libwebpmux>=${MINIMUM_WEBPMUX_VERSION} QUIET)
- endif(PKG_CONFIG_FOUND)
- if(NOT WEBP)
- find_path(WEBP_INCLUDE_DIR /webp/decode.h)
- find_library(WEBP_LIBRARY NAMES webp)
- if(WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
- set(WEBP 1)
- set(WEBP_FOUND TRUE)
- set(WEBP_LIBRARIES ${WEBP_LIBRARY})
- set(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIR})
- endif()
- endif()
- if(NOT WEBPMUX)
- find_path(WEBPMUX_INCLUDE_DIR /webp/mux.h)
- # TODO: check minimal required version
- if(NOT WEBPMUX_INCLUDE_DIR)
- message(STATUS "Can not find: /webp/mux.h")
- endif()
- if(NOT "${WEBPMUX_INCLUDE_DIR}" STREQUAL "${WEBP_INCLUDE_DIR}")
- set(WEBP_INCLUDE_DIRS ${WEBP_INCLUDE_DIRS} ${WEBPMUX_INCLUDE_DIR})
- endif()
- find_library(WEBPMUX_LIBRARY NAMES webpmux)
- if(WEBPMUX_INCLUDE_DIR AND WEBPMUX_LIBRARY)
- set(WEBPMUX 1)
- set(HAVE_LIBWEBP_ANIM 1)
- set(WEBPMUX_FOUND TRUE)
- set(WEBP_LIBRARIES ${WEBP_LIBRARIES} ${WEBPMUX_LIBRARY})
- endif()
- endif()
- if(WEBP)
- set(pkgs_private "${pkgs_private} libwebp")
- endif(WEBP)
- if(WEBPMUX)
- set(pkgs_private "${pkgs_private} libwebpmux")
- endif(WEBPMUX)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(WEBP libwebp REQUIRED)
+ pkg_check_modules(WEBPMUX libwebpmux>=${MINIMUM_WEBPMUX_VERSION} REQUIRED)
+ set(pkgs_private "${pkgs_private} libwebp")
+ set(pkgs_private "${pkgs_private} libwebpmux")
endif(LIBWEBP_SUPPORT)
if(OPENJPEG_SUPPORT)
find_package(PkgConfig REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1fab56c..790ca2a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -48,7 +48,9 @@ if (TIFF_LIBRARIES)
endif()
if (WEBP_FOUND)
target_include_directories (leptonica PRIVATE ${WEBP_INCLUDE_DIRS})
- target_link_libraries (leptonica PRIVATE ${WEBP_LIBRARIES})
+ target_link_libraries (leptonica PRIVATE ${WEBP_LINK_LIBRARIES})
+ target_include_directories (leptonica PRIVATE ${WEBPMUX_INCLUDE_DIRS})
+ target_link_libraries (leptonica PRIVATE ${WEBPMUX_LINK_LIBRARIES})
endif()
if (ZLIB_LIBRARIES)
target_include_directories (leptonica PRIVATE ${ZLIB_INCLUDE_DIRS})

View File

@ -4077,7 +4077,7 @@
"port-version": 2
},
"leptonica": {
"baseline": "1.83.1",
"baseline": "1.84.1",
"port-version": 0
},
"lerc": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a9c4f4bd6602bf8870169e982d345b686691ba58",
"version": "1.84.1",
"port-version": 0
},
{
"git-tree": "90d009f9febb130cbecc48c89cdc309563f85621",
"version": "1.83.1",