From a661708b54d5c6f9aa280663a85ab15ed06f40ce Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 14 Jun 2016 01:03:43 +0100 Subject: [PATCH 1/2] Use target name to decide generated Vala .h & .vapi filenames Previously Meson would use the name of the first .vala source file. This doesn't work for some projects. Tracker is one example: it has several libraries that mix Vala and C code. In such cases, none of the .vala files tend to bear the name of the library we actually want to generate. --- mesonbuild/backend/ninjabackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index b3f3f172c..9ceee3227 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -772,7 +772,7 @@ int dummy; if hasattr(i, 'fname'): i = i.fname if i.endswith('vala'): - vapiname = os.path.splitext(os.path.split(i)[1])[0] + '.vapi' + vapiname = dep.name + '.vapi' fullname = os.path.join(self.get_target_dir(dep), vapiname) result.append(fullname) break @@ -790,7 +790,7 @@ int dummy; vala_input_files.append(s.rel_to_builddir(self.build_to_src)) if len(src) == 0: raise InvalidArguments('Vala library has no Vala source files.') - namebase = os.path.splitext(os.path.split(src[0].fname)[1])[0] + namebase = target.name base_h = namebase + '.h' base_vapi = namebase + '.vapi' hname = os.path.normpath(os.path.join(self.get_target_dir(target), base_h)) From c76837a3d7343908e8980dcf2f8f4cb21a013be3 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 15 Jun 2016 15:16:11 +0100 Subject: [PATCH 2/2] Add myself to authors.txt --- authors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/authors.txt b/authors.txt index eadd2ff51..08c046d4d 100644 --- a/authors.txt +++ b/authors.txt @@ -35,3 +35,4 @@ Rogiel Sulzbach Tim-Philipp Müller Emmanuele Bassi Martin Hostettler +Sam Thursfield