Handle uppercase dependency names in wraps.

pull/8152/head
Jussi Pakkanen 4 years ago
parent 5cbc8f866c
commit ca30550e06
  1. 7
      mesonbuild/wrap/wrap.py
  2. 6
      test cases/common/234 wrap case/meson.build
  3. 13
      test cases/common/234 wrap case/prog.c
  4. 5
      test cases/common/234 wrap case/subprojects/up_down.wrap
  5. 3
      test cases/common/234 wrap case/subprojects/up_down/meson.build
  6. 3
      test cases/common/234 wrap case/subprojects/up_down/up_down.h

@ -116,8 +116,8 @@ class PackageDefinition:
try:
self.config = configparser.ConfigParser(interpolation=None)
self.config.read(self.filename)
except configparser.Error:
raise WrapException('Failed to parse {}'.format(self.basename))
except configparser.Error as e:
raise WrapException('Failed to parse {}: {}'.format(self.basename, str(e)))
self.parse_wrap_section()
if self.type == 'redirect':
# [wrap-redirect] have a `filename` value pointing to the real wrap
@ -251,6 +251,9 @@ class Resolver:
self.provided_programs.setdefault(k, v)
def find_dep_provider(self, packagename: str) -> T.Optional[T.Union[str, T.List[str]]]:
# Python's ini parser converts all key values to lowercase.
# Thus the query name must also be in lower case.
packagename = packagename.lower()
# Return value is in the same format as fallback kwarg:
# ['subproject_name', 'variable_name'], or 'subproject_name'.
wrap = self.provided_deps.get(packagename)

@ -0,0 +1,6 @@
project('CaSe DePenDenCy In Wrap', 'c')
d = dependency('UP_down')
e = executable('prog', 'prog.c', dependencies: d)
test('prog', e)

@ -0,0 +1,13 @@
#include<up_down.h>
#include<stdio.h>
int main(int argc, char **argv) {
if(argc == 42) {
printf("Very sneaky, %s\n", argv[0]);
}
#ifdef UP_IS_DOWN
return 0;
#else
return 1;
#endif
}

@ -0,0 +1,5 @@
[wrap-file]
directory = up_down
[provide]
UP_down = up_down_dep

@ -0,0 +1,3 @@
project('up down', 'c')
up_down_dep = declare_dependency(include_directories: '.')
Loading…
Cancel
Save