-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[cairo] v2 support #12240
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a4eb122
to
499575d
Compare
This comment has been minimized.
This comment has been minimized.
Hooks produced the following warnings for commit 499575dcairo/1.17.2
cairo/1.16.0
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@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". |
This comment has been minimized.
This comment has been minimized.
def boolean(value): | ||
return "yes" if value else "no" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
recipes/cairo/meson/conanfile.py
Outdated
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.components["cairo_"].names["pkg_config_name"] = "cairo" |
useless if pkg_config_name
is there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awaiting consensus from reviewers.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.cpp_info.components[component].names["pkg_config"] = component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awaiting consensus from reviewers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@planetmarshall you can remove
This comment has been minimized.
This comment has been minimized.
recipes/cairo/all/conanfile.py
Outdated
self.build_requires("libtool/2.4.6") | ||
self.build_requires("pkgconf/1.7.4") | ||
self.build_requires("gtk-doc-stub/cci.20181216") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
All green in build 22 (
|
* [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]>
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 expectscairo
to also includecairo-gobject
)