From a7455c0f7111d5211303f1c11ec72c2e5b67b6162da6f3a61f2dacdcd254e03c Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Thu, 14 May 2020 11:50:37 +0000 Subject: [PATCH] Accepting request 805547 from home:dimstar:Factory - Add meson-gcc10.patch: Fix test suite when using gcc 10. OBS-URL: https://build.opensuse.org/request/show/805547 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=169 --- meson-gcc10.patch | 36 ++++++++++++++++++++++++++++++++++++ meson.changes | 5 +++++ meson.spec | 3 +++ 3 files changed, 44 insertions(+) create mode 100644 meson-gcc10.patch diff --git a/meson-gcc10.patch b/meson-gcc10.patch new file mode 100644 index 0000000..00801b4 --- /dev/null +++ b/meson-gcc10.patch @@ -0,0 +1,36 @@ +From 92102a911d3af9c69d33a386cc32f150bc14ba18 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan +Date: Thu, 14 May 2020 09:41:12 +0530 +Subject: [PATCH] gfortran: Fix has_header implementation with GCC 10 + +__has_include is not accepted as a pre-processor directive in Fortran +code since GCC 10. + +Closes https://github.com/mesonbuild/meson/issues/7017 +--- + mesonbuild/compilers/fortran.py | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +Index: meson-0.54.1/mesonbuild/compilers/fortran.py +=================================================================== +--- meson-0.54.1.orig/mesonbuild/compilers/fortran.py ++++ meson-0.54.1/mesonbuild/compilers/fortran.py +@@ -208,6 +208,18 @@ class GnuFortranCompiler(GnuCompiler, Fo + def language_stdlib_only_link_flags(self): + return ['-lgfortran', '-lm'] + ++ def has_header(self, hname, prefix, env, *, extra_args=None, dependencies=None, disable_cache=False): ++ ''' ++ Derived from mixins/clike.py:has_header, but without C-style usage of ++ __has_include which breaks with GCC-Fortran 10: ++ https://github.com/mesonbuild/meson/issues/7017 ++ ''' ++ fargs = {'prefix': prefix, 'header': hname} ++ code = '{prefix}\n#include <{header}>' ++ return self.compiles(code.format(**fargs), env, extra_args=extra_args, ++ dependencies=dependencies, mode='preprocess', disable_cache=disable_cache) ++ ++ + class ElbrusFortranCompiler(GnuFortranCompiler, ElbrusCompiler): + def __init__(self, exelist, version, for_machine: MachineChoice, + is_cross, info: 'MachineInfo', exe_wrapper=None, diff --git a/meson.changes b/meson.changes index 9f299ad..1c600c5 100644 --- a/meson.changes +++ b/meson.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 14 07:32:14 UTC 2020 - Dominique Leuenberger + +- Add meson-gcc10.patch: Fix test suite when using gcc 10. + ------------------------------------------------------------------- Wed May 13 16:58:09 UTC 2020 - Michael Gorse diff --git a/meson.spec b/meson.spec index 4ef7b7c..0028238 100644 --- a/meson.spec +++ b/meson.spec @@ -49,6 +49,8 @@ Patch3: meson-suse-fix-llvm-3.8.patch Patch4: meson-fix-gcc48.patch # PATCH-FEATURE-OPENSUSE meson-distutils.patch tchvatal@suse.com -- build and install using distutils instead of full setuptools Patch5: meson-distutils.patch +# PATCH-FIX-UPSTREAM dimstar@opensuse.org -- Fix test suite with GCC 10 +Patch6: meson-gcc10.patch BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-base @@ -171,6 +173,7 @@ This package provides support for meson.build files in Vim. %if !%{with setuptools} %patch5 -p1 %endif +%patch6 -p1 # We do not have gmock available at this moment - can't run the test suite for it rm -r "test cases/frameworks/3 gmock" \