[bug] Conan is not able to generate pkg-config variables
See original GitHub issueEnvironment Details (include every applicable attribute)
- Operating System+version: CentOS 8
- Compiler+version: Clang 10.0.1
- Conan version: 1.29.1
- Python version: 3.8.3
Steps to reproduce (Include if Applicable)
Building pulseaudio
fails because the glib
dependency is using the pkg-conf
generator as opposed to packaging the native .pc
files, and therefore a variable needed by pulseaudio
is missing. Removing the pkg-conf files is the right approach, this is in accordance with the Conan philosophy of letting the package manager generate these files to make the recipes agnostic to the consumer. However the native gio-2.0.pc
file defines some variables including:
...
glib_compile_schemas=${bindir}/glib-compile-schemas
...
And pulseaudio
uses this variable, therefor resulting in build failure:
configure:26162: error: glib-compile-schemas not found.
We can see that the configure script of pulseaudio is looking for that variable:
pkg_cv_GLIB_COMPILE_SCHEMAS=`$PKG_CONFIG --variable="glib_compile_schemas" "gio-2.0" 2>/dev/null`
Therefor we need to have a way to define arbitrary pkg_config variables for a specific component. Something like this:
self.cpp_info.components["gio-2.0"].glib_compile_schemas = os.path.join(self.package_folder, "bin", "glib-compile-schemas")
Logs (Executed commands with output) (Include/Attach if Applicable)
Output of pulseaudio
configure:
config.log
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
@memsharded these variables are generator specific, so we would need something like
components["component"].vars["generator"]["variable_name"] = "variable value
I guess cmake generators too would gain a lot of new possibilities with this feature@ericLemanissier Thanks!
I would prefer the cleaner syntax above but I think this ticket can be closed.