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

How to get "Requires:" field from pkg-config file? #13964

Open
dkondor opened this issue Nov 26, 2024 · 0 comments
Open

How to get "Requires:" field from pkg-config file? #13964

dkondor opened this issue Nov 26, 2024 · 0 comments

Comments

@dkondor
Copy link

dkondor commented Nov 26, 2024

I might be missing something very basic, but I cannot seem to find a way to get the dependencies of a (pkg-config) dependency. I.e. I would like to be able to parse the contents of the "Requires:" field. Currently I work this around by using run_command('pkg-config', '--print-requires', ...), e.g. see here.

Is this already supported? Or is it something that is not recommended to do?

My use case and context:

My project (wstroke, a gesture plugin for Wayfire) depends on Wayfire, and transitively on the wlroots library. Currently, there are multiple versions of wlroots that can be installed in parallel, providing separate pkg-config files (wlroots and wlroots-0.18). My code can be built with either, but it should use the same version that Wayfire uses. Of course, this is achieved by adding Wayfire as a dependency which will pull in the correct version of wlroots as well.

My problem is that beyond the plugin library, I also want to generate a separate executable (see here) which should only depend on wlroots and not on Wayfire (but of course the same version of wlroots as the plugin library). So I need to find out which dependency is used by Wayfire and include that.

My current solution works, but I'm wondering if there is a better way to achieve this.

Thanks!

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

No branches or pull requests

1 participant