From 6389e70c11c939d7c2e927086ea615ad83d6b0dd Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Mon, 5 Dec 2016 11:22:11 -0500 Subject: [PATCH 1/2] pkgconfig: 'Version' must be specified, even if it's empty --- mesonbuild/modules/pkgconfig.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 9f50b0eb8..c2dea33d2 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -54,8 +54,7 @@ class PkgConfigModule: ofile.write('Description: %s\n' % description) if len(url) > 0: ofile.write('URL: %s\n' % url) - if len(version) > 0: - ofile.write('Version: %s\n' % version) + ofile.write('Version: %s\n' % version) if len(pub_reqs) > 0: ofile.write('Requires: {}\n'.format(' '.join(pub_reqs))) if len(priv_reqs) > 0: From ff55e848f6e53e713c923b9e4a79668ae3ad20c5 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Mon, 5 Dec 2016 22:46:32 -0500 Subject: [PATCH 2/2] pkgconfig: Raise an error if 'version' is not specified --- mesonbuild/modules/pkgconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index c2dea33d2..216cd0344 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -110,9 +110,9 @@ class PkgConfigModule: libs = self.process_libs(kwargs.get('libraries', [])) priv_libs = self.process_libs(kwargs.get('libraries_private', [])) subdirs = mesonlib.stringlistify(kwargs.get('subdirs', ['.'])) - version = kwargs.get('version', '') + version = kwargs.get('version', None) if not isinstance(version, str): - raise mesonlib.MesonException('Version must be a string.') + raise mesonlib.MesonException('Version must be specified.') name = kwargs.get('name', None) if not isinstance(name, str): raise mesonlib.MesonException('Name not specified.')