From d715e30e897f9fca5716dcb7b0a8a07ca3496d17 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Jul 25 2018 15:39:13 +0000 Subject: Backport more patches for "feature" option type Signed-off-by: Igor Gnatenko --- diff --git a/0001-rpm-use-set_build_flags-skip-ci.patch b/0001-rpm-use-set_build_flags-skip-ci.patch index 53caa39..c210afe 100644 --- a/0001-rpm-use-set_build_flags-skip-ci.patch +++ b/0001-rpm-use-set_build_flags-skip-ci.patch @@ -1,11 +1,12 @@ -From 4750aba45d940feef0aa29fb2258fe69f161fb65 Mon Sep 17 00:00:00 2001 +From 48e8347b4755800287aa653a4d08b89d86bfda52 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Jul 2018 19:25:30 +0200 -Subject: [PATCH 1/4] rpm: use %set_build_flags [skip ci] +Subject: [PATCH 1/5] rpm: use %set_build_flags [skip ci] It has better name and should do the trick. Signed-off-by: Igor Gnatenko +(cherry picked from commit 99070beec4a6b1ded499405025104483534f97e4) --- data/macros.meson | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/0002-rpm-use-shrink-skip-ci.patch b/0002-rpm-use-shrink-skip-ci.patch index a7fde7b..2405e55 100644 --- a/0002-rpm-use-shrink-skip-ci.patch +++ b/0002-rpm-use-shrink-skip-ci.patch @@ -1,7 +1,7 @@ -From 448479e7d6822217e2c363f65911613bf026fbd9 Mon Sep 17 00:00:00 2001 +From 07ed6359314c2e891c856bd0dd60e228d1e99238 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Jul 2018 19:29:19 +0200 -Subject: [PATCH 2/4] =?UTF-8?q?rpm:=20use=20%{shrink=E2=80=A6}=20[skip=20c?= +Subject: [PATCH 2/5] =?UTF-8?q?rpm:=20use=20%{shrink=E2=80=A6}=20[skip=20c?= =?UTF-8?q?i]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -10,6 +10,7 @@ Content-Transfer-Encoding: 8bit Make logs look better! Signed-off-by: Igor Gnatenko +(cherry picked from commit 88d1b8f9e7b6ff6adc4103e489f09a96e5a99743) --- data/macros.meson | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/0003-rpm-pass-auto-features-enabled-skip-ci.patch b/0003-rpm-pass-auto-features-enabled-skip-ci.patch index d29b669..91c5eaf 100644 --- a/0003-rpm-pass-auto-features-enabled-skip-ci.patch +++ b/0003-rpm-pass-auto-features-enabled-skip-ci.patch @@ -1,11 +1,12 @@ -From e6a4aeab0f70b0149fd4021ed875f4a60e1c5c64 Mon Sep 17 00:00:00 2001 +From 5791529fdfce3e962a2d857c807e082e051c4e1d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Mon, 23 Jul 2018 19:24:33 +0200 -Subject: [PATCH 3/4] rpm: pass --auto-features=enabled [skip ci] +Subject: [PATCH 3/5] rpm: pass --auto-features=enabled [skip ci] We really want to be explicit. Signed-off-by: Igor Gnatenko +(cherry picked from commit 1515fca2d9d4dcc8c9c98689421e69517444c05e) --- data/macros.meson | 2 ++ 1 file changed, 2 insertions(+) diff --git a/0004-Add-a-feature-new-entry-for-UserFeatureOption.patch b/0004-Add-a-feature-new-entry-for-UserFeatureOption.patch new file mode 100644 index 0000000..bcc48f9 --- /dev/null +++ b/0004-Add-a-feature-new-entry-for-UserFeatureOption.patch @@ -0,0 +1,71 @@ +From 7d25a2d488f56876988ed6cb648f4d65a7ef5ce1 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Wed, 25 Jul 2018 18:33:53 +0530 +Subject: [PATCH 4/5] Add a feature-new entry for UserFeatureOption + +Since we can't detect it in meson_options.txt, detect it when the +option is used. + +(cherry picked from commit 0ea21d7aea28c56f37fc37bda31031a6ecb5d6ae) +--- + mesonbuild/interpreter.py | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py +index 833e982e..29686f4e 100644 +--- a/mesonbuild/interpreter.py ++++ b/mesonbuild/interpreter.py +@@ -92,12 +92,13 @@ class FeatureOptionHolder(InterpreterObject, ObjectHolder): + def auto_method(self, args, kwargs): + return self.held_object.is_auto() + +-def extract_required_kwarg(kwargs): ++def extract_required_kwarg(kwargs, subproject): + val = kwargs.get('required', True) + disabled = False + required = False + feature = None + if isinstance(val, FeatureOptionHolder): ++ FeatureNew('User option "feature"', '0.47.0').use(subproject) + option = val.held_object + feature = val.name + if option.is_disabled(): +@@ -1412,7 +1413,7 @@ class CompilerHolder(InterpreterObject): + if not isinstance(libname, str): + raise InterpreterException('Library name not a string.') + +- disabled, required, feature = extract_required_kwarg(kwargs) ++ disabled, required, feature = extract_required_kwarg(kwargs, self.subproject) + if disabled: + mlog.log('Library', mlog.bold(libname), 'skipped: feature', mlog.bold(feature), 'disabled') + lib = dependencies.ExternalLibrary(libname, None, +@@ -2458,7 +2459,7 @@ external dependencies (including libraries) must go to "dependencies".''') + @permittedKwargs(permitted_kwargs['add_languages']) + @stringArgs + def func_add_languages(self, node, args, kwargs): +- disabled, required, feature = extract_required_kwarg(kwargs) ++ disabled, required, feature = extract_required_kwarg(kwargs, self.subproject) + if disabled: + for lang in sorted(args, key=compilers.sort_clink): + mlog.log('Compiler for language', mlog.bold(lang), 'skipped: feature', mlog.bold(feature), 'disabled') +@@ -2719,7 +2720,7 @@ external dependencies (including libraries) must go to "dependencies".''') + if not args: + raise InterpreterException('No program name specified.') + +- disabled, required, feature = extract_required_kwarg(kwargs) ++ disabled, required, feature = extract_required_kwarg(kwargs, self.subproject) + if disabled: + mlog.log('Program', mlog.bold(' '.join(args)), 'skipped: feature', mlog.bold(feature), 'disabled') + return ExternalProgramHolder(dependencies.NonExistingExternalProgram()) +@@ -2834,7 +2835,7 @@ external dependencies (including libraries) must go to "dependencies".''') + name = args[0] + display_name = name if name else '(anonymous)' + +- disabled, required, feature = extract_required_kwarg(kwargs) ++ disabled, required, feature = extract_required_kwarg(kwargs, self.subproject) + if disabled: + mlog.log('Dependency', mlog.bold(display_name), 'skipped: feature', mlog.bold(feature), 'disabled') + return DependencyHolder(NotFoundDependency(self.environment), self.subproject) +-- +2.18.0 + diff --git a/0004-rpm-set-auto-features-auto.patch b/0004-rpm-set-auto-features-auto.patch deleted file mode 100644 index 5cf9c80..0000000 --- a/0004-rpm-set-auto-features-auto.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d6b119dd63869631ccb4c72e002406a65a5060d5 Mon Sep 17 00:00:00 2001 -From: Igor Gnatenko -Date: Tue, 24 Jul 2018 15:55:14 +0200 -Subject: [PATCH 4/4] rpm: set --auto-features=auto - -Signed-off-by: Igor Gnatenko ---- - data/macros.meson | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/data/macros.meson b/data/macros.meson -index 4a8a3ca4..39ceca23 100644 ---- a/data/macros.meson -+++ b/data/macros.meson -@@ -1,6 +1,6 @@ - %__meson %{_bindir}/meson - %__meson_wrap_mode nodownload --%__meson_auto_features enabled -+%__meson_auto_features auto - - %meson \ - %set_build_flags \ --- -2.18.0 - diff --git a/0005-UserFeatureOption-Default-to-auto-when-no-value-spec.patch b/0005-UserFeatureOption-Default-to-auto-when-no-value-spec.patch new file mode 100644 index 0000000..28013d9 --- /dev/null +++ b/0005-UserFeatureOption-Default-to-auto-when-no-value-spec.patch @@ -0,0 +1,29 @@ +From 57382aad45504627649e6412fea62249e65b533e Mon Sep 17 00:00:00 2001 +From: Xavier Claessens +Date: Wed, 25 Jul 2018 09:54:48 -0400 +Subject: [PATCH 5/5] UserFeatureOption: Default to 'auto' when no value + specified + +Closes #3938. + +(cherry picked from commit 5f9fda4accc0b1cf6952877533c04995d701e499) +--- + mesonbuild/optinterpreter.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mesonbuild/optinterpreter.py b/mesonbuild/optinterpreter.py +index 94efbcf9..8967a53b 100644 +--- a/mesonbuild/optinterpreter.py ++++ b/mesonbuild/optinterpreter.py +@@ -121,7 +121,7 @@ def string_array_parser(name, description, kwargs): + def FeatureParser(name, description, kwargs): + return coredata.UserFeatureOption(name, + description, +- kwargs.get('value', 'enabled'), ++ kwargs.get('value', 'auto'), + yielding=kwargs.get('yield', coredata.default_yielding)) + + option_types = {'string': StringParser, +-- +2.18.0 + diff --git a/meson.spec b/meson.spec index bca6a1b..b7a62c3 100644 --- a/meson.spec +++ b/meson.spec @@ -4,20 +4,18 @@ Name: meson Version: 0.47.1 -Release: 4%{?dist} +Release: 5%{?dist} Summary: High productivity build system License: ASL 2.0 URL: http://mesonbuild.com/ Source0: https://github.com/mesonbuild/meson/archive/%{version}/%{name}-%{version}.tar.gz -# https://github.com/mesonbuild/meson/pull/3930 Patch0001: 0001-rpm-use-set_build_flags-skip-ci.patch Patch0002: 0002-rpm-use-shrink-skip-ci.patch Patch0003: 0003-rpm-pass-auto-features-enabled-skip-ci.patch -# We do not want this yet -# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/SVURE6JRDBTFKHJAPFBYRZ62JQ56OLEG/ -Patch0004: 0004-rpm-set-auto-features-auto.patch +Patch0004: 0004-Add-a-feature-new-entry-for-UserFeatureOption.patch +Patch0005: 0005-UserFeatureOption-Default-to-auto-when-no-value-spec.patch BuildArch: noarch Obsoletes: %{name}-gui < 0.31.0-3 @@ -124,6 +122,9 @@ export MESON_PRINT_TEST_OUTPUT=1 %{_datadir}/polkit-1/actions/com.mesonbuild.install.policy %changelog +* Wed Jul 25 2018 Igor Gnatenko - 0.47.1-5 +- Backport more patches for "feature" option type + * Tue Jul 24 2018 Igor Gnatenko - 0.47.1-4 - Don't sneak auto-features patch yet