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

pkg-config: Support for arbitrary variables #1096

Closed
fooishbar opened this issue Nov 23, 2016 · 6 comments
Closed

pkg-config: Support for arbitrary variables #1096

fooishbar opened this issue Nov 23, 2016 · 6 comments

Comments

@fooishbar
Copy link
Contributor

pkg-config supports querying arbitrary variables, which is something we make use of in two places in Wayland.

Firstly, we install a .pc for the wayland-scanner generator/utility, so it's a little bit easier to find and a little bit harder to get wrong. This involves a custom wayland_scanner variable in the pkg-config file.

Secondly, we also use it in other places for the plugin directory setting. GStreamer also does this (and a couple of other things, e.g. GST_API_VERSION), and as a result has to use configure_file rather than built-in pkg-config support. I take it from #620 that this is desirable to fix.

@QuLogic
Copy link
Member

QuLogic commented Nov 23, 2016

This is a dupe of #726 and I think it's available already.

@nirbheek
Copy link
Member

Yes, this is already available, however you need 0.36.0 for this:

https://github.com/mesonbuild/meson/wiki/Reference-manual#dependency-object

A workaround if you need to use an older Meson is to use run_command to call pkg-config --variable foo manually.

@fooishbar
Copy link
Contributor Author

What about arbitrary variables in file generation?

@nirbheek
Copy link
Member

We're planning on adding more features to that, but it's not urgent since there's a good workaround. The recommended way to do non-trivial pkg-config file generation is to use configure_file on a .pc.in file. Most projects already have them, and using them helps keep Autotools and Meson build systems in-sync for projects that have both.

I see that in Wayland you also already have .pc.in files, so just running configure_file with install_dir: should work out for you.

@nirbheek
Copy link
Member

nirbheek commented Nov 28, 2016

Closing this since improving pkg-config file generation is already on the TODO list.

@whot
Copy link
Contributor

whot commented May 18, 2017

fwiw, support for variables in file generation was added with commit 7ed1990

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants