python312Packages.setuptools: 72.1.0 -> 75.1.0

https://setuptools.pypa.io/en/stable/history.html#v75-1-0
This commit is contained in:
Martin Weinelt
2024-10-13 11:02:52 +02:00
parent 197eb56003
commit 20d9b03937
3 changed files with 9 additions and 175 deletions
@@ -5,6 +5,8 @@
setuptools-scm,
setuptools,
python,
jaraco-collections,
jaraco-functools,
jaraco-envs,
jaraco-path,
jaraco-text,
@@ -22,12 +24,14 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "pypa";
repo = "distutils";
rev = "813ab9868b353991ec7324eb09619ee5beb9183f";
hash = "sha256-/YtITDuZlTJRisqsQ6SrgRRUrqLZpj+k3drrouURZlc=";
rev = "378984e02edae91d5f49425da8436f8dd9152b8a"; # correlate commit from setuptools version
hash = "sha256-31sPPVY6tr+OwpiFiaKw82KyhDNBVW3Foea49dCa6pA=";
};
build-system = [ setuptools-scm ];
dependencies = [ jaraco-functools ];
postInstall = ''
rm -r $out/${python.sitePackages}/distutils
ln -s ${setuptools}/${python.sitePackages}/setuptools/_distutils $out/${python.sitePackages}/distutils
@@ -36,6 +40,7 @@ buildPythonPackage rec {
pythonImportsCheck = [ "distutils" ];
nativeCheckInputs = [
jaraco-collections
jaraco-envs
jaraco-path
jaraco-text
@@ -10,19 +10,18 @@
buildPythonPackage rec {
pname = "setuptools";
version = "72.1.0";
version = "75.1.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "pypa";
repo = "setuptools";
rev = "refs/tags/v${version}";
hash = "sha256-3Hm9HxJdSmyhHtDZeMF76HaR17vZwZWYYhS6Z0nA8rU=";
hash = "sha256-ZvhXfusayUHHFXl7ZBksFhxTi1p+Va6qAwq7Fo7Tg/s=";
};
patches = [
./tag-date.patch
./setuptools-distutils-C++.patch
];
nativeBuildInputs = [ wheel ];
@@ -1,170 +0,0 @@
diff --git a/setuptools/_distutils/cygwinccompiler.py b/setuptools/_distutils/cygwinccompiler.py
index 7b812fd05..c122a4318 100644
--- a/setuptools/_distutils/cygwinccompiler.py
+++ b/setuptools/_distutils/cygwinccompiler.py
@@ -99,14 +99,18 @@ class CygwinCCompiler(UnixCCompiler):
self.cxx = os.environ.get('CXX', 'g++')
self.linker_dll = self.cc
+ self.linker_dll_cxx = self.cxx
shared_option = "-shared"
self.set_executables(
compiler=f'{self.cc} -mcygwin -O -Wall',
compiler_so=f'{self.cc} -mcygwin -mdll -O -Wall',
+ compiler_so_cxx=f'{self.cxx} -mcygwin -mdll -O -Wall',
compiler_cxx=f'{self.cxx} -mcygwin -O -Wall',
linker_exe=f'{self.cc} -mcygwin',
linker_so=(f'{self.linker_dll} -mcygwin {shared_option}'),
+ linker_exe_cxx=f'{self.cxx} -mcygwin',
+ linker_so_cxx=(f'{self.cxx} -mcygwin {shared_option}'),
)
# Include the appropriate MSVC runtime library if Python was built
@@ -138,9 +142,12 @@ class CygwinCCompiler(UnixCCompiler):
raise CompileError(msg)
else: # for other files use the C-compiler
try:
- self.spawn(
- self.compiler_so + cc_args + [src, '-o', obj] + extra_postargs
- )
+ if self.detect_language(src) == 'c++':
+ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] +
+ extra_postargs)
+ else:
+ self.spawn(
+ self.compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
except DistutilsExecError as msg:
raise CompileError(msg)
@@ -276,9 +283,12 @@ class Mingw32CCompiler(CygwinCCompiler):
self.set_executables(
compiler=f'{self.cc} -O -Wall',
compiler_so=f'{self.cc} -shared -O -Wall',
+ compiler_so_cxx=f'{self.cxx} -mdll -O -Wall',
compiler_cxx=f'{self.cxx} -O -Wall',
linker_exe=f'{self.cc}',
linker_so=f'{self.linker_dll} {shared_option}',
+ linker_exe_cxx=f'{self.cxx}',
+ linker_so_cxx=f'{self.linker_dll_cxx} {shared_option}',
)
def runtime_library_dir_option(self, dir):
diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py
index 7ebe67687..a995edf80 100644
--- a/setuptools/_distutils/sysconfig.py
+++ b/setuptools/_distutils/sysconfig.py
@@ -304,6 +304,7 @@ def customize_compiler(compiler): # noqa: C901
cflags,
ccshared,
ldshared,
+ ldcxxshared,
shlib_suffix,
ar,
ar_flags,
@@ -313,11 +314,14 @@ def customize_compiler(compiler): # noqa: C901
'CFLAGS',
'CCSHARED',
'LDSHARED',
+ 'LDCXXSHARED',
'SHLIB_SUFFIX',
'AR',
'ARFLAGS',
)
+ cxxflags = cflags
+
if 'CC' in os.environ:
newcc = os.environ['CC']
if 'LDSHARED' not in os.environ and ldshared.startswith(cc):
@@ -329,19 +333,27 @@ def customize_compiler(compiler): # noqa: C901
cxx = os.environ['CXX']
if 'LDSHARED' in os.environ:
ldshared = os.environ['LDSHARED']
+ if 'LDCXXSHARED' in os.environ:
+ ldcxxshared = os.environ['LDCXXSHARED']
if 'CPP' in os.environ:
cpp = os.environ['CPP']
else:
cpp = cc + " -E" # not always
if 'LDFLAGS' in os.environ:
ldshared = ldshared + ' ' + os.environ['LDFLAGS']
+ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS']
if 'CFLAGS' in os.environ:
- cflags = cflags + ' ' + os.environ['CFLAGS']
+ cflags = os.environ['CFLAGS']
ldshared = ldshared + ' ' + os.environ['CFLAGS']
+ if 'CXXFLAGS' in os.environ:
+ cxxflags = os.environ['CXXFLAGS']
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS']
if 'CPPFLAGS' in os.environ:
cpp = cpp + ' ' + os.environ['CPPFLAGS']
cflags = cflags + ' ' + os.environ['CPPFLAGS']
+ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS']
ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
+ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS']
if 'AR' in os.environ:
ar = os.environ['AR']
if 'ARFLAGS' in os.environ:
@@ -350,13 +362,17 @@ def customize_compiler(compiler): # noqa: C901
archiver = ar + ' ' + ar_flags
cc_cmd = cc + ' ' + cflags
+ cxx_cmd = cxx + ' ' + cxxflags
compiler.set_executables(
preprocessor=cpp,
compiler=cc_cmd,
compiler_so=cc_cmd + ' ' + ccshared,
- compiler_cxx=cxx,
+ compiler_cxx=cxx_cmd,
+ compiler_so_cxx=cxx_cmd + ' ' + ccshared,
linker_so=ldshared,
+ linker_so_cxx=ldcxxshared,
linker_exe=cc,
+ linker_exe_cxx=cxx,
archiver=archiver,
)
diff --git a/setuptools/_distutils/unixccompiler.py b/setuptools/_distutils/unixccompiler.py
index 7e68596b2..7214dbd20 100644
--- a/setuptools/_distutils/unixccompiler.py
+++ b/setuptools/_distutils/unixccompiler.py
@@ -118,9 +118,12 @@ class UnixCCompiler(CCompiler):
'preprocessor': None,
'compiler': ["cc"],
'compiler_so': ["cc"],
- 'compiler_cxx': ["cc"],
+ 'compiler_cxx': ["c++"],
+ 'compiler_so_cxx': ["c++"],
'linker_so': ["cc", "-shared"],
+ 'linker_so_cxx': ["c++", "-shared"],
'linker_exe': ["cc"],
+ 'linker_exe_cxx': ["c++", "-shared"],
'archiver': ["ar", "-cr"],
'ranlib': None,
}
@@ -187,8 +190,13 @@ class UnixCCompiler(CCompiler):
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
compiler_so = compiler_fixup(self.compiler_so, cc_args + extra_postargs)
+ compiler_so_cxx = compiler_fixup(self.compiler_so_cxx, cc_args + extra_postargs)
try:
- self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
+ if self.detect_language(src) == 'c++':
+ self.spawn(compiler_so_cxx + cc_args + [ src, '-o', obj] +
+ extra_postargs)
+ else:
+ self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
except DistutilsExecError as msg:
raise CompileError(msg)
@@ -256,7 +264,8 @@ class UnixCCompiler(CCompiler):
# building an executable or linker_so (with shared options)
# when building a shared library.
building_exe = target_desc == CCompiler.EXECUTABLE
- linker = (self.linker_exe if building_exe else self.linker_so)[:]
+ linker = (self.linker_exe if building_exe else (self.linker_so_cxx if
+ target_lang == "c++" else self.linker_so))[:]
if target_lang == "c++" and self.compiler_cxx:
env, linker_ne = _split_env(linker)