diff --git a/recipes/leptonica/all/conandata.yml b/recipes/leptonica/all/conandata.yml index 7c713eeaa43112..0a2cd20eab0b42 100644 --- a/recipes/leptonica/all/conandata.yml +++ b/recipes/leptonica/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.85.0": + url: "https://github.com/DanBloomberg/leptonica/archive/1.85.0.tar.gz" + sha256: "c01376bce0379d4ea4bc2ec5d5cbddaa49e2f06f88242619ab8c059e21adf233" "1.83.1": url: "https://github.com/DanBloomberg/leptonica/archive/1.83.1.tar.gz" sha256: "4289d0a4224b614010072253531c0455a33a4d7c7a0017fe7825ed382290c0da" diff --git a/recipes/leptonica/all/conanfile.py b/recipes/leptonica/all/conanfile.py index a937905bbcab5f..f19aa2e7c182f0 100644 --- a/recipes/leptonica/all/conanfile.py +++ b/recipes/leptonica/all/conanfile.py @@ -96,7 +96,15 @@ def generate(self): tc = CMakeToolchain(self) tc.variables["BUILD_PROG"] = False tc.variables["SW_BUILD"] = False - if Version(self.version) >= "1.83.0": + if Version(self.version) >= "1.85.0": + tc.variables["ENABLE_ZLIB"] = self.options.with_zlib + tc.variables["ENABLE_PNG"] = self.options.with_png + tc.variables["ENABLE_GIF"] = self.options.with_gif + tc.variables["ENABLE_JPEG"] = self.options.with_jpeg + tc.variables["ENABLE_TIFF"] = self.options.with_tiff + tc.variables["ENABLE_WEBP"] = self.options.with_webp + tc.variables["ENABLE_OPENJPEG"] = self.options.with_openjpeg + elif Version(self.version) >= "1.83.0": tc.variables["LIBWEBP_SUPPORT"] = self.options.with_webp tc.variables["OPENJPEG_SUPPORT"] = self.options.with_openjpeg tc.generate() @@ -145,7 +153,8 @@ def _patch_sources(self): ## We have to be more aggressive with dependencies found with pkgconfig ## Injection of libdirs is ensured by conan_basic_setup() ## openjpeg - replace_in_file(self, cmakelists_src, "${JP2K_LIBRARIES}", "openjp2") + if Version(self.version) < "1.85.0": + 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 replace_in_file(self, cmakelists, "pkg_check_modules(JP2K libopenjp2>=2.0 QUIET)", "") @@ -154,7 +163,7 @@ def _patch_sources(self): if not self.options.with_openjpeg: replace_in_file(self, cmakelists_src, "if (JP2K_FOUND)", "if(0)") replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") - else: + elif Version(self.version) < "1.85.0": replace_in_file(self, cmakelists, "set(JP2K_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIRS})", "set(JP2K_INCLUDE_DIRS ${OpenJPEG_INCLUDE_DIRS})") if not self.options.with_openjpeg: replace_in_file(self, cmake_configure, "if (JP2K_FOUND)", "if(0)") @@ -167,13 +176,14 @@ def _patch_sources(self): 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)") - if Version(self.version) >= "1.83.0" or self.options.with_webp: - replace_in_file(self, cmakelists_src, - "if (WEBP_FOUND)", - "if (WEBP_FOUND)\n" - "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" - "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") - replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") + if Version(self.version) < "1.85.0": + if Version(self.version) >= "1.83.0" and self.options.with_webp: + replace_in_file(self, cmakelists_src, + "if (WEBP_FOUND)", + "if (WEBP_FOUND)\n" + "target_link_directories(leptonica PRIVATE ${WEBP_LIBRARY_DIRS} ${WEBPMUX_LIBRARY_DIRS})\n" + "target_compile_definitions(leptonica PRIVATE ${WEBP_CFLAGS_OTHER} ${WEBPMUX_CFLAGS_OTHER})") + replace_in_file(self, cmakelists_src, "${WEBP_LIBRARIES}", "${WEBP_LIBRARIES} ${WEBPMUX_LIBRARIES}") # Remove detection of fmemopen() on macOS < 10.13 # CheckFunctionExists will find it in the link library. diff --git a/recipes/leptonica/config.yml b/recipes/leptonica/config.yml index 38d6d07fba4c6f..73dd82999a6272 100644 --- a/recipes/leptonica/config.yml +++ b/recipes/leptonica/config.yml @@ -1,4 +1,6 @@ versions: + "1.85.0": + folder: all "1.83.1": folder: all "1.82.0":