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

libtiff: add libtiff/4.4.0 #12083

Merged
merged 6 commits into from
Aug 8, 2022
Merged

Conversation

madebr
Copy link
Contributor

@madebr madebr commented Aug 5, 2022

Specify library name and version: libtiff/4.4.0

This is also a good place to share with all of us why you are submitting this PR (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks!


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.


def package_info(self):
self.cpp_info.set_property("cmake_find_mode", "both")
self.cpp_info.set_property("cmake_file_name", "TIFF")
self.cpp_info.set_property("cmake_target_name", "TIFF::TIFF")
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(tools.Version(self.version).major))
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major))
self.cpp_info.set_property("pkg_config_name", "libtiff-{}".format(Version(self.version).major))

There is no major accessor in conan.tools.scm.Version, it returns None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

major is a method of Version, so it would print e.g. <bound method Version.major of '3.4'>

Copy link
Contributor

@SpaceIm SpaceIm Aug 5, 2022

Choose a reason for hiding this comment

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

It is not, conans.tools.Version != conan.tools.scm.Version ;)

https://docs.conan.io/en/latest/reference/conanfile/tools/scm/other.html

Copy link
Contributor Author

@madebr madebr Aug 5, 2022

Choose a reason for hiding this comment

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

I am saying major is also available on conan.tools.scm.Version, not as a property, but as a method.

Run the following in your terminal:

python -c "import conan.tools.scm; v = conan.tools.scm.Version('5.4.3.2'); print(f'{v.major=}')"

The behavior of conan.tools.scm.Version's v.major()is completely different from conans.tools.Version's .major.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed

Copy link
Contributor

Choose a reason for hiding this comment

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

so something like this would work: Version(self.version).major(fill=False)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed it with version[0], that looked simpler to me.

self.cpp_info.libs = [lib + ".dll" for lib in self.cpp_info.libs]
if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]:
self.cpp_info.system_libs.append("m")

# TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed
self.cpp_info.names["cmake_find_package"] = "TIFF"
self.cpp_info.names["cmake_find_package_multi"] = "TIFF"
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(tools.Version(self.version).major)
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(Version(self.version).major)
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here, major returns None

@conan-center-bot

This comment has been minimized.

uilianries
uilianries previously approved these changes Aug 8, 2022
recipes/libtiff/all/conanfile.py Outdated Show resolved Hide resolved
Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com>
@conan-center-bot
Copy link
Collaborator

All green in build 4 (6d2bb165dfd71ba2cb0a2960429b68ffcce49e81):

  • libtiff/4.3.0@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py", line 4, in <module>
        from conans import ConanFile, CMake, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • libtiff/4.2.0@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py", line 4, in <module>
        from conans import ConanFile, CMake, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • libtiff/4.4.0@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py", line 4, in <module>
        from conans import ConanFile, CMake, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • libtiff/4.0.9@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py", line 4, in <module>
        from conans import ConanFile, CMake, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • libtiff/4.1.0@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py", line 4, in <module>
        from conans import ConanFile, CMake, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • libtiff/4.0.8@:
    All packages built successfully! (All logs)

    🔸 Informative: This recipe is not ready for Conan v2

    We have started the migration process to Conan v2 and exporting recipes successfully will be required in the future.
    This is just an informative note to gain awareness about the process, no need to take any action. The plan is to enforce smaller steps that are easier to fix and, eventually, this conan export step will work.
    See the recipe migration guide to know more about the changes required.

    ERROR: Error loading conanfile at '/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod_cci_PR-12083/recipes/libtiff/all/conanfile.py", line 4, in <module>
        from conans import ConanFile, CMake, tools
    ImportError: cannot import name 'ConanFile' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

self.cpp_info.libs = [lib + ".dll" for lib in self.cpp_info.libs]
if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]:
self.cpp_info.system_libs.append("m")

# TODO: to remove in conan v2 once cmake_find_package* & pkg_config generators removed
self.cpp_info.names["cmake_find_package"] = "TIFF"
self.cpp_info.names["cmake_find_package_multi"] = "TIFF"
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(tools.Version(self.version).major)
self.cpp_info.names["pkg_config"] = "libtiff-{}".format(Version(self.version)[0])
Copy link
Contributor

@SpaceIm SpaceIm Aug 10, 2022

Choose a reason for hiding this comment

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

To "fix" once conan-io/conan#11823 released in a version we can use in cci?

Copy link
Member

Choose a reason for hiding this comment

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

As soon as we have 1.52.0 or 1.51.2 running on CCI.

@madebr madebr deleted the libtiff-4.4.0 branch August 10, 2022 22:34
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.

None yet

4 participants