Skip to content

leptonica: add version 1.83.0 #14864

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

Merged
merged 16 commits into from
Jan 25, 2023
Merged

Conversation

theirix
Copy link
Contributor

@theirix theirix commented Dec 21, 2022

Specify library name and version: leptonica/1.83.0

There is one moment I don't fully understand. Upstream uses find_package(GIF) which seems to be totally fine.
But Conan generators create a bunch of giflib-* files so the find_package doesn't find them but picks up a system include path /Library/Frameworks/UnixImageIO.framework/Headers. Using find_package(GIFLIB) fixes the problem.

Recent giflib changes do not change a cmake_file_name property. If it is not changed, why doesn't it work?


@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor

SpaceIm commented Dec 21, 2022

There is one moment I don't fully understand. Upstream uses find_package(GIF) which seems to be totally fine. But Conan generators create a bunch of giflib-* files so the find_package doesn't find them but picks up a system include path /Library/Frameworks/UnixImageIO.framework/Headers. Using find_package(GIFLIB) fixes the problem.

Recent giflib changes do not change a cmake_file_name property. If it is not changed, why doesn't it work?

Can't reproduce this issue with conan 1.55.0

theirix and others added 2 commits December 21, 2022 13:57
@theirix
Copy link
Contributor Author

theirix commented Dec 21, 2022

There is one moment I don't fully understand. Upstream uses find_package(GIF) which seems to be totally fine. But Conan generators create a bunch of giflib-* files so the find_package doesn't find them but picks up a system include path /Library/Frameworks/UnixImageIO.framework/Headers. Using find_package(GIFLIB) fixes the problem.

Removed the local cache, FindGIF.cmake appeared and now GIF can be found by find_package in the default module mode. False alarm, removed workaround.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

Comment on lines 173 to 174
# 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)", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

Surprising. This recipe has pkgconfig in build requirements when openjpeg option is enabled, and pkgconfig files are generated by PkgConfigDeps, so why would it fail without this patch? I can try to test but AFAIR it was working fine.

Copy link
Contributor

@SpaceIm SpaceIm Dec 22, 2022

Choose a reason for hiding this comment

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

I've tested and previous patch works like a charm, openjpeg is always found & injected in 1.82.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, my bad. Previously openjpeg was located using pkgconfig. So hardcoded openjpeg's version paths do not affect already found openjpeg.

Why I have moved to cmake-only openjpeg is to fix MSVC build (I don't have a clue why it is failed). 1.83.0 and pre-1.83.0 Leptonica have different resolution order for openjpeg: pkg-config then cmake vs cmake vs pkg-config. I think it is easier for us just to use CMake. How do you think?

@theirix
Copy link
Contributor Author

theirix commented Dec 22, 2022

By the way, "ERROR: Package 'zlib/1.2.13' not resolved: Unable to find 'zlib/1.2.13' in remotes" in a Conan v2 automatic comment seems strange.

@conan-center-bot

This comment has been minimized.

danimtb
danimtb previously approved these changes Dec 27, 2022
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline

All green in build 9 (82ae5a3114527f460b284f5cb96bcce995d775ad):

  • leptonica/1.81.0@:
    All packages built successfully! (All logs)

  • leptonica/1.82.0@:
    All packages built successfully! (All logs)

  • leptonica/1.78.0@:
    All packages built successfully! (All logs)

  • leptonica/1.83.0@:
    All packages built successfully! (All logs)

  • leptonica/1.79.0@:
    All packages built successfully! (All logs)

  • leptonica/1.80.0@:
    All packages built successfully! (All logs)


Conan v2 pipeline (informative, not required for merge)

Failure in build 9 (82ae5a3114527f460b284f5cb96bcce995d775ad):

  • leptonica/1.82.0@:
    CI failed to create some packages (All logs)

    Logs for packageID null:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    
    ********************************************************************************
    conan install --require=leptonica/1.82.0@#9ea34e3708ea0a0b480f5c9247c51836 --build=leptonica/1.82.0 -pr:h /home/conan/w/prod-v2/BuildSingleReference/8154/cdae46f0-ffe6-4ab4-8bb7-f3d76538c2ae/profile_linux_11_libstdcpp11_gcc_release_64.-shared-False.txt -c:h tools.system.package_manager:mode=install -c:h tools.system.package_manager:sudo=True -pr:b /home/conan/w/prod-v2/BuildSingleReference/8154/cdae46f0-ffe6-4ab4-8bb7-f3d76538c2ae/profile_linux_11_libstdcpp11_gcc_release_64.-shared-False.txt -c:b tools.system.package_manager:mode=install -c:b tools.system.package_manager:sudo=True
    ********************************************************************************
    
    -------- Input profiles --------
    Profile host:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    [conf]
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    
    Profile build:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    [conf]
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    
    
    -------- Computing dependency graph --------
    zlib/1.2.13: Not found in local cache, looking in remotes...
    zlib/1.2.13: Checking remote: conan-center-v2
    zlib/1.2.13: Checking remote: c3i_PR-v2-14864
    Graph root
        virtual
    Requirements
        leptonica/1.82.0#9ea34e3708ea0a0b480f5c9247c51836 - Cache
    Graph error
        Package 'zlib/1.2.13' not resolved: Unable to find 'zlib/1.2.13' in remotes
    
    -------- Computing necessary packages --------
    ERROR: Package 'zlib/1.2.13' not resolved: Unable to find 'zlib/1.2.13' in remotes
    
  • leptonica/1.83.0@:
    Didn't run or was cancelled before finishing

  • leptonica/1.80.0@:
    Didn't run or was cancelled before finishing

  • leptonica/1.81.0@:
    Didn't run or was cancelled before finishing

  • leptonica/1.78.0@:
    Didn't run or was cancelled before finishing

  • leptonica/1.79.0@:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@@ -139,47 +133,69 @@ def _patch_sources(self):
replace_in_file(self, cmakelists_src, "${GIF_LIBRARIES}", "GIF::GIF")
if not self.options.with_gif:
replace_in_file(self, cmakelists_src, "if (GIF_LIBRARIES)", "if(0)")
replace_in_file(self, cmake_configure, "if (GIF_FOUND)", "if(0)")
if Version(self.version) >= "1.83.0":
replace_in_file(self, cmake_configure, "if(GIF_FOUND)", "if(0)")
Copy link
Contributor

Choose a reason for hiding this comment

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

I would love to see patches for this project in the future 🙏

@conan-center-bot conan-center-bot merged commit 5ddac4f into conan-io:master Jan 25, 2023
StellaSmith pushed a commit to StellaSmith/conan-center-index that referenced this pull request Feb 2, 2023
* Add leptonica 1.83.0

* Modernize with rm_safe

* Add new options for libwebp and openjpeg from 1.83.0

* Fix whitespaces in inline patching for 1.83.0

* Consolidate handling webp, openjpeg options

* Use find_package(GIFLIB)

I am not sure if it is correct but otherwise find_package(GIF) picks up
system framework not the generate `giflib*` cmake files

* Add required fields to yaml

* Update patch metadata

Co-authored-by: SpaceIm <[email protected]>

* Revert "Use find_package(GIFLIB)"

This reverts commit ccab369.

* Use openjpeg 2.4.0 for Leptonica older thatn 1.83.0

* Improve patching for 1.82.0

* Try to link to target openjp2

* Prefer CMake for openjpeg

* Fix patching pkg_check_modules for older versions

* Always depend on latest openjpeg

* Bump libpng dependency

Co-authored-by: SpaceIm <[email protected]>
datalogics-robb pushed a commit to datalogics-robb/conan-center-index that referenced this pull request May 4, 2023
This reverts commit 5ddac4f.

This is being reverted because the options to turn off different
graphic packages don't work (WEBP, etc.).
datalogics-robb pushed a commit to datalogics-robb/conan-center-index that referenced this pull request May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants