Merge pull request #261717 from mweinelt/python-3.13

python313: init at 3.13.0a1

authored by Martin Weinelt and committed by GitHub 84fc1cdc f0363a57

+134 -2
+107
pkgs/development/interpreters/python/cpython/3.13/no-ldconfig.patch
···
··· 1 + From 5330b6af9f832af59aa5c61d9ef6971053a8e709 Mon Sep 17 00:00:00 2001 2 + From: Jonathan Ringer <jonringer117@gmail.com> 3 + Date: Mon, 9 Nov 2020 10:24:35 -0800 4 + Subject: [PATCH] CPython: Don't use ldconfig 5 + 6 + --- 7 + Lib/ctypes/util.py | 77 ++-------------------------------------------- 8 + 1 file changed, 2 insertions(+), 75 deletions(-) 9 + 10 + diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py 11 + index 0c2510e161..7fb98af308 100644 12 + --- a/Lib/ctypes/util.py 13 + +++ b/Lib/ctypes/util.py 14 + @@ -100,53 +100,7 @@ def _is_elf(filename): 15 + return thefile.read(4) == elf_header 16 + 17 + def _findLib_gcc(name): 18 + - # Run GCC's linker with the -t (aka --trace) option and examine the 19 + - # library name it prints out. The GCC command will fail because we 20 + - # haven't supplied a proper program with main(), but that does not 21 + - # matter. 22 + - expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) 23 + - 24 + - c_compiler = shutil.which('gcc') 25 + - if not c_compiler: 26 + - c_compiler = shutil.which('cc') 27 + - if not c_compiler: 28 + - # No C compiler available, give up 29 + - return None 30 + - 31 + - temp = tempfile.NamedTemporaryFile() 32 + - try: 33 + - args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] 34 + - 35 + - env = dict(os.environ) 36 + - env['LC_ALL'] = 'C' 37 + - env['LANG'] = 'C' 38 + - try: 39 + - proc = subprocess.Popen(args, 40 + - stdout=subprocess.PIPE, 41 + - stderr=subprocess.STDOUT, 42 + - env=env) 43 + - except OSError: # E.g. bad executable 44 + - return None 45 + - with proc: 46 + - trace = proc.stdout.read() 47 + - finally: 48 + - try: 49 + - temp.close() 50 + - except FileNotFoundError: 51 + - # Raised if the file was already removed, which is the normal 52 + - # behaviour of GCC if linking fails 53 + - pass 54 + - res = re.findall(expr, trace) 55 + - if not res: 56 + - return None 57 + - 58 + - for file in res: 59 + - # Check if the given file is an elf file: gcc can report 60 + - # some files that are linker scripts and not actual 61 + - # shared objects. See bpo-41976 for more details 62 + - if not _is_elf(file): 63 + - continue 64 + - return os.fsdecode(file) 65 + + return None 66 + 67 + 68 + if sys.platform == "sunos5": 69 + @@ -268,34 +222,7 @@ def find_library(name, is64 = False): 70 + else: 71 + 72 + def _findSoname_ldconfig(name): 73 + - import struct 74 + - if struct.calcsize('l') == 4: 75 + - machine = os.uname().machine + '-32' 76 + - else: 77 + - machine = os.uname().machine + '-64' 78 + - mach_map = { 79 + - 'x86_64-64': 'libc6,x86-64', 80 + - 'ppc64-64': 'libc6,64bit', 81 + - 'sparc64-64': 'libc6,64bit', 82 + - 's390x-64': 'libc6,64bit', 83 + - 'ia64-64': 'libc6,IA-64', 84 + - } 85 + - abi_type = mach_map.get(machine, 'libc6') 86 + - 87 + - # XXX assuming GLIBC's ldconfig (with option -p) 88 + - regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' 89 + - regex = os.fsencode(regex % (re.escape(name), abi_type)) 90 + - try: 91 + - with subprocess.Popen(['/sbin/ldconfig', '-p'], 92 + - stdin=subprocess.DEVNULL, 93 + - stderr=subprocess.DEVNULL, 94 + - stdout=subprocess.PIPE, 95 + - env={'LC_ALL': 'C', 'LANG': 'C'}) as p: 96 + - res = re.search(regex, p.stdout.read()) 97 + - if res: 98 + - return os.fsdecode(res.group(1)) 99 + - except OSError: 100 + - pass 101 + + return None 102 + 103 + def _findLib_ld(name): 104 + # See issue #9998 for why this is needed 105 + -- 106 + 2.33.1 107 +
+1 -1
pkgs/development/interpreters/python/cpython/default.nix
··· 324 '' + optionalString mimetypesSupport '' 325 substituteInPlace Lib/mimetypes.py \ 326 --replace "@mime-types@" "${mailcap}" 327 - '' + optionalString (x11Support && (tix != null)) '' 328 substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" 329 ''; 330
··· 324 '' + optionalString mimetypesSupport '' 325 substituteInPlace Lib/mimetypes.py \ 326 --replace "@mime-types@" "${mailcap}" 327 + '' + optionalString (pythonOlder "3.13" && x11Support && (tix != null)) '' 328 substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" 329 ''; 330
+12
pkgs/development/interpreters/python/default.nix
··· 103 inherit passthruFun; 104 }; 105 106 # Minimal versions of Python (built without optional dependencies) 107 python3Minimal = (callPackage ./cpython ({ 108 self = __splicedPackages.python3Minimal;
··· 103 inherit passthruFun; 104 }; 105 106 + python313 = callPackage ./cpython { 107 + self = __splicedPackages.python313; 108 + sourceVersion = { 109 + major = "3"; 110 + minor = "13"; 111 + patch = "0"; 112 + suffix = "a1"; 113 + }; 114 + hash = "sha256-8Cgb8izABBQ2HBT8kZcYPn6y6rtylla2lEIiT7tj7ss="; 115 + inherit (darwin) configd; 116 + inherit passthruFun; 117 + }; 118 # Minimal versions of Python (built without optional dependencies) 119 python3Minimal = (callPackage ./cpython ({ 120 self = __splicedPackages.python3Minimal;
+14 -1
pkgs/top-level/all-packages.nix
··· 17912 bluezSupport = true; 17913 x11Support = true; 17914 }; 17915 17916 pythonInterpreters = callPackage ./../development/interpreters/python { }; 17917 - inherit (pythonInterpreters) python27 python38 python39 python310 python311 python312 python3Minimal pypy27 pypy310 pypy39 rustpython; 17918 17919 # List of extensions with overrides to apply to all Python package sets. 17920 pythonPackagesExtensions = [ ]; ··· 17925 python310Packages = recurseIntoAttrs python310.pkgs; 17926 python311Packages = recurseIntoAttrs python311.pkgs; 17927 python312Packages = python312.pkgs; 17928 pypyPackages = pypy.pkgs; 17929 pypy2Packages = pypy2.pkgs; 17930 pypy27Packages = pypy27.pkgs;
··· 17912 bluezSupport = true; 17913 x11Support = true; 17914 }; 17915 + python312Full = python312.override { 17916 + self = python312Full; 17917 + pythonAttr = "python312Full"; 17918 + bluezSupport = true; 17919 + x11Support = true; 17920 + }; 17921 + python313Full = python313.override { 17922 + self = python313Full; 17923 + pythonAttr = "python313Full"; 17924 + bluezSupport = true; 17925 + x11Support = true; 17926 + }; 17927 17928 pythonInterpreters = callPackage ./../development/interpreters/python { }; 17929 + inherit (pythonInterpreters) python27 python38 python39 python310 python311 python312 python313 python3Minimal pypy27 pypy310 pypy39 rustpython; 17930 17931 # List of extensions with overrides to apply to all Python package sets. 17932 pythonPackagesExtensions = [ ]; ··· 17937 python310Packages = recurseIntoAttrs python310.pkgs; 17938 python311Packages = recurseIntoAttrs python311.pkgs; 17939 python312Packages = python312.pkgs; 17940 + python313Packages = python313.pkgs; 17941 pypyPackages = pypy.pkgs; 17942 pypy2Packages = pypy2.pkgs; 17943 pypy27Packages = pypy27.pkgs;