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

[cairo] v2 support #12240

Merged

Conversation

planetmarshall
Copy link
Contributor

Specify library name and version: cairo/

The cairo package sets the name of the base pkg-config component file to "cairo" which renames the default parent component (the one containing all the sub-components).

The result is that dependent packages using the pkg-config generator and linking to "cairo" only get the base cairo component and not additional components such as cairo-gobject. This can result linking errors in dependent packages (specifically in the MSVC build of gtkmm which expects cairo to also include cairo-gobject)


  • 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.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit 499575d
cairo/1.17.2
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-gobject.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-script-interpreter.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/cairo/libcairo-trace.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo.2.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-gobject.2.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-script-interpreter.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-script-interpreter.2.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-gobject.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
cairo/1.16.0
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-gobject.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-script-interpreter.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/cairo/libcairo-trace.so' links to system library 'rt' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo.2.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-gobject.2.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-script-interpreter.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-script-interpreter.2.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libcairo-gobject.dylib' links to system library 'ApplicationServices' but it is not in cpp_info.frameworks.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@planetmarshall planetmarshall changed the title [cairo] rename parent component [cairo] v2 support Aug 24, 2022
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

prince-chrismc
prince-chrismc previously approved these changes Aug 25, 2022
@theartful
Copy link
Contributor

@planetmarshall There has to be a component that just has the pkg-config name "cairo" since many libraries expect it to exist. These changes make it that no pkg-config file is named "cairo.pc".

@conan-center-bot

This comment has been minimized.

Comment on lines +157 to +158
def boolean(value):
return "yes" if value else "no"
Copy link
Contributor

Choose a reason for hiding this comment

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

yes_no lambda was more elegant I believe, why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rejected by the linter ( PEP-8 - E731 in Flake8 ).

As for the naming, I think boolean is a better name for a function than yes_no.


def add_component_and_base_requirements(component, requirements, system_libs=None):
self.cpp_info.components[component].set_property("pkg_config_name", component)
self.cpp_info.components[component].names["pkg_config"] = component
Copy link
Contributor

@SpaceIm SpaceIm Aug 25, 2022

Choose a reason for hiding this comment

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

Can be removed, pkg_config generator inherits frompkg_config_name property in components as well (also in global scope but only since a version I don't remember where it was fixed, but far before conan 1.50.0 which is the minimum in this PR).

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we broke the connection between v1 and v2 generators 🤔 was that only for CMake?

Since we have not removed it in other recipes, I dont see the harm in leaving it here as well

self.cpp_info.names["pkg_config"] = "cairo-all-do-no-use"

self.cpp_info.components["cairo_"].set_property("pkg_config_name", "cairo")
self.cpp_info.components["cairo_"].names["pkg_config_name"] = "cairo"
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.components["cairo_"].names["pkg_config_name"] = "cairo"

useless if pkg_config_name is there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awaiting consensus from reviewers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

... although this should be ["pkg_config"].name anyway. (typo)


def add_component_and_base_requirements(component, requirements, system_libs=None):
self.cpp_info.components[component].set_property("pkg_config_name", component)
self.cpp_info.components[component].names["pkg_config"] = component
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.components[component].names["pkg_config"] = component

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awaiting consensus from reviewers.

Copy link
Member

Choose a reason for hiding this comment

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

@planetmarshall you can remove

@conan-center-bot

This comment has been minimized.

Comment on lines 107 to 109
self.build_requires("libtool/2.4.6")
self.build_requires("pkgconf/1.7.4")
self.build_requires("gtk-doc-stub/cci.20181216")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.build_requires("libtool/2.4.6")
self.build_requires("pkgconf/1.7.4")
self.build_requires("gtk-doc-stub/cci.20181216")
self.tool_requires("libtool/2.4.6")
self.tool_requires("pkgconf/1.7.4")
self.tool_requires("gtk-doc-stub/cci.20181216")

https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#requirements

@conan-center-bot
Copy link
Collaborator

All green in build 22 (49787f55d6fabeb07d6e4a1f4519e759d9ff94c3):

  • cairo/1.17.4@:
    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-12240/recipes/cairo/meson/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12240/recipes/cairo/meson/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-12240/recipes/cairo/meson/conanfile.py", line 8, in <module>
        from conans import tools, Meson, VisualStudioBuildEnvironment
    ImportError: cannot import name 'tools' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • cairo/1.16.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-12240/recipes/cairo/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12240/recipes/cairo/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-12240/recipes/cairo/all/conanfile.py", line 7, in <module>
        from conans import AutoToolsBuildEnvironment, VisualStudioBuildEnvironment
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • cairo/1.17.2@:
    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-12240/recipes/cairo/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod_cci_PR-12240/recipes/cairo/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-12240/recipes/cairo/all/conanfile.py", line 7, in <module>
        from conans import AutoToolsBuildEnvironment, VisualStudioBuildEnvironment
    ImportError: cannot import name 'AutoToolsBuildEnvironment' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

@conan-center-bot conan-center-bot merged commit 41c4c73 into conan-io:master Sep 1, 2022
@ericLemanissier ericLemanissier mentioned this pull request Sep 19, 2022
4 tasks
ericLemanissier pushed a commit to ericLemanissier/conan-center-index that referenced this pull request Sep 26, 2022
* [cairo] do not rename the parent pkg-config package

* [cairo] refactor and simplify package_info method

* [cairo] fix v2 linting

* [cairo] provide parent pkgconfig and use set_property_name

* [cairo] resolve system lib warnings

* [cairo] v2 linting

* Apply review suggestion

Co-authored-by: Uilian Ries <[email protected]>

* Apply review suggestion

Co-authored-by: Uilian Ries <[email protected]>

* [cairo] bump requirements versions

* [cairo] full package mode only for static glib

* [cairo] shared glib with static msvcrt is not supported

* [cairo] restore old pkg-config file names

* [cairo] update source method

* [cairo] restore main pkg-config name

* [cairo] fix property name typo

* [cairo] use tool_requires

Co-authored-by: Uilian Ries <[email protected]>
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.

6 participants