It was previously impossible to do this: ``` dep.get_pkgconfig_variable( 'foo', define_variable: ['prefix', '/usr', 'datadir', '/usr/share'], ) ``` since get_pkgconfig_variable mandated exactly two (if any) arguments. However, you could do this: ``` dep.get_variable( 'foo', pkgconfig_define: ['prefix', '/usr', 'datadir', '/usr/share'], ) ``` It would silently do the wrong thing, by defining "prefix" as `/usr=datadir=/usr/share`, which might not "matter" if only datadir was used in the "foo" variable as the unmodified value might be adequate. The actual intention of anyone writing such a meson.build is that they aren't sure whether the .pc file uses ${prefix} or ${datadir} (or which one gets used, might have changed between versions of that .pc file, even). A recent refactor made this into a hard error, which broke some projects that were doing this and inadvertently depending on some .pc file that only used the second variable. (This was "fine" since the result was essentially meaningful, and even resulted in behavior identical to the intended behavior if both projects were installed into the same prefix -- in which case there's nothing to remap.) Re-allow this. There are two ways we could re-allow this: - ignore it with a warning - add a new feature to allow actually doing this Since the use case which triggered this bug actually has a pretty good reason to want to do this, it makes sense to add the new feature. Fixes https://bugs.gentoo.org/916576 Fixes https://github.com/containers/bubblewrap/issues/609pull/12509/head
parent
dac3f26ee5
commit
398c4b2287
8 changed files with 48 additions and 9 deletions
@ -0,0 +1,10 @@ |
||||
## pkg-config dependencies can now get a variable with multiple replacements |
||||
|
||||
When using [[dep.get_variable]] and defining a `pkgconfig_define`, it is |
||||
sometimes useful to remap multiple dependency variables. For example, if the |
||||
upstream project changed the variable name that is interpolated and it is |
||||
desirable to support both versions. |
||||
|
||||
It is now possible to pass multiple pairs of variable/value. |
||||
|
||||
The same applies to the compatibility [[dep.get_pkgconfig_variable]] method. |
Loading…
Reference in new issue