From b897f57ed86c971d915dc85a74f61d485c22e1ad Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Mon, 1 Jul 2024 15:47:58 +0200 Subject: [PATCH] (#23134) leptonica: use libpng version range, bump deps, remove old versions * leptonica: use libpng version range, bump deps * remove old versions --- recipes/leptonica/all/conandata.yml | 18 ------- recipes/leptonica/all/conanfile.py | 16 ++----- .../patches/fix-find-modules-variables.patch | 48 ------------------- recipes/leptonica/config.yml | 8 ---- 4 files changed, 5 insertions(+), 85 deletions(-) delete mode 100644 recipes/leptonica/all/patches/fix-find-modules-variables.patch diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 49782e81d8fcd..7c713eeaa4311 100644 --- a/recipes/leptonica/all/conandata.yml +++ b/recipes/leptonica/all/conandata.yml @@ -2,27 +2,9 @@ sources: "1.83.1": url: "https://github.com/DanBloomberg/leptonica/archive/1.83.1.tar.gz" sha256: "4289d0a4224b614010072253531c0455a33a4d7c7a0017fe7825ed382290c0da" - "1.83.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.83.0.tar.gz" - sha256: "14cf531c2219a1414e8e3c51a3caa5cf021a52e782c4a6561bf64d0ef2119282" "1.82.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.82.0.tar.gz" sha256: "40fa9ac1e815b91e0fa73f0737e60c9eec433a95fa123f95f2573dd3127dd669" "1.81.0": url: "https://github.com/DanBloomberg/leptonica/archive/1.81.0.tar.gz" sha256: "70ebc04ff8b9684205bd1d01843c635a8521255b74813bf7cce9a33368f7952c" - "1.80.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.80.0.tar.gz" - sha256: "3952b974ec057d24267aae48c54bca68ead8275604bf084a73a4b953ff79196e" - "1.79.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.79.0.tar.gz" - sha256: "bf9716f91a4844c2682a07ef21eaf68b6f1077af1f63f27c438394fd66218e17" - "1.78.0": - url: "https://github.com/DanBloomberg/leptonica/archive/1.78.0.tar.gz" - sha256: "f8ac4d93cc76b524c2c81d27850bfc342e68b91368aa7a1f7d69e34ce13adbb4" -patches: - "1.78.0": - - patch_file: "patches/fix-find-modules-variables.patch" - patch_description: "CMake: robust handling of dependencies" - patch_type: "portability" - patch_source: "https://github.com/DanBloomberg/leptonica/pull/456" diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index 5541499f0e910..a937905bbcab5 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -72,15 +72,15 @@ def requirements(self): if self.options.with_jpeg == "libjpeg": self.requires("libjpeg/9e") elif self.options.with_jpeg == "libjpeg-turbo": - self.requires("libjpeg-turbo/3.0.1") + self.requires("libjpeg-turbo/3.0.2") elif self.options.with_jpeg == "mozjpeg": self.requires("mozjpeg/4.1.5") if self.options.with_png: - self.requires("libpng/1.6.40") + self.requires("libpng/[>=1.6 <2]") if self.options.with_tiff: self.requires("libtiff/4.6.0") if self.options.with_openjpeg: - self.requires("openjpeg/2.5.0") + self.requires("openjpeg/2.5.2") if self.options.with_webp: self.requires("libwebp/1.3.2") @@ -94,8 +94,6 @@ def source(self): def generate(self): tc = CMakeToolchain(self) - if Version(self.version) < "1.79.0": - tc.variables["STATIC"] = not self.options.shared tc.variables["BUILD_PROG"] = False tc.variables["SW_BUILD"] = False if Version(self.version) >= "1.83.0": @@ -150,10 +148,7 @@ def _patch_sources(self): replace_in_file(self, cmakelists_src, "${JP2K_LIBRARIES}", "openjp2") if Version(self.version) < "1.83.0": # pkgconfig is prefered to CMake. Disable pkgconfig so only CMake is used - if Version(self.version) <= "1.78.0": - replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2)", "") - else: - replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") + replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") # versions below 1.83.0 do not have an option toggle replace_in_file(self, cmakelists, "if(NOT JP2K)", "if(0)") if not self.options.with_openjpeg: @@ -168,8 +163,7 @@ def _patch_sources(self): if Version(self.version) < "1.83.0": # versions below 1.83.0 do not have an option toggle replace_in_file(self, cmakelists, "if(NOT WEBP)", "if(0)") - if Version(self.version) >= "1.79.0": - replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") + replace_in_file(self, cmakelists, "if(NOT WEBPMUX)", "if(0)") if not self.options.with_webp: replace_in_file(self, cmakelists_src, "if (WEBP_FOUND)", "if(0)") replace_in_file(self, cmake_configure, "if (WEBP_FOUND)", "if(0)") diff --git a/recipes/leptonica/all/patches/fix-find-modules-variables.patch b/recipes/leptonica/all/patches/fix-find-modules-variables.patch deleted file mode 100644 index 3dc86df7e707e..0000000000000 --- a/recipes/leptonica/all/patches/fix-find-modules-variables.patch +++ /dev/null @@ -1,48 +0,0 @@ -see https://github.com/DanBloomberg/leptonica/pull/456 - ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -31,33 +31,33 @@ if (NOT STATIC) - target_compile_definitions (leptonica PRIVATE -DLIBLEPT_EXPORTS) - endif() - --if (GIF_LIBRARY) -+if (GIF_LIBRARIES) - target_include_directories (leptonica PUBLIC ${GIF_INCLUDE_DIR}) -- target_link_libraries (leptonica ${GIF_LIBRARY}) -+ target_link_libraries (leptonica ${GIF_LIBRARIES}) - endif() --if (JPEG_LIBRARY) -+if (JPEG_LIBRARIES) - target_include_directories (leptonica PUBLIC ${JPEG_INCLUDE_DIR}) -- target_link_libraries (leptonica ${JPEG_LIBRARY}) -+ target_link_libraries (leptonica ${JPEG_LIBRARIES}) - endif() - if (JP2K_FOUND) - target_include_directories (leptonica PUBLIC ${JP2K_INCLUDE_DIRS}) - target_link_libraries (leptonica ${JP2K_LIBRARIES}) - endif() --if (PNG_LIBRARY) -+if (PNG_LIBRARIES) - target_include_directories (leptonica PUBLIC ${PNG_INCLUDE_DIRS}) -- target_link_libraries (leptonica ${PNG_LIBRARY}) -+ target_link_libraries (leptonica ${PNG_LIBRARIES}) - endif() --if (TIFF_LIBRARY) -+if (TIFF_LIBRARIES) - target_include_directories (leptonica PUBLIC ${TIFF_INCLUDE_DIR}) -- target_link_libraries (leptonica ${TIFF_LIBRARY}) -+ target_link_libraries (leptonica ${TIFF_LIBRARIES}) - endif() - if (WEBP_FOUND) - target_include_directories (leptonica PUBLIC ${WEBP_INCLUDE_DIRS}) - target_link_libraries (leptonica ${WEBP_LIBRARIES}) - endif() --if (ZLIB_LIBRARY) -+if (ZLIB_LIBRARIES) - target_include_directories (leptonica PUBLIC ${ZLIB_INCLUDE_DIR}) -- target_link_libraries (leptonica ${ZLIB_LIBRARY}) -+ target_link_libraries (leptonica ${ZLIB_LIBRARIES}) - endif() - - if (UNIX) diff --git a/recipes/leptonica/config.yml b/recipes/leptonica/config.yml index 7de53a77a3916..38d6d07fba4c6 100644 --- a/recipes/leptonica/config.yml +++ b/recipes/leptonica/config.yml @@ -1,15 +1,7 @@ versions: "1.83.1": folder: all - "1.83.0": - folder: all "1.82.0": folder: all "1.81.0": folder: all - "1.80.0": - folder: all - "1.79.0": - folder: all - "1.78.0": - folder: all