From e3d4a78d0b904046ad1307c8f3013df699bc9f0fc6c170b018554118988bb87b Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Mon, 30 Apr 2018 09:19:08 +0000 Subject: [PATCH] Accepting request 602460 from GNOME:Next - Add meson-keep-spaces-in-pc-files.patch: Keep spaces in generated pkgconfig files (gh#mesonbuild/meson#3479). - Add meson-keep-spaces-in-pc-files.patch: Keep spaces in generated pkgconfig files (gh#mesonbuild/meson#3479). OBS-URL: https://build.opensuse.org/request/show/602460 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=96 --- meson-keep-spaces-in-pc-files.patch | 84 +++++++++++++++++++++++++++++ meson-testsuite.changes | 6 +++ meson-testsuite.spec | 7 ++- meson.changes | 6 +++ meson.spec | 9 ++-- 5 files changed, 107 insertions(+), 5 deletions(-) create mode 100644 meson-keep-spaces-in-pc-files.patch diff --git a/meson-keep-spaces-in-pc-files.patch b/meson-keep-spaces-in-pc-files.patch new file mode 100644 index 0000000..b54d936 --- /dev/null +++ b/meson-keep-spaces-in-pc-files.patch @@ -0,0 +1,84 @@ +From cbc2f2d1df769123caa2e4562dbe1809cca1304d Mon Sep 17 00:00:00 2001 +From: Jussi Pakkanen +Date: Sun, 29 Apr 2018 21:43:24 +0300 +Subject: [PATCH] Keep separator spaces in pkg-config declarations. Closes + #3479. + +--- + mesonbuild/modules/pkgconfig.py | 6 ++++-- + run_unittests.py | 11 +++++++++++ + test cases/unit/31 pkgconfig format/meson.build | 12 ++++++++++++ + test cases/unit/31 pkgconfig format/somelib.c | 5 +++++ + 4 files changed, 32 insertions(+), 2 deletions(-) + create mode 100644 test cases/unit/31 pkgconfig format/meson.build + create mode 100644 test cases/unit/31 pkgconfig format/somelib.c + +diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py +index a3ba973f3..419a14c77 100644 +--- a/mesonbuild/modules/pkgconfig.py ++++ b/mesonbuild/modules/pkgconfig.py +@@ -139,8 +139,10 @@ def add_version_reqs(self, name, version_reqs): + if version_reqs: + if name not in self.version_reqs: + self.version_reqs[name] = set() +- # We could have '>=1.0' or '>= 1.0', remove spaces to normalize +- new_vreqs = [s.replace(' ', '') for s in mesonlib.stringlistify(version_reqs)] ++ # Note that pkg-config is picky about whitespace. ++ # 'foo > 1.2' is ok but 'foo>1.2' is not. ++ # foo, bar' is ok, but 'foo,bar' is not. ++ new_vreqs = [s for s in mesonlib.stringlistify(version_reqs)] + self.version_reqs[name].update(new_vreqs) + + def split_version_req(self, s): +diff --git a/run_unittests.py b/run_unittests.py +index f06c9a0ea..ce5fe14dd 100755 +--- a/run_unittests.py ++++ b/run_unittests.py +@@ -3056,6 +3056,17 @@ def test_pkgconfig_internal_libraries(self): + self.init(os.path.join(testdirbase, 'app')) + self.build() + ++ @unittest.skipIf(shutil.which('pkg-config') is None, 'Pkg-config not found.') ++ def test_pkgconfig_formatting(self): ++ testdir = os.path.join(self.unit_test_dir, '31 pkgconfig format') ++ self.init(testdir) ++ myenv = os.environ.copy() ++ myenv['PKG_CONFIG_PATH'] = self.privatedir ++ ro = subprocess.run(['pkg-config', '--libs', 'libsomething'], stdout=subprocess.PIPE, ++ env=myenv) ++ self.assertEqual(ro.returncode, 0) ++ self.assertIn(b'-lgobject-2.0', ro.stdout) ++ self.assertIn(b'-lgio-2.0', ro.stdout) + + class LinuxArmCrossCompileTests(BasePlatformTests): + ''' +diff --git a/test cases/unit/31 pkgconfig format/meson.build b/test cases/unit/31 pkgconfig format/meson.build +new file mode 100644 +index 000000000..bb702401f +--- /dev/null ++++ b/test cases/unit/31 pkgconfig format/meson.build +@@ -0,0 +1,12 @@ ++project('pkgformat', 'c', ++ version : '1.0') ++ ++pkgg = import('pkgconfig') ++ ++l = shared_library('something', 'somelib.c') ++ ++pkgg.generate(libraries: l, ++ version: '1.0', ++ name: 'libsomething', ++ description: 'A library that does something', ++ requires: 'gobject-2.0 >= 2.54, gio-2.0 >= 2.54') +diff --git a/test cases/unit/31 pkgconfig format/somelib.c b/test cases/unit/31 pkgconfig format/somelib.c +new file mode 100644 +index 000000000..6d876c8f2 +--- /dev/null ++++ b/test cases/unit/31 pkgconfig format/somelib.c +@@ -0,0 +1,5 @@ ++#include ++ ++int some_func() { ++ return 0; ++} + diff --git a/meson-testsuite.changes b/meson-testsuite.changes index 80fdef2..041ba2b 100644 --- a/meson-testsuite.changes +++ b/meson-testsuite.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 30 07:03:53 UTC 2018 - dimstar@opensuse.org + +- Add meson-keep-spaces-in-pc-files.patch: Keep spaces in generated + pkgconfig files (gh#mesonbuild/meson#3479). + ------------------------------------------------------------------- Wed Apr 25 18:53:17 UTC 2018 - sor.alexei@meowr.ru diff --git a/meson-testsuite.spec b/meson-testsuite.spec index 5117f44..4969562 100644 --- a/meson-testsuite.spec +++ b/meson-testsuite.spec @@ -29,7 +29,7 @@ Release: 0 Summary: Python-based build system License: Apache-2.0 Group: Development/Tools/Building -Url: http://mesonbuild.com/ +URL: http://mesonbuild.com/ Source: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz Source1: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz.asc Source2: meson.keyring @@ -43,6 +43,8 @@ Patch2: meson-suse-fix-llvm-3.8.patch Patch3: meson-restore-python3.4.patch # PATCH-FIX-OPENSUSE meson-fix-gcc48.patch sor.alexei@meowr.ru -- Fix GCC 4.8 handling for openSUSE Leap 42.x. Patch4: meson-fix-gcc48.patch +# PATCH-FIX-UPSTREAM meson-keep-spaces-in-pc-files.patch gh#mesonbuild/meson#3479 dimstar@opensuse.org -- Keep spaces in generated .pc files +Patch5: meson-keep-spaces-in-pc-files.patch BuildRequires: python3 BuildArch: noarch %if %{testsuite} @@ -134,6 +136,7 @@ This package provides support for meson.build files in Vim. %patch3 -p1 %patch4 -p1 %endif +%patch5 -p1 # Remove static boost tests from test cases/frameworks/1 boost (can't use patch due to spaces in dirname) sed -i "/static/d" test\ cases/frameworks/1\ boost/meson.build @@ -187,7 +190,7 @@ python3 run_tests.py %if 0%{?suse_version} >= 1500 %license COPYING %else -%doc COPYING +%license COPYING %endif %if !%{testsuite} %{_bindir}/meson diff --git a/meson.changes b/meson.changes index 80fdef2..041ba2b 100644 --- a/meson.changes +++ b/meson.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Apr 30 07:03:53 UTC 2018 - dimstar@opensuse.org + +- Add meson-keep-spaces-in-pc-files.patch: Keep spaces in generated + pkgconfig files (gh#mesonbuild/meson#3479). + ------------------------------------------------------------------- Wed Apr 25 18:53:17 UTC 2018 - sor.alexei@meowr.ru diff --git a/meson.spec b/meson.spec index 3792033..6246212 100644 --- a/meson.spec +++ b/meson.spec @@ -1,5 +1,5 @@ # -# spec file for package meson-testsuite +# spec file for package meson # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # @@ -29,7 +29,7 @@ Release: 0 Summary: Python-based build system License: Apache-2.0 Group: Development/Tools/Building -Url: http://mesonbuild.com/ +URL: http://mesonbuild.com/ Source: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz Source1: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz.asc Source2: meson.keyring @@ -43,6 +43,8 @@ Patch2: meson-suse-fix-llvm-3.8.patch Patch3: meson-restore-python3.4.patch # PATCH-FIX-OPENSUSE meson-fix-gcc48.patch sor.alexei@meowr.ru -- Fix GCC 4.8 handling for openSUSE Leap 42.x. Patch4: meson-fix-gcc48.patch +# PATCH-FIX-UPSTREAM meson-keep-spaces-in-pc-files.patch gh#mesonbuild/meson#3479 dimstar@opensuse.org -- Keep spaces in generated .pc files +Patch5: meson-keep-spaces-in-pc-files.patch BuildRequires: python3 BuildArch: noarch %if %{testsuite} @@ -134,6 +136,7 @@ This package provides support for meson.build files in Vim. %patch3 -p1 %patch4 -p1 %endif +%patch5 -p1 # Remove static boost tests from test cases/frameworks/1 boost (can't use patch due to spaces in dirname) sed -i "/static/d" test\ cases/frameworks/1\ boost/meson.build @@ -187,7 +190,7 @@ python3 run_tests.py %if 0%{?suse_version} >= 1500 %license COPYING %else -%doc COPYING +%license COPYING %endif %if !%{testsuite} %{_bindir}/meson