python3Packages.setuptools: 60.8.2 -> 61.2.0

This commit is contained in:
Martin Weinelt 2022-03-30 03:41:57 +02:00
parent 02fe739a47
commit ba918de429
2 changed files with 20 additions and 56 deletions

View file

@ -10,7 +10,7 @@
let
pname = "setuptools";
version = "60.8.2";
version = "61.2.0";
# Create an sdist of setuptools
sdist = stdenv.mkDerivation rec {
@ -20,7 +20,7 @@ let
owner = "pypa";
repo = pname;
rev = "v${version}";
sha256 = "1mqpmbn58rx3g24dm6wnllx0xs97ampn2yga3qypqgwnh1nk477i";
hash = "sha256-Cgz3uA8U7A1lOZNuj1EYZVViZ3aL6VjcAno8GYQUufk=";
name = "${pname}-${version}-source";
};

View file

@ -1,6 +1,3 @@
Based on pkgs/development/interpreters/python/cpython/3.7/python-3.x-distutils-C++.patch,
adapted to apply to setuptools 60.x's bundled distutils.
diff --git a/setuptools/_distutils/cygwinccompiler.py b/setuptools/_distutils/cygwinccompiler.py
index c5c86d8f..b879e447 100644
--- a/setuptools/_distutils/cygwinccompiler.py
@ -57,7 +54,7 @@ index c5c86d8f..b879e447 100644
# Maybe we should also append -mthreads, but then the finished
# dlls need another dll (mingwm10.dll see Mingw32 docs)
diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py
index 4a77a431..1ad85181 100644
index 9fad3835..889e2595 100644
--- a/setuptools/_distutils/sysconfig.py
+++ b/setuptools/_distutils/sysconfig.py
@@ -216,9 +216,11 @@ def customize_compiler(compiler):
@ -124,10 +121,10 @@ index 4a77a431..1ad85181 100644
if 'RANLIB' in os.environ and compiler.executables.get('ranlib', None):
diff --git a/setuptools/_distutils/unixccompiler.py b/setuptools/_distutils/unixccompiler.py
index a07e5988..576ef490 100644
index 715408f5..6125a1eb 100644
--- a/setuptools/_distutils/unixccompiler.py
+++ b/setuptools/_distutils/unixccompiler.py
@@ -52,14 +52,17 @@ class UnixCCompiler(CCompiler):
@@ -110,14 +110,17 @@ class UnixCCompiler(CCompiler):
# are pretty generic; they will probably have to be set by an outsider
# (eg. using information discovered by the sysconfig about building
# Python extensions).
@ -153,21 +150,17 @@ index a07e5988..576ef490 100644
}
if sys.platform[:6] == "darwin":
@@ -110,12 +113,19 @@ class UnixCCompiler(CCompiler):
@@ -169,9 +172,15 @@ class UnixCCompiler(CCompiler):
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
compiler_so = self.compiler_so
+ compiler_so_cxx = self.compiler_so_cxx
if sys.platform == 'darwin':
compiler_so = _osx_support.compiler_fixup(compiler_so,
cc_args + extra_postargs)
+ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx,
+ cc_args + extra_postargs)
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] +
+ self.spawn(compiler_so_cxx + cc_args + [ src, '-o', obj] +
+ extra_postargs)
+ else:
+ self.spawn(compiler_so + cc_args + [src, '-o', obj] +
@ -175,42 +168,13 @@ index a07e5988..576ef490 100644
except DistutilsExecError as msg:
raise CompileError(msg)
@@ -173,30 +183,16 @@ class UnixCCompiler(CCompiler):
ld_args.extend(extra_postargs)
self.mkpath(os.path.dirname(output_filename))
try:
- if target_desc == CCompiler.EXECUTABLE:
- linker = self.linker_exe[:]
+ if target_lang == "c++":
+ if target_desc == CCompiler.EXECUTABLE:
+ linker = self.linker_exe_cxx[:]
+ else:
+ linker = self.linker_so_cxx[:]
else:
- linker = self.linker_so[:]
- if target_lang == "c++" and self.compiler_cxx:
- # skip over environment variable settings if /usr/bin/env
- # is used to set up the linker's environment.
- # This is needed on OSX. Note: this assumes that the
- # normal and C++ compiler have the same environment
- # settings.
- i = 0
- if os.path.basename(linker[0]) == "env":
- i = 1
- while '=' in linker[i]:
- i += 1
-
- if os.path.basename(linker[i]) == 'ld_so_aix':
- # AIX platforms prefix the compiler with the ld_so_aix
- # script, so we need to adjust our linker index
- offset = 1
+ if target_desc == CCompiler.EXECUTABLE:
+ linker = self.linker_exe[:]
else:
- offset = 0
-
- linker[i+offset] = self.compiler_cxx[i]
+ linker = self.linker_so[:]
@@ -233,7 +242,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 sys.platform == 'darwin':
linker = _osx_support.compiler_fixup(linker, ld_args)
if target_lang == "c++" and self.compiler_cxx:
env, linker_ne = _split_env(linker)