File project.diff of Package meson

--- meson-fix-gcc48.patch.orig
+++ meson-fix-gcc48.patch
@@ -1,9 +1,11 @@
+Index: b/mesonbuild/compilers/cpp.py
+===================================================================
 --- a/mesonbuild/compilers/cpp.py
 +++ b/mesonbuild/compilers/cpp.py
-@@ -140,8 +140,8 @@ class ClangCPPCompiler(ClangCompiler, CP
-     def get_options(self):
-         opts = CPPCompiler.get_options(self)
-         opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
+@@ -162,8 +162,8 @@ class ClangCPPCompiler(ClangCompiler, CP
+                                                         ['none', 'default', 'a', 's', 'sc'],
+                                                         'default'),
+                      'cpp_std': coredata.UserComboOption('C++ language standard to use',
 -                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
 -                                                          'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
 +                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++1y', 'c++14', 'c++17', 'c++1z', 'c++2a',
@@ -11,10 +13,10 @@
                                                           'none')})
          return opts
  
-@@ -171,8 +171,8 @@ class ArmclangCPPCompiler(ArmclangCompil
-     def get_options(self):
-         opts = CPPCompiler.get_options(self)
-         opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
+@@ -200,8 +200,8 @@ class ArmclangCPPCompiler(ArmclangCompil
+                                                         ['none', 'default', 'a', 's', 'sc'],
+                                                         'default'),
+                      'cpp_std': coredata.UserComboOption('C++ language standard to use',
 -                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17',
 -                                                          'gnu++98', 'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17'],
 +                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++1y', 'c++14', 'c++17',
@@ -22,7 +24,7 @@
                                                           'none')})
          return opts
  
-@@ -197,10 +197,12 @@ class GnuCPPCompiler(GnuCompiler, CPPCom
+@@ -230,13 +230,15 @@ class GnuCPPCompiler(GnuCompiler, CPPCom
                            '3': default_warn_args + ['-Wextra', '-Wpedantic']}
  
      def get_options(self):
@@ -30,14 +32,17 @@
 +        if version_compare(self.version, '>=5.0.0'):
 +            cpp_stds += ['c++14', 'c++17', 'c++1z', 'c++2a', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a']
          opts = CPPCompiler.get_options(self)
-         opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
+         opts.update({'cpp_eh': coredata.UserComboOption('C++ exception handling type.',
+                                                         ['none', 'default', 'a', 's', 'sc'],
+                                                         'default'),
+                      'cpp_std': coredata.UserComboOption('C++ language standard to use',
 -                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
 -                                                          'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
 +                                                         ['none'] + cpp_stds,
                                                           'none'),
-                      'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl',
-                                                                 'STL debug mode',
-@@ -276,7 +278,7 @@ class IntelCPPCompiler(IntelCompiler, CP
+                      'cpp_debugstl': coredata.UserBooleanOption('STL debug mode',
+                                                                 False)})
+@@ -326,7 +328,7 @@ class IntelCPPCompiler(IntelGnuLikeCompi
          c_stds = ['c++98', 'c++03']
          g_stds = ['gnu++98', 'gnu++03']
          if version_compare(self.version, '>=15.0.0'):
@@ -46,6 +51,8 @@
              g_stds += ['gnu++11']
          if version_compare(self.version, '>=16.0.0'):
              c_stds += ['c++17']
+Index: b/mesonbuild/minit.py
+===================================================================
 --- a/mesonbuild/minit.py
 +++ b/mesonbuild/minit.py
 @@ -143,7 +143,7 @@ int main(int argc, char **argv) {{
@@ -75,6 +82,8 @@
      # If we get a meson.build autoformatter one day, this code could
      # be simplified quite a bit.
      formatted_default_options = ', '.join("'{}'".format(x) for x in default_options)
+Index: b/test cases/common/152 simd/simdchecker.c
+===================================================================
 --- "a/test cases/common/152 simd/simdchecker.c"
 +++ "b/test cases/common/152 simd/simdchecker.c"
 @@ -10,11 +10,12 @@ int check_simd_implementation(float *fou
@@ -91,11 +100,3 @@
          if(four[i] != expected[i]) {
              printf("Increment function failed, got %f expected %f.\n", four[i], expected[i]);
              rv = 1;
---- "a/test cases/unit/17 prebuilt shared/patron.c"
-+++ "b/test cases/unit/17 prebuilt shared/patron.c"
-@@ -5,4 +5,5 @@ int main(int argc, char **argv) {
-     printf("You are standing outside the Great Library of Alexandria.\n");
-     printf("You decide to go inside.\n\n");
-     alexandria_visit();
-+    return 0;
- }
--- meson-restore-python3.4.patch.orig
+++ meson-restore-python3.4.patch
@@ -1,15 +1,17 @@
+Index: b/mesonbuild/backend/ninjabackend.py
+===================================================================
 --- a/mesonbuild/backend/ninjabackend.py
 +++ b/mesonbuild/backend/ninjabackend.py
-@@ -32,7 +32,7 @@ from .. import compilers
- from ..compilers import CompilerArgs, CCompiler, VisualStudioCCompiler
- from ..linkers import ArLinker
- from ..mesonlib import File, MesonException, OrderedSet
+@@ -34,7 +34,7 @@ from ..linkers import ArLinker
+ from ..mesonlib import (
+     File, LibType, MachineChoice, MesonException, OrderedSet, PerMachine
+ )
 -from ..mesonlib import get_compiler_for_source, has_path_sep
 +from ..mesonlib import get_compiler_for_source, has_path_sep, commonpath
  from .backends import CleanTrees
  from ..build import InvalidArguments
  
-@@ -1025,8 +1025,8 @@ int dummy;
+@@ -1179,8 +1179,8 @@ int dummy;
                  # Check if the vala file is in a subdir of --basedir
                  abs_srcbasedir = os.path.join(self.environment.get_source_dir(), target.get_subdir())
                  abs_vala_file = os.path.join(self.environment.get_build_dir(), vala_file)
@@ -20,18 +22,20 @@
                      vala_c_file = os.path.join(str(vala_c_subdir), vala_c_file)
              else:
                  path_to_target = os.path.join(self.build_to_src, target.get_subdir())
+Index: b/mesonbuild/coredata.py
+===================================================================
 --- a/mesonbuild/coredata.py
 +++ b/mesonbuild/coredata.py
-@@ -18,7 +18,7 @@ import sys
- from pathlib import PurePath
+@@ -20,7 +20,7 @@ from pathlib import PurePath
  from collections import OrderedDict
  from .mesonlib import (
--    MesonException, default_libdir, default_libexecdir, default_prefix
-+    MesonException, default_libdir, default_libexecdir, default_prefix, commonpath
+     MesonException, MachineChoice, PerMachine,
+-    default_libdir, default_libexecdir, default_prefix
++    default_libdir, default_libexecdir, default_prefix, commonpath
  )
  from .wrap import WrapMode
  import ast
-@@ -379,7 +379,7 @@ class CoreData:
+@@ -443,7 +443,7 @@ class CoreData:
              # commonpath will always return a path in the native format, so we
              # must use pathlib.PurePath to do the same conversion before
              # comparing.
@@ -40,9 +44,11 @@
                  m = 'The value of the {!r} option is {!r} which must be a ' \
                      'subdir of the prefix {!r}.\nNote that if you pass a ' \
                      'relative path, it is assumed to be a subdir of prefix.'
+Index: b/mesonbuild/interpreterbase.py
+===================================================================
 --- a/mesonbuild/interpreterbase.py
 +++ b/mesonbuild/interpreterbase.py
-@@ -617,7 +617,9 @@ The result of this is undefined and will
+@@ -633,7 +633,9 @@ The result of this is undefined and will
  
          if cur.operation == 'add':
              if isinstance(l, dict) and isinstance(r, dict):
@@ -53,7 +59,7 @@
              try:
                  return l + r
              except Exception as e:
-@@ -718,7 +720,8 @@ The result of this is undefined and will
+@@ -728,7 +730,8 @@ The result of this is undefined and will
          elif isinstance(old_variable, dict):
              if not isinstance(addition, dict):
                  raise InvalidArguments('The += operator requires a dict on the right hand side if the variable on the left is a dict')
@@ -63,6 +69,8 @@
          # Add other data types here.
          else:
              raise InvalidArguments('The += operator currently only works with arrays, dicts, strings or ints ')
+Index: b/mesonbuild/mesonlib.py
+===================================================================
 --- a/mesonbuild/mesonlib.py
 +++ b/mesonbuild/mesonlib.py
 @@ -20,6 +20,7 @@ import stat
@@ -72,8 +80,8 @@
 +import collections.abc
  from enum import Enum
  from functools import lru_cache
- 
-@@ -1149,6 +1150,30 @@ def substring_is_in_list(substr, strlist
+ import typing
+@@ -1224,6 +1225,30 @@ def substring_is_in_list(substr: str, st
              return True
      return False
  
@@ -104,10 +112,12 @@
  class OrderedSet(collections.abc.MutableSet):
      """A set that preserves the order in which items are added, by first
      insertion.
+Index: b/mesonbuild/mesonmain.py
+===================================================================
 --- a/mesonbuild/mesonmain.py
 +++ b/mesonbuild/mesonmain.py
-@@ -149,8 +149,8 @@ def run_script_command(script_name, scri
-         return 1
+@@ -176,8 +176,8 @@ def ensure_stdout_accepts_unicode():
+                 sys.stdout.buffer = sys.stdout.raw if hasattr(sys.stdout, 'raw') else sys.stdout
  
  def run(original_args, mainfile):
 -    if sys.version_info < (3, 5):
@@ -117,9 +127,11 @@
          print('You have python %s.' % sys.version)
          print('Please update your environment')
          return 1
+Index: b/mesonbuild/minstall.py
+===================================================================
 --- a/mesonbuild/minstall.py
 +++ b/mesonbuild/minstall.py
-@@ -348,8 +348,8 @@ class Installer:
+@@ -352,8 +352,8 @@ class Installer:
              if shutil.which('pkexec') is not None and 'PKEXEC_UID' not in os.environ:
                  print('Installation failed due to insufficient permissions.')
                  print('Attempting to use polkit to gain elevated privileges...')
@@ -130,9 +142,11 @@
              else:
                  raise
  
+Index: b/mesonbuild/modules/python.py
+===================================================================
 --- a/mesonbuild/modules/python.py
 +++ b/mesonbuild/modules/python.py
-@@ -516,7 +516,7 @@ class PythonModule(ExtensionModule):
+@@ -569,7 +569,7 @@ class PythonModule(ExtensionModule):
              # Sanity check, we expect to have something that at least quacks in tune
              try:
                  info = json.loads(run_command(python, INTROSPECT_COMMAND))
@@ -141,9 +155,11 @@
                  info = None
  
              if isinstance(info, dict) and 'version' in info and self._check_version(name_or_path, info['version']):
+Index: b/mesonbuild/mtest.py
+===================================================================
 --- a/mesonbuild/mtest.py
 +++ b/mesonbuild/mtest.py
-@@ -114,7 +114,12 @@ def returncode_to_status(retcode):
+@@ -131,7 +131,12 @@ def returncode_to_status(retcode: int) -
      if retcode < 0:
          signum = -retcode
          try:
@@ -157,7 +173,7 @@
          except ValueError:
              signame = 'SIGinvalid'
          return '(killed by signal %d %s)' % (signum, signame)
-@@ -124,7 +129,12 @@ def returncode_to_status(retcode):
+@@ -141,7 +146,12 @@ def returncode_to_status(retcode: int) -
  
      signum = retcode - 128
      try:
@@ -171,6 +187,8 @@
      except ValueError:
          signame = 'SIGinvalid'
      return '(exit status %d or signal %d %s)' % (retcode, signum, signame)
+Index: b/mesonbuild/scripts/gtkdochelper.py
+===================================================================
 --- a/mesonbuild/scripts/gtkdochelper.py
 +++ b/mesonbuild/scripts/gtkdochelper.py
 @@ -17,7 +17,7 @@ import subprocess
@@ -191,6 +209,8 @@
              continue
          shutil.copyfile(f, os.path.join(abs_out, os.path.basename(f)))
  
+Index: b/run_meson_command_tests.py
+===================================================================
 --- a/run_meson_command_tests.py
 +++ b/run_meson_command_tests.py
 @@ -19,6 +19,7 @@ import os
@@ -220,11 +240,13 @@
          print(p.stdout)
          if p.returncode != 0:
              raise subprocess.CalledProcessError(p.returncode, command)
+Index: b/run_unittests.py
+===================================================================
 --- a/run_unittests.py
 +++ b/run_unittests.py
-@@ -956,6 +956,24 @@ class DataTests(unittest.TestCase):
-             defined = set([a.strip() for a in res.group().split('\\')][1:])
-             self.assertEqual(defined, set(chain(interp.funcs.keys(), interp.builtin.keys())))
+@@ -1000,6 +1000,24 @@ class InternalTests(unittest.TestCase):
+         self.assertTrue(vctools_ver.startswith(toolset_ver),
+                         msg='{!r} does not start with {!r}'.format(vctools_ver, toolset_ver))
  
 +    def test_commonpath(self):
 +        from os.path import sep
@@ -245,9 +267,9 @@
 +        self.assertEqual(commonpath([prefix, libdir]), str(PurePath(prefix)))
 +
  
- class BasePlatformTests(unittest.TestCase):
-     def setUp(self):
-@@ -1036,9 +1054,15 @@ class BasePlatformTests(unittest.TestCas
+ @unittest.skipIf(is_tarball(), 'Skipping because this is a tarball release')
+ class DataTests(unittest.TestCase):
+@@ -1224,9 +1242,15 @@ class BasePlatformTests(unittest.TestCas
          # If this call hangs CI will just abort. It is very hard to distinguish
          # between CI issue and test bug in that case. Set timeout and fail loud
          # instead.
@@ -266,7 +288,7 @@
          print(p.stdout)
          if p.returncode != 0:
              if 'MESON_SKIP_TEST' in p.stdout:
-@@ -2849,17 +2873,23 @@ recommended as it is not supported on so
+@@ -3130,17 +3154,23 @@ recommended as it is not supported on so
                  of = open(mfile, 'w')
                  of.write("project('foobar', 'c')\n")
                  of.close()
@@ -299,7 +321,7 @@
  
      def get_opts_as_dict(self):
          result = {}
-@@ -4671,13 +4701,14 @@ class NativeFileTests(BasePlatformTests)
+@@ -5773,10 +5803,12 @@ class NativeFileTests(BasePlatformTests)
                  f.write('        print("{}", file=sys.{})\n'.format(value, kwargs.get('outfile', 'stdout')))
                  f.write('        sys.exit(0)\n')
              f.write(textwrap.dedent('''
@@ -307,17 +329,15 @@
 +                    ret = subprocess.Popen(
                          ["{}"] + extra_args,
                          stdout=subprocess.PIPE,
-                         stderr=subprocess.PIPE,
--                        encoding='utf-8')
--                    print(ret.stdout)
--                    print(ret.stderr, file=sys.stderr)
+-                        stderr=subprocess.PIPE)
++                        stderr=subprocess.PIPE,
 +                        universal_newlines=True)
 +                    stdout, stderr = ret.communicate()
-+                    print(stdout)
-+                    print(stderr, file=sys.stderr)
+                     print(ret.stdout.decode('utf-8'))
+                     print(ret.stderr.decode('utf-8'), file=sys.stderr)
                      sys.exit(ret.returncode)
- 
-                 if __name__ == '__main__':
+Index: b/setup.py
+===================================================================
 --- a/setup.py
 +++ b/setup.py
 @@ -16,9 +16,9 @@
@@ -332,6 +352,32 @@
      sys.exit(1)
  
  from mesonbuild.coredata import version
+Index: b/mesonbuild/mlog.py
+===================================================================
+--- a/mesonbuild/mlog.py
++++ b/mesonbuild/mlog.py
+@@ -213,13 +213,16 @@ def _log_error(severity: str, *rargs: Un
+         raise MesonException("Fatal warnings enabled, aborting")
+ 
+ def error(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
+-    return _log_error('error', *args, **kwargs, is_error=True)
++    kwargs['is_error'] = True
++    return _log_error('error', *args, **kwargs)
+ 
+ def warning(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
+-    return _log_error('warning', *args, **kwargs, is_error=True)
++    kwargs['is_error'] = True
++    return _log_error('warning', *args, **kwargs)
+ 
+ def deprecation(*args: Union[str, AnsiDecorator], **kwargs: Any) -> None:
+-    return _log_error('deprecation', *args, **kwargs, is_error=True)
++    kwargs['is_error'] = True
++    return _log_error('deprecation', *args, **kwargs)
+ 
+ def exception(e: Exception, prefix: Optional[AnsiDecorator] = None) -> None:
+     if prefix is None:
+Index: b/test cases/common/188 find override/subdir/converter.py
+===================================================================
 --- "a/test cases/common/188 find override/subdir/converter.py"
 +++ "b/test cases/common/188 find override/subdir/converter.py"
 @@ -10,6 +10,7 @@ ftempl = '''int %s() {
@@ -345,6 +391,8 @@
 +    d = f.readline().strip()
 +with pathlib.Path(ofilename).open('w') as f:
 +    f.write(ftempl % d)
+Index: b/test cases/common/188 find override/subdir/gencodegen.py.in
+===================================================================
 --- "a/test cases/common/188 find override/subdir/gencodegen.py.in"
 +++ "b/test cases/common/188 find override/subdir/gencodegen.py.in"
 @@ -10,6 +10,7 @@ ftempl = '''int %s() {
@@ -358,6 +406,8 @@
 +    d = f.readline().strip()
 +with pathlib.Path(ofilename).open('w') as f:
 +    f.write(ftempl % d)
+Index: b/test cases/unit/35 dist script/replacer.py
+===================================================================
 --- "a/test cases/unit/35 dist script/replacer.py"
 +++ "b/test cases/unit/35 dist script/replacer.py"
 @@ -11,6 +11,8 @@ source_root = pathlib.Path(os.environ['M
@@ -371,6 +421,8 @@
 -modfile.write_text(contents)
 +with modfile.open('w') as f:
 +    f.write(contents)
+Index: b/test cases/unit/46 native dep pkgconfig var/cross_pkgconfig.py
+===================================================================
 --- "a/test cases/unit/46 native dep pkgconfig var/cross_pkgconfig.py"
 +++ "b/test cases/unit/46 native dep pkgconfig var/cross_pkgconfig.py"
 @@ -9,4 +9,4 @@ environ['PKG_CONFIG_LIBDIR'] = os.path.j
@@ -379,6 +431,8 @@
  sys.exit(
 -    subprocess.run(['pkg-config'] + sys.argv[1:], env=environ).returncode)
 +    subprocess.call(['pkg-config'] + sys.argv[1:], env=environ))
+Index: b/test cases/windows/13 test argument extra paths/test/test_run_exe.py
+===================================================================
 --- "a/test cases/windows/13 test argument extra paths/test/test_run_exe.py"
 +++ "b/test cases/windows/13 test argument extra paths/test/test_run_exe.py"
 @@ -7,6 +7,6 @@ if __name__ == '__main__':
--- meson-suse-fix-llvm-3.8.patch.orig
+++ meson-suse-fix-llvm-3.8.patch
@@ -1,6 +1,8 @@
+Index: b/mesonbuild/dependencies/dev.py
+===================================================================
 --- a/mesonbuild/dependencies/dev.py
 +++ b/mesonbuild/dependencies/dev.py
-@@ -343,10 +343,11 @@ class LLVMDependency(ConfigToolDependenc
+@@ -360,10 +360,11 @@ class LLVMDependencyConfigTool(ConfigToo
          not for shared-linnking, we have to figure those out ourselves, because
          of course we do.
          """
@@ -16,7 +18,7 @@
          else:
              # llvm-config will provide arguments for static linking, so we get
              # to figure out for ourselves what to link with. We'll do that by
-@@ -365,6 +366,7 @@ class LLVMDependency(ConfigToolDependenc
+@@ -382,6 +383,7 @@ class LLVMDependencyConfigTool(ConfigToo
              else:
                  raise DependencyException(
                      'Could not find a dynamically linkable library for LLVM.')
@@ -24,10 +26,12 @@
  
      def check_components(self, modules, required=True):
          """Check for llvm components (modules in meson terms).
+Index: b/run_unittests.py
+===================================================================
 --- a/run_unittests.py
 +++ b/run_unittests.py
-@@ -4771,6 +4771,11 @@ class NativeFileTests(BasePlatformTests)
-         # Do the skip at this level to avoid screwing up the cache
+@@ -5877,6 +5877,11 @@ class NativeFileTests(BasePlatformTests)
+             raise unittest.SkipTest('Skipped due to problems with LLVM on MSYS2')
          if not shutil.which('llvm-config'):
              raise unittest.SkipTest('No llvm-installed, cannot test')
 +
--- meson.spec.orig
+++ meson.spec
@@ -53,6 +53,9 @@ Patch5:         meson-distutils.patch
 Patch6:         meson-testsuite-boost.patch
 # PATCH-FIX-UPSTREAM meson-6614.patch dimstar@opensuse.org -- cmake: Fix crash when no C++ compiler is not installed
 Patch7:         meson-6614.patch
+
+Patch99:        meson-fix-rpm-macros.patch
+
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildRequires:  python3-base
@@ -61,6 +64,9 @@ BuildArch:      noarch
 BuildRequires:  python3-setuptools
 Requires:       python3-setuptools
 %endif
+%if 0%{?suse_version} < 1500
+BuildRequires:  python3-typing
+%endif
 %if !%{with test}
 Requires:       ninja
 Requires:       python3-base
@@ -178,6 +184,8 @@ This package provides support for meson.
 )
 %patch7 -p1
 
+%patch99 -p1
+
 # Remove static boost tests from "test cases/frameworks/1 boost/".
 sed -i "/static/d" test\ cases/frameworks/1\ boost/meson.build
 
openSUSE Build Service is sponsored by