Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leptonica: use libpng version range, bump deps, remove old versions #23134

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions recipes/leptonica/all/conandata.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only tesseract is consuming leptonica/1.83.1 and 1.82.0. Looking good removing old versions.

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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'd create conflicts with every other recipe that depends on openjpeg, as those are stuck on .0 for now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opencv has moved to 2.5.2, leptonica is only used by tesseract which is only used by opencv so we might as well update this no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RubenRBS, do you need more information ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, sorry for the delay, will try to push this one forward :)

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 @@ -162,10 +160,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 @@ -180,8 +175,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
Loading