diff options
author | Olivier CrĂȘte <olivier.crete@collabora.com> | 2024-10-02 19:36:16 -0400 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2024-10-04 07:53:31 +0530 |
commit | 913d6c8538a8c40ae46a4d96de45d0a6b2f0e60a (patch) | |
tree | c6a3c5192e29460cae8a3a932cc000744eed5529 | |
parent | 40ea086d47c6046d469b4926597142fbd607a116 (diff) |
gobject-introspection: Import patch to build against newer setuptools
Import the patch from the 1.82 version, this is required to build
it inside Fedora 40.
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1580>
-rw-r--r-- | recipes/gobject-introspection.recipe | 3 | ||||
-rw-r--r-- | recipes/gobject-introspection/0001-giscanner-remove-dependency-on-distutils.msvccompile.patch | 101 |
2 files changed, 103 insertions, 1 deletions
diff --git a/recipes/gobject-introspection.recipe b/recipes/gobject-introspection.recipe index 7e6b9bbe..ac9758cc 100644 --- a/recipes/gobject-introspection.recipe +++ b/recipes/gobject-introspection.recipe @@ -16,7 +16,8 @@ class Recipe(recipe.Recipe): patches = [ # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/448 f'{name}/0001-giscanner-Allow-passing-full-paths-to-libraries-with.patch', - f'{name}/0002-dumper-Fix-introspection-binaries-missing-rpaths-for.patch' + f'{name}/0002-dumper-Fix-introspection-binaries-missing-rpaths-for.patch', + f'{name}/0001-giscanner-remove-dependency-on-distutils.msvccompile.patch', ] files_bins = ['g-ir-annotation-tool', 'g-ir-compiler', 'g-ir-doc-tool', 'g-ir-generate', 'g-ir-scanner'] diff --git a/recipes/gobject-introspection/0001-giscanner-remove-dependency-on-distutils.msvccompile.patch b/recipes/gobject-introspection/0001-giscanner-remove-dependency-on-distutils.msvccompile.patch new file mode 100644 index 00000000..5f44aa33 --- /dev/null +++ b/recipes/gobject-introspection/0001-giscanner-remove-dependency-on-distutils.msvccompile.patch @@ -0,0 +1,101 @@ +From a2139dba59eac283a7f543ed737f038deebddc19 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter <reiter.christoph@gmail.com> +Date: Wed, 28 Aug 2024 21:26:02 +0200 +Subject: [PATCH] giscanner: remove dependency on distutils.msvccompiler + +It was removed with setuptools 74.0.0. Since we still depend on the +MSVCCompiler class use new_compiler() to get it some other way. + +Remove any reference to MSVC9Compiler, which was for Visual Studio 2008 +which we no longer support anyway. + +Fixes #515 +--- + giscanner/ccompiler.py | 7 +++---- + giscanner/msvccompiler.py | 14 +++++++------- + 2 files changed, 10 insertions(+), 11 deletions(-) + +diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py +index d0ed70a3..9a732cd5 100644 +--- a/giscanner/ccompiler.py ++++ b/giscanner/ccompiler.py +@@ -26,7 +26,6 @@ import tempfile + import sys + import distutils + +-from distutils.msvccompiler import MSVCCompiler + from distutils.unixccompiler import UnixCCompiler + from distutils.cygwinccompiler import Mingw32CCompiler + from distutils.sysconfig import get_config_vars +@@ -167,7 +166,7 @@ class CCompiler(object): + # Now, create the distutils ccompiler instance based on the info we have. + if compiler_name == 'msvc': + # For MSVC, we need to create a instance of a subclass of distutil's +- # MSVC9Compiler class, as it does not provide a preprocess() ++ # MSVCCompiler class, as it does not provide a preprocess() + # implementation + from . import msvccompiler + self.compiler = msvccompiler.get_msvc_compiler() +@@ -460,7 +459,7 @@ class CCompiler(object): + return self.compiler.linker_exe + + def check_is_msvc(self): +- return isinstance(self.compiler, MSVCCompiler) ++ return self.compiler.compiler_type == "msvc" + + # Private APIs + def _set_cpp_options(self, options): +@@ -486,7 +485,7 @@ class CCompiler(object): + # macros for compiling using distutils + # get dropped for MSVC builds, so + # escape the escape character. +- if isinstance(self.compiler, MSVCCompiler): ++ if self.check_is_msvc(): + macro_value = macro_value.replace('\"', '\\\"') + macros.append((macro_name, macro_value)) + elif option.startswith('-U'): +diff --git a/giscanner/msvccompiler.py b/giscanner/msvccompiler.py +index 0a543982..e333a80f 100644 +--- a/giscanner/msvccompiler.py ++++ b/giscanner/msvccompiler.py +@@ -19,30 +19,30 @@ + # + + import os +-import distutils ++from typing import Type + + from distutils.errors import DistutilsExecError, CompileError +-from distutils.ccompiler import CCompiler, gen_preprocess_options ++from distutils.ccompiler import CCompiler, gen_preprocess_options, new_compiler + from distutils.dep_util import newer + + # Distutil's MSVCCompiler does not provide a preprocess() + # Implementation, so do our own here. + + ++DistutilsMSVCCompiler: Type = type(new_compiler(compiler="msvc")) ++ ++ + def get_msvc_compiler(): + return MSVCCompiler() + + +-class MSVCCompiler(distutils.msvccompiler.MSVCCompiler): ++class MSVCCompiler(DistutilsMSVCCompiler): + + def __init__(self, verbose=0, dry_run=0, force=0): +- super(distutils.msvccompiler.MSVCCompiler, self).__init__() ++ super(DistutilsMSVCCompiler, self).__init__() + CCompiler.__init__(self, verbose, dry_run, force) + self.__paths = [] + self.__arch = None # deprecated name +- if os.name == 'nt': +- if isinstance(self, distutils.msvc9compiler.MSVCCompiler): +- self.__version = distutils.msvc9compiler.VERSION + self.initialized = False + self.preprocess_options = None + if self.check_is_clang_cl(): +-- +2.46.2 + |