Skip to content

Commit

Permalink
(#23134) leptonica: use libpng version range, bump deps, remove old v…
Browse files Browse the repository at this point in the history
…ersions

* leptonica: use libpng version range, bump deps

* remove old versions
  • Loading branch information
mayeut committed Jul 1, 2024
1 parent ed0dc04 commit b897f57
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 85 deletions.
18 changes: 0 additions & 18 deletions recipes/leptonica/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
16 changes: 5 additions & 11 deletions recipes/leptonica/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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":
Expand Down Expand Up @@ -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:
Expand All @@ -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)")
Expand Down
48 changes: 0 additions & 48 deletions recipes/leptonica/all/patches/fix-find-modules-variables.patch

This file was deleted.

8 changes: 0 additions & 8 deletions recipes/leptonica/config.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b897f57

Please sign in to comment.