slackware-current/source/l/gobject-introspection/a2139dba59eac283a7f543ed737f038deebddc19.patch
Patrick J Volkerding b6d2c7f5fa Wed Sep 11 17:47:14 UTC 2024
a/efibootmgr-18-x86_64-1.txz:  Upgraded.
a/grub-2.12-x86_64-16.txz:  Rebuilt.
  Long ago, we began giving all the scripts in /etc/grub.d/ the .new treatment
  to prevent local customizations from being overwritten with a package
  upgrade. But, this no longer appears to be a good idea, especially if we're
  ever going to offer the possibility to automate grub-install and grub-update.
  So, we are no longer going to preserve the contents of these files when the
  grub package is upgraded. We *will* however preserve the existing
  permissions, so you'll be able to turn off scripts that you don't want
  running, and you'll be able to make new scripts, or make edited and renamed
  copies of the scripts shipped in this package, so there's no real loss of
  functionality here.
  It looks like 40_custom is intended to be locally edited, so we make an
  exception and do not overwrite that one.
d/python-setuptools-74.1.2-x86_64-1.txz:  Upgraded.
kde/okteta-0.26.17-x86_64-1.txz:  Upgraded.
l/gobject-introspection-1.80.1-x86_64-2.txz:  Rebuilt.
  Fix running against python-setuptools-74.1.2:
  [PATCH] giscanner: remove dependency on distutils.msvccompiler.
l/python-importlib_metadata-8.5.0-x86_64-1.txz:  Upgraded.
n/curl-8.10.0-x86_64-1.txz:  Upgraded.
2024-09-11 20:35:16 +02:00

98 lines
3.7 KiB
Diff

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 d0ed70a3c..9a732cd5e 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -26,7 +26,6 @@
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 @@ def __init__(self,
# 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 @@ def linker_cmd(self):
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 @@ def _set_cpp_options(self, options):
# 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 0a5439820..e333a80f5 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():