Sat Jan 13 04:24:29 2024 UTC (131d)
lang/python3*: Fix cross-build by patching out broken readline crud.

Python's setup.py tries to decide whether readline is available by
running readelf on the path it thinks it can find to libreadline.so.
Since we always use a single static readline/curses choice in Pythin
(readline, not editline, with (fake-)ncurses), just patch all that
buggy detection goo away.

No new maintenance burden because this logic has been ripped out of
Python 3.12 anyway.  Python 3.8 skipped for now because it doesn't
cross-build at the moment anyway -- more work needed to make that
happen (and it's not as easy as Python>=3.9 as I recall).


(riastradh)
diff -r1.29 -r1.30 pkgsrc/lang/python310/Makefile
diff -r1.27 -r1.28 pkgsrc/lang/python310/distinfo
diff -r1.7 -r1.8 pkgsrc/lang/python310/patches/patch-setup.py
diff -r1.23 -r1.24 pkgsrc/lang/python311/Makefile
diff -r1.12 -r1.13 pkgsrc/lang/python311/distinfo
diff -r1.2 -r1.3 pkgsrc/lang/python311/patches/patch-setup.py
diff -r1.37 -r1.38 pkgsrc/lang/python39/distinfo
diff -r1.10 -r1.11 pkgsrc/lang/python39/patches/patch-setup.py

cvs diff -r1.29 -r1.30 pkgsrc/lang/python310/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python310/Makefile 2023/11/23 12:43:35 1.29
+++ pkgsrc/lang/python310/Makefile 2024/01/13 04:24:28 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.29 2023/11/23 12:43:35 jperkin Exp $ 1# $NetBSD: Makefile,v 1.30 2024/01/13 04:24:28 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python310-${PY_DISTVERSION} 5PKGNAME= python310-${PY_DISTVERSION}
6PKGREVISION= 4 6PKGREVISION= 4
7CATEGORIES= lang python 7CATEGORIES= lang python
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= https://www.python.org/ 10HOMEPAGE= https://www.python.org/
11COMMENT= Interpreted, interactive, object-oriented programming language 11COMMENT= Interpreted, interactive, object-oriented programming language
12LICENSE= python-software-foundation 12LICENSE= python-software-foundation
13 13
14CONFLICTS+= python-[0-9]* 14CONFLICTS+= python-[0-9]*
@@ -28,26 +28,27 @@ SUPERSEDES+= py310-sqlite3-[0-9]* @@ -28,26 +28,27 @@ SUPERSEDES+= py310-sqlite3-[0-9]*
28PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk 28PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk
29PLIST_AWK_ENV+= PYVERS=310 29PLIST_AWK_ENV+= PYVERS=310
30PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ { 30PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ {
31PRINT_PLIST_AWK+= sub(/__pycache__\//, "") 31PRINT_PLIST_AWK+= sub(/__pycache__\//, "")
32PRINT_PLIST_AWK+= sub(/\.cpython-310/, "")} 32PRINT_PLIST_AWK+= sub(/\.cpython-310/, "")}
33PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ { 33PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
34PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")} 34PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")}
35 35
36USE_LANGUAGES= c c++ 36USE_LANGUAGES= c c++
37USE_TOOLS+= pkg-config 37USE_TOOLS+= pkg-config
38GNU_CONFIGURE= yes 38GNU_CONFIGURE= yes
39CONFIGURE_ARGS+= --enable-shared 39CONFIGURE_ARGS+= --enable-shared
40CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl} 40CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
 41CONFIGURE_ARGS+= --with-readline=readline # XXX editline?
41CONFIGURE_ARGS+= --with-system-expat 42CONFIGURE_ARGS+= --with-system-expat
42CONFIGURE_ARGS+= --with-system-ffi 43CONFIGURE_ARGS+= --with-system-ffi
43CONFIGURE_ARGS+= --without-ensurepip 44CONFIGURE_ARGS+= --without-ensurepip
44CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q} 45CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q}
45CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir} 46CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
46PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in 47PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in
47 48
48# NetBSD-8 curses has enough support for py-curses 49# NetBSD-8 curses has enough support for py-curses
49USE_CURSES= getsyx wide 50USE_CURSES= getsyx wide
50# But we build as ncurses still to get the full feature set easily 51# But we build as ncurses still to get the full feature set easily
51FAKE_NCURSES= yes 52FAKE_NCURSES= yes
52 53
53PTHREAD_OPTS+= require 54PTHREAD_OPTS+= require

cvs diff -r1.27 -r1.28 pkgsrc/lang/python310/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/python310/distinfo 2023/11/10 09:48:40 1.27
+++ pkgsrc/lang/python310/distinfo 2024/01/13 04:24:28 1.28
@@ -1,19 +1,19 @@ @@ -1,19 +1,19 @@
1$NetBSD: distinfo,v 1.27 2023/11/10 09:48:40 nia Exp $ 1$NetBSD: distinfo,v 1.28 2024/01/13 04:24:28 riastradh Exp $
2 2
3BLAKE2s (Python-3.10.13.tar.xz) = c714daeb2437980ce940e76db70f037d844bcddc06dddb6ac966cef281a2b514 3BLAKE2s (Python-3.10.13.tar.xz) = c714daeb2437980ce940e76db70f037d844bcddc06dddb6ac966cef281a2b514
4SHA512 (Python-3.10.13.tar.xz) = 7579772e501486b2b07f78142082dee1e99c7643640098860ac0cf2ca87daf7588b0c00b1db1960146b37f56a6ed98fd08297c25c9a19b612cf6e6a258984da8 4SHA512 (Python-3.10.13.tar.xz) = 7579772e501486b2b07f78142082dee1e99c7643640098860ac0cf2ca87daf7588b0c00b1db1960146b37f56a6ed98fd08297c25c9a19b612cf6e6a258984da8
5Size (Python-3.10.13.tar.xz) = 19663088 bytes 5Size (Python-3.10.13.tar.xz) = 19663088 bytes
6SHA1 (patch-Lib_ctypes_util.py) = 3dec1b6b7a36e46cbfa0dfcd71c5e7fac9f60764 6SHA1 (patch-Lib_ctypes_util.py) = 3dec1b6b7a36e46cbfa0dfcd71c5e7fac9f60764
7SHA1 (patch-Lib_distutils_unixccompiler.py) = 8a91e8f4f86517a62408c3a10ed5eb50c4091fbf 7SHA1 (patch-Lib_distutils_unixccompiler.py) = 8a91e8f4f86517a62408c3a10ed5eb50c4091fbf
8SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 593c4e93c5653ab400f0a98b91db92630c0a7390 8SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 593c4e93c5653ab400f0a98b91db92630c0a7390
9SHA1 (patch-Lib_sysconfig.py) = bc6d91bf8f7121456b26ea7f080f588c96f2596f 9SHA1 (patch-Lib_sysconfig.py) = bc6d91bf8f7121456b26ea7f080f588c96f2596f
10SHA1 (patch-Lib_test_test__shutil.py) = 2eb724d490544e77610a19a07dc0f9336dba3e2f 10SHA1 (patch-Lib_test_test__shutil.py) = 2eb724d490544e77610a19a07dc0f9336dba3e2f
11SHA1 (patch-Makefile.pre.in) = 932a89313e8f26c435675f2487eb2141876a5f5a 11SHA1 (patch-Makefile.pre.in) = 932a89313e8f26c435675f2487eb2141876a5f5a
12SHA1 (patch-Modules_clinic_posixmodule.c.h) = 3729243da6b4df47a956db9b784b056189c6403e 12SHA1 (patch-Modules_clinic_posixmodule.c.h) = 3729243da6b4df47a956db9b784b056189c6403e
13SHA1 (patch-Modules_posixmodule.c) = 1a1b866c9190fda8ca9c547085614b0f1d5469e1 13SHA1 (patch-Modules_posixmodule.c) = 1a1b866c9190fda8ca9c547085614b0f1d5469e1
14SHA1 (patch-Modules_socketmodule.c) = 3e2db474b4ef08edd25528465605fff1d3d0f61b 14SHA1 (patch-Modules_socketmodule.c) = 3e2db474b4ef08edd25528465605fff1d3d0f61b
15SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c 15SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c
16SHA1 (patch-Python_thread__pthread.h) = b8efa178380fe48da4a0bf2bfa906851a314824e 16SHA1 (patch-Python_thread__pthread.h) = b8efa178380fe48da4a0bf2bfa906851a314824e
17SHA1 (patch-configure) = 8ffe98e51407d10e46e7d1531f2e0e0b58e1cfa6 17SHA1 (patch-configure) = 8ffe98e51407d10e46e7d1531f2e0e0b58e1cfa6
18SHA1 (patch-pyconfig.h.in) = 1ab77914315acbf0352d242ed66200bea54548f6 18SHA1 (patch-pyconfig.h.in) = 1ab77914315acbf0352d242ed66200bea54548f6
19SHA1 (patch-setup.py) = 5ab776a53ad361fdea9004817a7157743ab42db7 19SHA1 (patch-setup.py) = 5d1907202ad38286b92f41a553f34cf87c965213

cvs diff -r1.7 -r1.8 pkgsrc/lang/python310/patches/patch-setup.py (expand / switch to unified diff)

--- pkgsrc/lang/python310/patches/patch-setup.py 2023/10/23 06:36:00 1.7
+++ pkgsrc/lang/python310/patches/patch-setup.py 2024/01/13 04:24:28 1.8
@@ -1,24 +1,27 @@ @@ -1,24 +1,27 @@
1$NetBSD: patch-setup.py,v 1.7 2023/10/23 06:36:00 wiz Exp $ 1$NetBSD: patch-setup.py,v 1.8 2024/01/13 04:24:28 riastradh Exp $
2 2
3Disable certain modules, so they can be built as separate packages. 3Disable certain modules, so they can be built as separate packages.
4Do not look for ncursesw. 4Do not look for ncursesw.
5Assume panel_library is correct; this is a fix for ncurses' gnupanel 5Assume panel_library is correct; this is a fix for ncurses' gnupanel
6which will get transformed to panel in buildlink. 6which will get transformed to panel in buildlink.
7Don't search for modules in PREFIX. Fixes build failure when py-setuptools 7Don't search for modules in PREFIX. Fixes build failure when py-setuptools
8 are installed. 8 are installed.
9Enable cross-build by setting sys._home and sys.path to build directory 9Enable cross-build by setting sys._home and sys.path to build directory
 10Disable circuitous readline detection which tries to outsmart pkgsrc's
 11static choice of libreadline and (fake-)ncurses and trips over its elven
 12shoelaces when cross-compiling.
10 13
11--- setup.py.orig 2022-03-23 20:12:04.000000000 +0000 14--- setup.py.orig 2023-08-24 12:46:25.000000000 +0000
12+++ setup.py 15+++ setup.py
13@@ -1,5 +1,11 @@ 16@@ -1,5 +1,11 @@
14 # Autodetecting setup.py script for building the Python extensions 17 # Autodetecting setup.py script for building the Python extensions
15  18
16+import sys 19+import sys
17+sys._home = __file__[:-len('/setup.py')] 20+sys._home = __file__[:-len('/setup.py')]
18+sys.path.append(__file__[:-len('/setup.py')] + '/Lib') 21+sys.path.append(__file__[:-len('/setup.py')] + '/Lib')
19+with open('pybuilddir.txt') as pybuilddir: 22+with open('pybuilddir.txt') as pybuilddir:
20+ sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir)) 23+ sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir))
21+ 24+
22 import argparse 25 import argparse
23 import importlib._bootstrap 26 import importlib._bootstrap
24 import importlib.machinery 27 import importlib.machinery
@@ -54,81 +57,147 @@ Enable cross-build by setting sys._home  @@ -54,81 +57,147 @@ Enable cross-build by setting sys._home
54+def grep_headers_for(function, headers): 57+def grep_headers_for(function, headers):
55+ for header in headers: 58+ for header in headers:
56+ try: 59+ try:
57+ with open(header, 'r') as f: 60+ with open(header, 'r') as f:
58+ if function in f.read(): 61+ if function in f.read():
59+ return True 62+ return True
60+ except UnicodeDecodeError: 63+ except UnicodeDecodeError:
61+ pass 64+ pass
62+ return False 65+ return False
63+ 66+
64 def find_file(filename, std_dirs, paths): 67 def find_file(filename, std_dirs, paths):
65 """Searches for the directory where a given file is located, 68 """Searches for the directory where a given file is located,
66 and returns a possibly-empty list of additional directories, or None 69 and returns a possibly-empty list of additional directories, or None
67@@ -823,15 +841,15 @@ class PyBuildExt(build_ext): 70@@ -822,15 +840,15 @@ class PyBuildExt(build_ext):
68 add_dir_to_list(dir_list, directory) 71 add_dir_to_list(dir_list, directory)
69  72
70 def configure_compiler(self): 73 def configure_compiler(self):
71- # Ensure that /usr/local is always used, but the local build 74- # Ensure that /usr/local is always used, but the local build
72- # directories (i.e. '.' and 'Include') must be first. See issue 75- # directories (i.e. '.' and 'Include') must be first. See issue
73- # 10520. 76- # 10520.
74- if not CROSS_COMPILING: 77- if not CROSS_COMPILING:
75- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') 78- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
76- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') 79- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
77- # only change this for cross builds for 3.3, issues on Mageia 80- # only change this for cross builds for 3.3, issues on Mageia
78- if CROSS_COMPILING: 81- if CROSS_COMPILING:
79- self.add_cross_compiling_paths() 82- self.add_cross_compiling_paths()
80+ # Add the buildlink directories for pkgsrc 83+ # Add the buildlink directories for pkgsrc
81+ if os.environ.get('BUILDLINK_DIR'): 84+ if os.environ.get('BUILDLINK_DIR'):
82+ dir = os.environ['BUILDLINK_DIR'] 85+ dir = os.environ['BUILDLINK_DIR']
83+ libdir = dir + '/lib' 86+ libdir = dir + '/lib'
84+ incdir = dir + '/include' 87+ incdir = dir + '/include'
85+ if libdir not in self.compiler.library_dirs: 88+ if libdir not in self.compiler.library_dirs:
86+ self.compiler.library_dirs.insert(0, libdir) 89+ self.compiler.library_dirs.insert(0, libdir)
87+ if incdir not in self.compiler.include_dirs: 90+ if incdir not in self.compiler.include_dirs:
88+ self.compiler.include_dirs.insert(0, incdir) 91+ self.compiler.include_dirs.insert(0, incdir)
89 self.add_multiarch_paths() 92 self.add_multiarch_paths()
90 self.add_ldflags_cppflags() 93 self.add_ldflags_cppflags()
91  94
92@@ -879,6 +897,9 @@ class PyBuildExt(build_ext): 95@@ -878,6 +896,9 @@ class PyBuildExt(build_ext):
93 self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] 96 self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
94  97
95 if MACOS: 98 if MACOS:
96+ self.inc_dirs.append(macosx_sdk_root() + '/usr/include') 99+ self.inc_dirs.append(macosx_sdk_root() + '/usr/include')
97+ self.lib_dirs.append(macosx_sdk_root() + '/usr/lib') 100+ self.lib_dirs.append(macosx_sdk_root() + '/usr/lib')
98+ 101+
99 # This should work on any unixy platform ;-) 102 # This should work on any unixy platform ;-)
100 # If the user has bothered specifying additional -I and -L flags 103 # If the user has bothered specifying additional -I and -L flags
101 # in OPT and LDFLAGS we might as well use them here. 104 # in OPT and LDFLAGS we might as well use them here.
102@@ -1106,8 +1127,6 @@ class PyBuildExt(build_ext): 105@@ -1067,71 +1088,10 @@ class PyBuildExt(build_ext):
103 # use the same library for the readline and curses modules. 106 def detect_readline_curses(self):
104 if 'curses' in readline_termcap_library: 107 # readline
105 curses_library = readline_termcap_library 108 readline_termcap_library = ""
 109- curses_library = ""
 110- # Cannot use os.popen here in py3k.
 111- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
 112- if not os.path.exists(self.build_temp):
 113- os.makedirs(self.build_temp)
 114- # Determine if readline is already linked against curses or tinfo.
 115- if sysconfig.get_config_var('HAVE_LIBREADLINE'):
 116- if sysconfig.get_config_var('WITH_EDITLINE'):
 117- readline_lib = 'edit'
 118- else:
 119- readline_lib = 'readline'
 120- do_readline = self.compiler.find_library_file(self.lib_dirs,
 121- readline_lib)
 122- if CROSS_COMPILING:
 123- ret = run_command("%s -d %s | grep '(NEEDED)' > %s"
 124- % (sysconfig.get_config_var('READELF'),
 125- do_readline, tmpfile))
 126- elif find_executable('ldd'):
 127- ret = run_command("ldd %s > %s" % (do_readline, tmpfile))
 128- else:
 129- ret = 1
 130- if ret == 0:
 131- with open(tmpfile) as fp:
 132- for ln in fp:
 133- if 'curses' in ln:
 134- readline_termcap_library = re.sub(
 135- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
 136- ).rstrip()
 137- break
 138- # termcap interface split out from ncurses
 139- if 'tinfo' in ln:
 140- readline_termcap_library = 'tinfo'
 141- break
 142- if os.path.exists(tmpfile):
 143- os.unlink(tmpfile)
 144- else:
 145- do_readline = False
 146- # Issue 7384: If readline is already linked against curses,
 147- # use the same library for the readline and curses modules.
 148- if 'curses' in readline_termcap_library:
 149- curses_library = readline_termcap_library
106- elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'): 150- elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'):
107- curses_library = 'ncursesw' 151- curses_library = 'ncursesw'
108 # Issue 36210: OSS provided ncurses does not link on AIX 152- # Issue 36210: OSS provided ncurses does not link on AIX
109 # Use IBM supplied 'curses' for successful build of _curses 153- # Use IBM supplied 'curses' for successful build of _curses
110 elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'): 154- elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'):
111@@ -1211,8 +1230,7 @@ class PyBuildExt(build_ext): 155- curses_library = 'curses'
 156- elif self.compiler.find_library_file(self.lib_dirs, 'ncurses'):
 157- curses_library = 'ncurses'
 158- elif self.compiler.find_library_file(self.lib_dirs, 'curses'):
 159- curses_library = 'curses'
 160+ curses_library = "ncurses"
 161+ do_readline = True
 162+ readline_lib = 'readline'
 163
 164- if MACOS:
 165- os_release = int(os.uname()[2].split('.')[0])
 166- dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
 167- if (dep_target and
 168- (tuple(int(n) for n in dep_target.split('.')[0:2])
 169- < (10, 5) ) ):
 170- os_release = 8
 171- if os_release < 9:
 172- # MacOSX 10.4 has a broken readline. Don't try to build
 173- # the readline module unless the user has installed a fixed
 174- # readline package
 175- if find_file('readline/rlconf.h', self.inc_dirs, []) is None:
 176- do_readline = False
 177 if do_readline:
 178 if MACOS and os_release < 9:
 179 # In every directory on the search path search for a dynamic
 180@@ -1213,8 +1173,7 @@ class PyBuildExt(build_ext):
112 # If the curses module is enabled, check for the panel module 181 # If the curses module is enabled, check for the panel module
113 # _curses_panel needs some form of ncurses 182 # _curses_panel needs some form of ncurses
114 skip_curses_panel = True if AIX else False 183 skip_curses_panel = True if AIX else False
115- if (curses_enabled and not skip_curses_panel and 184- if (curses_enabled and not skip_curses_panel and
116- self.compiler.find_library_file(self.lib_dirs, panel_library)): 185- self.compiler.find_library_file(self.lib_dirs, panel_library)):
117+ if curses_enabled and not skip_curses_panel: 186+ if curses_enabled and not skip_curses_panel:
118 self.add(Extension('_curses_panel', ['_curses_panel.c'], 187 self.add(Extension('_curses_panel', ['_curses_panel.c'],
119 include_dirs=curses_includes, 188 include_dirs=curses_includes,
120 define_macros=curses_defines, 189 define_macros=curses_defines,
121@@ -1457,6 +1475,31 @@ class PyBuildExt(build_ext): 190@@ -1459,6 +1418,31 @@ class PyBuildExt(build_ext):
122 dbm_order = ['gdbm'] 191 dbm_order = ['gdbm']
123 # The standard Unix dbm module: 192 # The standard Unix dbm module:
124 if not CYGWIN: 193 if not CYGWIN:
125+ # Top half based on find_file 194+ # Top half based on find_file
126+ def find_ndbm_h(dirs): 195+ def find_ndbm_h(dirs):
127+ ret = None 196+ ret = None
128+ if MACOS: 197+ if MACOS:
129+ sysroot = macosx_sdk_root() 198+ sysroot = macosx_sdk_root()
130+ for dir in dirs: 199+ for dir in dirs:
131+ f = os.path.join(dir, 'ndbm.h') 200+ f = os.path.join(dir, 'ndbm.h')
132+ if MACOS and is_macosx_sdk_path(dir): 201+ if MACOS and is_macosx_sdk_path(dir):
133+ f = os.path.join(sysroot, dir[1:], 'ndbm.h') 202+ f = os.path.join(sysroot, dir[1:], 'ndbm.h')
134+ if not os.path.exists(f): 203+ if not os.path.exists(f):
@@ -140,43 +209,43 @@ Enable cross-build by setting sys._home  @@ -140,43 +209,43 @@ Enable cross-build by setting sys._home
140+ line = input.readline() 209+ line = input.readline()
141+ if not line: 210+ if not line:
142+ break 211+ break
143+ if re.search('This file is part of GDBM', line): 212+ if re.search('This file is part of GDBM', line):
144+ ret = None 213+ ret = None
145+ break 214+ break
146+ input.close() 215+ input.close()
147+ break 216+ break
148+ return ret 217+ return ret
149+ 218+
150 config_args = [arg.strip("'") 219 config_args = [arg.strip("'")
151 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] 220 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
152 dbm_args = [arg for arg in config_args 221 dbm_args = [arg for arg in config_args
153@@ -1468,7 +1511,7 @@ class PyBuildExt(build_ext): 222@@ -1470,7 +1454,7 @@ class PyBuildExt(build_ext):
154 dbmext = None 223 dbmext = None
155 for cand in dbm_order: 224 for cand in dbm_order:
156 if cand == "ndbm": 225 if cand == "ndbm":
157- if find_file("ndbm.h", self.inc_dirs, []) is not None: 226- if find_file("ndbm.h", self.inc_dirs, []) is not None:
158+ if find_ndbm_h(self.inc_dirs) is not None: 227+ if find_ndbm_h(self.inc_dirs) is not None:
159 # Some systems have -lndbm, others have -lgdbm_compat, 228 # Some systems have -lndbm, others have -lgdbm_compat,
160 # others don't have either 229 # others don't have either
161 if self.compiler.find_library_file(self.lib_dirs, 230 if self.compiler.find_library_file(self.lib_dirs,
162@@ -2328,10 +2371,7 @@ class PyBuildExt(build_ext): 231@@ -2333,10 +2317,7 @@ class PyBuildExt(build_ext):
163 sources = ['_decimal/_decimal.c'] 232 sources = ['_decimal/_decimal.c']
164 depends = ['_decimal/docstrings.h'] 233 depends = ['_decimal/docstrings.h']
165 else: 234 else:
166- include_dirs = [os.path.abspath(os.path.join(self.srcdir, 235- include_dirs = [os.path.abspath(os.path.join(self.srcdir,
167- 'Modules', 236- 'Modules',
168- '_decimal', 237- '_decimal',
169- 'libmpdec'))] 238- 'libmpdec'))]
170+ include_dirs = ['Modules/_decimal/libmpdec'] 239+ include_dirs = ['Modules/_decimal/libmpdec']
171 libraries = ['m'] 240 libraries = ['m']
172 sources = [ 241 sources = [
173 '_decimal/_decimal.c', 242 '_decimal/_decimal.c',
174@@ -2747,7 +2787,7 @@ def main(): 243@@ -2752,7 +2733,7 @@ def main():
175 # If you change the scripts installed here, you also need to 244 # If you change the scripts installed here, you also need to
176 # check the PyBuildScripts command above, and change the links 245 # check the PyBuildScripts command above, and change the links
177 # created by the bininstall target in Makefile.pre.in 246 # created by the bininstall target in Makefile.pre.in
178- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", 247- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
179+ scripts = ["Tools/scripts/pydoc3", 248+ scripts = ["Tools/scripts/pydoc3",
180 "Tools/scripts/2to3"] 249 "Tools/scripts/2to3"]
181 ) 250 )
182  251

cvs diff -r1.23 -r1.24 pkgsrc/lang/python311/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/python311/Makefile 2023/12/28 13:12:24 1.23
+++ pkgsrc/lang/python311/Makefile 2024/01/13 04:24:28 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.23 2023/12/28 13:12:24 thor Exp $ 1# $NetBSD: Makefile,v 1.24 2024/01/13 04:24:28 riastradh Exp $
2 2
3.include "dist.mk" 3.include "dist.mk"
4 4
5PKGNAME= python311-${PY_DISTVERSION} 5PKGNAME= python311-${PY_DISTVERSION}
6CATEGORIES= lang python 6CATEGORIES= lang python
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= https://www.python.org/ 9HOMEPAGE= https://www.python.org/
10COMMENT= Interpreted, interactive, object-oriented programming language 10COMMENT= Interpreted, interactive, object-oriented programming language
11LICENSE= python-software-foundation 11LICENSE= python-software-foundation
12 12
13CONFLICTS+= python-[0-9]* 13CONFLICTS+= python-[0-9]*
14CONFLICTS+= py311-cElementTree-[0-9]* 14CONFLICTS+= py311-cElementTree-[0-9]*
@@ -28,26 +28,27 @@ PLIST_AWK= -f ${PKGSRCDIR}/lang/python/ @@ -28,26 +28,27 @@ PLIST_AWK= -f ${PKGSRCDIR}/lang/python/
28PLIST_AWK_ENV+= PYVERS=311 28PLIST_AWK_ENV+= PYVERS=311
29PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ { 29PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ {
30PRINT_PLIST_AWK+= sub(/__pycache__\//, "") 30PRINT_PLIST_AWK+= sub(/__pycache__\//, "")
31PRINT_PLIST_AWK+= sub(/\.cpython-311/, "")} 31PRINT_PLIST_AWK+= sub(/\.cpython-311/, "")}
32PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ { 32PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.opt-1.pyc$$/ {
33PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")} 33PRINT_PLIST_AWK+= sub(/.opt-[12].pyc$$/, ".pyo")}
34 34
35USE_LANGUAGES= c c++ 35USE_LANGUAGES= c c++
36USE_TOOLS+= pkg-config 36USE_TOOLS+= pkg-config
37USE_CC_FEATURES+= c11 37USE_CC_FEATURES+= c11
38GNU_CONFIGURE= yes 38GNU_CONFIGURE= yes
39CONFIGURE_ARGS+= --enable-shared 39CONFIGURE_ARGS+= --enable-shared
40CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl} 40CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
 41CONFIGURE_ARGS+= --with-readline=readline # XXX editline?
41CONFIGURE_ARGS+= --with-system-expat 42CONFIGURE_ARGS+= --with-system-expat
42CONFIGURE_ARGS+= --with-system-ffi 43CONFIGURE_ARGS+= --with-system-ffi
43CONFIGURE_ARGS+= --without-ensurepip 44CONFIGURE_ARGS+= --without-ensurepip
44CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q} 45CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q}
45CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir} 46CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
46PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in 47PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in
47 48
48# NetBSD-8 curses has enough support for py-curses 49# NetBSD-8 curses has enough support for py-curses
49USE_CURSES= getsyx wide 50USE_CURSES= getsyx wide
50# But we build as ncurses still to get the full feature set easily 51# But we build as ncurses still to get the full feature set easily
51FAKE_NCURSES= yes 52FAKE_NCURSES= yes
52 53
53PTHREAD_OPTS+= require 54PTHREAD_OPTS+= require

cvs diff -r1.12 -r1.13 pkgsrc/lang/python311/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/python311/distinfo 2023/12/11 10:23:42 1.12
+++ pkgsrc/lang/python311/distinfo 2024/01/13 04:24:28 1.13
@@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
1$NetBSD: distinfo,v 1.12 2023/12/11 10:23:42 adam Exp $ 1$NetBSD: distinfo,v 1.13 2024/01/13 04:24:28 riastradh Exp $
2 2
3BLAKE2s (Python-3.11.7.tar.xz) = bd74ee6c5197164ba2646db27f640928e7a445fb1f6723051faa4a0d14c11549 3BLAKE2s (Python-3.11.7.tar.xz) = bd74ee6c5197164ba2646db27f640928e7a445fb1f6723051faa4a0d14c11549
4SHA512 (Python-3.11.7.tar.xz) = 11e06f2ffe1f66888cb5b4e9f607de815294d6863a77eda6ec6d7c724ef158df9f51881f4a956d4a6fa973c2fb6fd031d495e3496e9b0bb53793fb1cc8434c63 4SHA512 (Python-3.11.7.tar.xz) = 11e06f2ffe1f66888cb5b4e9f607de815294d6863a77eda6ec6d7c724ef158df9f51881f4a956d4a6fa973c2fb6fd031d495e3496e9b0bb53793fb1cc8434c63
5Size (Python-3.11.7.tar.xz) = 20074108 bytes 5Size (Python-3.11.7.tar.xz) = 20074108 bytes
6SHA1 (patch-Include_pymacro.h) = 271a891892dca1a3aaa3bedcae626a68a36cae0b 6SHA1 (patch-Include_pymacro.h) = 271a891892dca1a3aaa3bedcae626a68a36cae0b
7SHA1 (patch-Lib_ctypes_util.py) = 3dec1b6b7a36e46cbfa0dfcd71c5e7fac9f60764 7SHA1 (patch-Lib_ctypes_util.py) = 3dec1b6b7a36e46cbfa0dfcd71c5e7fac9f60764
8SHA1 (patch-Lib_distutils_unixccompiler.py) = 8a91e8f4f86517a62408c3a10ed5eb50c4091fbf 8SHA1 (patch-Lib_distutils_unixccompiler.py) = 8a91e8f4f86517a62408c3a10ed5eb50c4091fbf
9SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 593c4e93c5653ab400f0a98b91db92630c0a7390 9SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 593c4e93c5653ab400f0a98b91db92630c0a7390
10SHA1 (patch-Lib_sysconfig.py) = bc6d91bf8f7121456b26ea7f080f588c96f2596f 10SHA1 (patch-Lib_sysconfig.py) = bc6d91bf8f7121456b26ea7f080f588c96f2596f
11SHA1 (patch-Makefile.pre.in) = fdb5794d112f422a1f28aa9f8b179dc05520f9e1 11SHA1 (patch-Makefile.pre.in) = fdb5794d112f422a1f28aa9f8b179dc05520f9e1
12SHA1 (patch-configure) = a6d9a00ff160581245bc30d1b0d2ec0e9da8fb0b 12SHA1 (patch-configure) = a6d9a00ff160581245bc30d1b0d2ec0e9da8fb0b
13SHA1 (patch-setup.py) = a601ce207f5e61d15503c8781e925353d1e516b9 13SHA1 (patch-setup.py) = 874b114febf51181509593a272ad5cdd4acaf3b4

cvs diff -r1.2 -r1.3 pkgsrc/lang/python311/patches/patch-setup.py (expand / switch to unified diff)

--- pkgsrc/lang/python311/patches/patch-setup.py 2023/10/23 06:36:00 1.2
+++ pkgsrc/lang/python311/patches/patch-setup.py 2024/01/13 04:24:28 1.3
@@ -1,25 +1,28 @@ @@ -1,25 +1,28 @@
1$NetBSD: patch-setup.py,v 1.2 2023/10/23 06:36:00 wiz Exp $ 1$NetBSD: patch-setup.py,v 1.3 2024/01/13 04:24:28 riastradh Exp $
2 2
3Disable certain modules, so they can be built as separate packages. 3Disable certain modules, so they can be built as separate packages.
4Do not look for ncursesw. 4Do not look for ncursesw.
5Assume panel_library is correct; this is a fix for ncurses' gnupanel 5Assume panel_library is correct; this is a fix for ncurses' gnupanel
6which will get transformed to panel in buildlink. 6which will get transformed to panel in buildlink.
7Don't search for modules in PREFIX. Fixes build failure when py-setuptools 7Don't search for modules in PREFIX. Fixes build failure when py-setuptools
8 are installed. 8 are installed.
9Enable cross-build by setting sys._home and sys.path to build directory 9Enable cross-build by setting sys._home and sys.path to build directory
10Module _crypt might need -lcrypt (taken from Python 3.10). 10Module _crypt might need -lcrypt (taken from Python 3.10).
 11Disable circuitous readline detection which tries to outsmart pkgsrc's
 12static choice of libreadline and (fake-)ncurses and trips over its elven
 13shoelaces when cross-compiling.
11 14
12--- setup.py.orig 2022-10-24 17:35:39.000000000 +0000 15--- setup.py.orig 2023-12-04 17:56:29.000000000 +0000
13+++ setup.py 16+++ setup.py
14@@ -1,5 +1,11 @@ 17@@ -1,5 +1,11 @@
15 # Autodetecting setup.py script for building the Python extensions 18 # Autodetecting setup.py script for building the Python extensions
16  19
17+import sys 20+import sys
18+sys._home = __file__[:-len('/setup.py')] 21+sys._home = __file__[:-len('/setup.py')]
19+sys.path.append(__file__[:-len('/setup.py')] + '/Lib') 22+sys.path.append(__file__[:-len('/setup.py')] + '/Lib')
20+with open('pybuilddir.txt') as pybuilddir: 23+with open('pybuilddir.txt') as pybuilddir:
21+ sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir)) 24+ sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir))
22+ 25+
23 import argparse 26 import argparse
24 import importlib._bootstrap 27 import importlib._bootstrap
25 import importlib.machinery 28 import importlib.machinery
@@ -90,59 +93,125 @@ Module _crypt might need -lcrypt (taken  @@ -90,59 +93,125 @@ Module _crypt might need -lcrypt (taken
90 self.add_multiarch_paths() 93 self.add_multiarch_paths()
91 self.add_ldflags_cppflags() 94 self.add_ldflags_cppflags()
92  95
93@@ -899,6 +917,9 @@ class PyBuildExt(build_ext): 96@@ -899,6 +917,9 @@ class PyBuildExt(build_ext):
94 self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] 97 self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
95  98
96 if MACOS: 99 if MACOS:
97+ self.inc_dirs.append(macosx_sdk_root() + '/usr/include') 100+ self.inc_dirs.append(macosx_sdk_root() + '/usr/include')
98+ self.lib_dirs.append(macosx_sdk_root() + '/usr/lib') 101+ self.lib_dirs.append(macosx_sdk_root() + '/usr/lib')
99+ 102+
100 # This should work on any unixy platform ;-) 103 # This should work on any unixy platform ;-)
101 # If the user has bothered specifying additional -I and -L flags 104 # If the user has bothered specifying additional -I and -L flags
102 # in OPT and LDFLAGS we might as well use them here. 105 # in OPT and LDFLAGS we might as well use them here.
103@@ -1074,8 +1095,6 @@ class PyBuildExt(build_ext): 106@@ -1036,71 +1057,10 @@ class PyBuildExt(build_ext):
104 # use the same library for the readline and curses modules. 107 def detect_readline_curses(self):
105 if 'curses' in readline_termcap_library: 108 # readline
106 curses_library = readline_termcap_library 109 readline_termcap_library = ""
 110- curses_library = ""
 111- # Cannot use os.popen here in py3k.
 112- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
 113- if not os.path.exists(self.build_temp):
 114- os.makedirs(self.build_temp)
 115- # Determine if readline is already linked against curses or tinfo.
 116- if sysconfig.get_config_var('HAVE_LIBREADLINE'):
 117- if sysconfig.get_config_var('WITH_EDITLINE'):
 118- readline_lib = 'edit'
 119- else:
 120- readline_lib = 'readline'
 121- do_readline = self.compiler.find_library_file(self.lib_dirs,
 122- readline_lib)
 123- if CROSS_COMPILING:
 124- ret = run_command("%s -d %s | grep '(NEEDED)' > %s"
 125- % (sysconfig.get_config_var('READELF'),
 126- do_readline, tmpfile))
 127- elif find_executable('ldd'):
 128- ret = run_command("ldd %s > %s" % (do_readline, tmpfile))
 129- else:
 130- ret = 1
 131- if ret == 0:
 132- with open(tmpfile) as fp:
 133- for ln in fp:
 134- if 'curses' in ln:
 135- readline_termcap_library = re.sub(
 136- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
 137- ).rstrip()
 138- break
 139- # termcap interface split out from ncurses
 140- if 'tinfo' in ln:
 141- readline_termcap_library = 'tinfo'
 142- break
 143- if os.path.exists(tmpfile):
 144- os.unlink(tmpfile)
 145- else:
 146- do_readline = False
 147- # Issue 7384: If readline is already linked against curses,
 148- # use the same library for the readline and curses modules.
 149- if 'curses' in readline_termcap_library:
 150- curses_library = readline_termcap_library
107- elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'): 151- elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'):
108- curses_library = 'ncursesw' 152- curses_library = 'ncursesw'
109 # Issue 36210: OSS provided ncurses does not link on AIX 153- # Issue 36210: OSS provided ncurses does not link on AIX
110 # Use IBM supplied 'curses' for successful build of _curses 154- # Use IBM supplied 'curses' for successful build of _curses
111 elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'): 155- elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'):
112@@ -1166,8 +1185,7 @@ class PyBuildExt(build_ext): 156- curses_library = 'curses'
 157- elif self.compiler.find_library_file(self.lib_dirs, 'ncurses'):
 158- curses_library = 'ncurses'
 159- elif self.compiler.find_library_file(self.lib_dirs, 'curses'):
 160- curses_library = 'curses'
 161+ curses_library = "ncurses"
 162+ do_readline = True
 163+ readline_lib = 'readline'
 164
 165- if MACOS:
 166- os_release = int(os.uname()[2].split('.')[0])
 167- dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
 168- if (dep_target and
 169- (tuple(int(n) for n in dep_target.split('.')[0:2])
 170- < (10, 5) ) ):
 171- os_release = 8
 172- if os_release < 9:
 173- # MacOSX 10.4 has a broken readline. Don't try to build
 174- # the readline module unless the user has installed a fixed
 175- # readline package
 176- if find_file('readline/rlconf.h', self.inc_dirs, []) is None:
 177- do_readline = False
 178 if do_readline:
 179 readline_libs = [readline_lib]
 180 if readline_termcap_library:
 181@@ -1169,8 +1129,7 @@ class PyBuildExt(build_ext):
113 # If the curses module is enabled, check for the panel module 182 # If the curses module is enabled, check for the panel module
114 # _curses_panel needs some form of ncurses 183 # _curses_panel needs some form of ncurses
115 skip_curses_panel = True if AIX else False 184 skip_curses_panel = True if AIX else False
116- if (curses_enabled and not skip_curses_panel and 185- if (curses_enabled and not skip_curses_panel and
117- self.compiler.find_library_file(self.lib_dirs, panel_library)): 186- self.compiler.find_library_file(self.lib_dirs, panel_library)):
118+ if curses_enabled and not skip_curses_panel: 187+ if curses_enabled and not skip_curses_panel:
119 self.add(Extension('_curses_panel', ['_curses_panel.c'], 188 self.add(Extension('_curses_panel', ['_curses_panel.c'],
120 include_dirs=curses_includes, 189 include_dirs=curses_includes,
121 define_macros=curses_defines, 190 define_macros=curses_defines,
122@@ -1176,7 +1194,11 @@ class PyBuildExt(build_ext): 191@@ -1179,7 +1138,11 @@ class PyBuildExt(build_ext):
123 self.missing.append('_curses_panel') 192 self.missing.append('_curses_panel')
124  193
125 def detect_crypt(self): 194 def detect_crypt(self):
126- self.addext(Extension('_crypt', ['_cryptmodule.c'])) 195- self.addext(Extension('_crypt', ['_cryptmodule.c']))
127+ if self.compiler.find_library_file(self.lib_dirs, 'crypt'): 196+ if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
128+ libs = ['crypt'] 197+ libs = ['crypt']
129+ else: 198+ else:
130+ libs = [] 199+ libs = []
131+ self.addext(Extension('_crypt', ['_cryptmodule.c'], libraries=libs)) 200+ self.addext(Extension('_crypt', ['_cryptmodule.c'], libraries=libs))
132  201
133 def detect_dbm_gdbm(self): 202 def detect_dbm_gdbm(self):
134 # Modules that provide persistent dictionary-like semantics. You will 203 # Modules that provide persistent dictionary-like semantics. You will
135@@ -1199,6 +1221,31 @@ class PyBuildExt(build_ext): 204@@ -1202,6 +1165,31 @@ class PyBuildExt(build_ext):
136  205
137 # The standard Unix dbm module: 206 # The standard Unix dbm module:
138 if not CYGWIN: 207 if not CYGWIN:
139+ # Top half based on find_file 208+ # Top half based on find_file
140+ def find_ndbm_h(dirs): 209+ def find_ndbm_h(dirs):
141+ ret = None 210+ ret = None
142+ if MACOS: 211+ if MACOS:
143+ sysroot = macosx_sdk_root() 212+ sysroot = macosx_sdk_root()
144+ for dir in dirs: 213+ for dir in dirs:
145+ f = os.path.join(dir, 'ndbm.h') 214+ f = os.path.join(dir, 'ndbm.h')
146+ if MACOS and is_macosx_sdk_path(dir): 215+ if MACOS and is_macosx_sdk_path(dir):
147+ f = os.path.join(sysroot, dir[1:], 'ndbm.h') 216+ f = os.path.join(sysroot, dir[1:], 'ndbm.h')
148+ if not os.path.exists(f): 217+ if not os.path.exists(f):
@@ -154,22 +223,22 @@ Module _crypt might need -lcrypt (taken  @@ -154,22 +223,22 @@ Module _crypt might need -lcrypt (taken
154+ line = input.readline() 223+ line = input.readline()
155+ if not line: 224+ if not line:
156+ break 225+ break
157+ if re.search('This file is part of GDBM', line): 226+ if re.search('This file is part of GDBM', line):
158+ ret = None 227+ ret = None
159+ break 228+ break
160+ input.close() 229+ input.close()
161+ break 230+ break
162+ return ret 231+ return ret
163+ 232+
164 config_args = [arg.strip("'") 233 config_args = [arg.strip("'")
165 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] 234 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
166 dbm_args = [arg for arg in config_args 235 dbm_args = [arg for arg in config_args
167@@ -1616,7 +1663,7 @@ def main(): 236@@ -1619,7 +1607,7 @@ def main():
168 # If you change the scripts installed here, you also need to 237 # If you change the scripts installed here, you also need to
169 # check the PyBuildScripts command above, and change the links 238 # check the PyBuildScripts command above, and change the links
170 # created by the bininstall target in Makefile.pre.in 239 # created by the bininstall target in Makefile.pre.in
171- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", 240- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
172+ scripts = ["Tools/scripts/pydoc3", 241+ scripts = ["Tools/scripts/pydoc3",
173 "Tools/scripts/2to3"] 242 "Tools/scripts/2to3"]
174 ) 243 )
175  244

cvs diff -r1.37 -r1.38 pkgsrc/lang/python39/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/python39/distinfo 2023/11/10 09:48:39 1.37
+++ pkgsrc/lang/python39/distinfo 2024/01/13 04:24:28 1.38
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1$NetBSD: distinfo,v 1.37 2023/11/10 09:48:39 nia Exp $ 1$NetBSD: distinfo,v 1.38 2024/01/13 04:24:28 riastradh Exp $
2 2
3BLAKE2s (Python-3.9.18.tar.xz) = 429256eb52e94427ae86302633ce8b01ba42d37c44c59e89fa0ae09b721da63f 3BLAKE2s (Python-3.9.18.tar.xz) = 429256eb52e94427ae86302633ce8b01ba42d37c44c59e89fa0ae09b721da63f
4SHA512 (Python-3.9.18.tar.xz) = aab155aca757d298394eddb91ff9a8f239665bd46feb495c6b6f735bbcb7489c05c858cc4cd08f1575c24f293b33492d763e9a140d92f0b2b0cc81a165a677c7 4SHA512 (Python-3.9.18.tar.xz) = aab155aca757d298394eddb91ff9a8f239665bd46feb495c6b6f735bbcb7489c05c858cc4cd08f1575c24f293b33492d763e9a140d92f0b2b0cc81a165a677c7
5Size (Python-3.9.18.tar.xz) = 19673928 bytes 5Size (Python-3.9.18.tar.xz) = 19673928 bytes
6SHA1 (patch-Lib_ctypes_util.py) = 032cc99ebad93ddddfd89073c60424a952e3faa3 6SHA1 (patch-Lib_ctypes_util.py) = 032cc99ebad93ddddfd89073c60424a952e3faa3
7SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf 7SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf
8SHA1 (patch-Lib_distutils_unixccompiler.py) = 2e65a8dd5dd3fe25957206c062106fa7a6fc4e69 8SHA1 (patch-Lib_distutils_unixccompiler.py) = 2e65a8dd5dd3fe25957206c062106fa7a6fc4e69
9SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 5d6dab14197f27363394ff1aeee22a8ced8026d2 9SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = 5d6dab14197f27363394ff1aeee22a8ced8026d2
10SHA1 (patch-Lib_sysconfig.py) = a4f009ed73ebbd9d9c4bf7e12b7981182ed8fd7c 10SHA1 (patch-Lib_sysconfig.py) = a4f009ed73ebbd9d9c4bf7e12b7981182ed8fd7c
11SHA1 (patch-Lib_test_test__shutil.py) = 7b01da9cbfd9b7cd1bb88424d91964cf52ea72df 11SHA1 (patch-Lib_test_test__shutil.py) = 7b01da9cbfd9b7cd1bb88424d91964cf52ea72df
12SHA1 (patch-Makefile.pre.in) = dd5ff571ac9fe2dc2e41fa678261d8e3648ac908 12SHA1 (patch-Makefile.pre.in) = dd5ff571ac9fe2dc2e41fa678261d8e3648ac908
13SHA1 (patch-Modules___hashopenssl.c) = d7157254630259b2073e67a921edf0dfe151e32a 13SHA1 (patch-Modules___hashopenssl.c) = d7157254630259b2073e67a921edf0dfe151e32a
14SHA1 (patch-Modules___ssl.c) = f241ba148e4c244a641386be5ac07817b03f04f7 14SHA1 (patch-Modules___ssl.c) = f241ba148e4c244a641386be5ac07817b03f04f7
15SHA1 (patch-Modules_clinic_posixmodule.c.h) = 66ce8a2fec0ee4df7cb1f814dd4c40d144d1407f 15SHA1 (patch-Modules_clinic_posixmodule.c.h) = 66ce8a2fec0ee4df7cb1f814dd4c40d144d1407f
16SHA1 (patch-Modules_makesetup) = a06786eebffadecedba5e3a50a9785fb47613567 16SHA1 (patch-Modules_makesetup) = a06786eebffadecedba5e3a50a9785fb47613567
17SHA1 (patch-Modules_nismodule.c) = 1bafe9b06359586d027a77011b103877590d947d 17SHA1 (patch-Modules_nismodule.c) = 1bafe9b06359586d027a77011b103877590d947d
18SHA1 (patch-Modules_posixmodule.c) = cc90b73913f7759efba2e136ff04161444f49f27 18SHA1 (patch-Modules_posixmodule.c) = cc90b73913f7759efba2e136ff04161444f49f27
19SHA1 (patch-Modules_socketmodule.c) = 5c894f2291cdf0dd355671a1878863e0342207de 19SHA1 (patch-Modules_socketmodule.c) = 5c894f2291cdf0dd355671a1878863e0342207de
20SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c 20SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c
21SHA1 (patch-Python_thread__pthread.h) = 25609f722ac9c17a49023ddc6882545d9d7798ff 21SHA1 (patch-Python_thread__pthread.h) = 25609f722ac9c17a49023ddc6882545d9d7798ff
22SHA1 (patch-configure) = 944b8bb9601fd064333305778fb57997ce0ac531 22SHA1 (patch-configure) = 944b8bb9601fd064333305778fb57997ce0ac531
23SHA1 (patch-pyconfig.h.in) = 2f06af7358690b46eaff404226b898962b049a0e 23SHA1 (patch-pyconfig.h.in) = 2f06af7358690b46eaff404226b898962b049a0e
24SHA1 (patch-setup.py) = dab93079027f8ac6a259c9e683d35fe7b66c57e5 24SHA1 (patch-setup.py) = 185090e3497763ca271316b5ff4df7f1e72d1c14

cvs diff -r1.10 -r1.11 pkgsrc/lang/python39/patches/patch-setup.py (expand / switch to unified diff)

--- pkgsrc/lang/python39/patches/patch-setup.py 2023/10/23 06:36:01 1.10
+++ pkgsrc/lang/python39/patches/patch-setup.py 2024/01/13 04:24:29 1.11
@@ -1,24 +1,27 @@ @@ -1,24 +1,27 @@
1$NetBSD: patch-setup.py,v 1.10 2023/10/23 06:36:01 wiz Exp $ 1$NetBSD: patch-setup.py,v 1.11 2024/01/13 04:24:29 riastradh Exp $
2 2
3Disable certain modules, so they can be built as separate packages. 3Disable certain modules, so they can be built as separate packages.
4Do not look for ncursesw. 4Do not look for ncursesw.
5Assume panel_library is correct; this is a fix for ncurses' gnupanel 5Assume panel_library is correct; this is a fix for ncurses' gnupanel
6which will get transformed to panel in buildlink. 6which will get transformed to panel in buildlink.
7Don't search for modules in PREFIX. Fixes build failure when py-setuptools 7Don't search for modules in PREFIX. Fixes build failure when py-setuptools
8 are installed. 8 are installed.
9Enable cross-build by setting sys._home and sys.path to build directory 9Enable cross-build by setting sys._home and sys.path to build directory
 10Disable circuitous readline detection which tries to outsmart pkgsrc's
 11static choice of libreadline and (fake-)ncurses and trips over its elven
 12shoelaces when cross-compiling.
10 13
11--- setup.py.orig 2022-03-23 21:12:08.000000000 +0000 14--- setup.py.orig 2023-08-24 17:59:28.000000000 +0000
12+++ setup.py 15+++ setup.py
13@@ -1,5 +1,11 @@ 16@@ -1,5 +1,11 @@
14 # Autodetecting setup.py script for building the Python extensions 17 # Autodetecting setup.py script for building the Python extensions
15  18
16+import sys 19+import sys
17+sys._home = __file__[:-len('/setup.py')] 20+sys._home = __file__[:-len('/setup.py')]
18+sys.path.append(__file__[:-len('/setup.py')] + '/Lib') 21+sys.path.append(__file__[:-len('/setup.py')] + '/Lib')
19+with open('pybuilddir.txt') as pybuilddir: 22+with open('pybuilddir.txt') as pybuilddir:
20+ sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir)) 23+ sys.path.append(__file__[:-len('/setup.py')] + '/' + next(pybuilddir))
21+ 24+
22 import argparse 25 import argparse
23 import importlib._bootstrap 26 import importlib._bootstrap
24 import importlib.machinery 27 import importlib.machinery
@@ -90,46 +93,105 @@ Enable cross-build by setting sys._home  @@ -90,46 +93,105 @@ Enable cross-build by setting sys._home
90 self.add_multiarch_paths() 93 self.add_multiarch_paths()
91 self.add_ldflags_cppflags() 94 self.add_ldflags_cppflags()
92  95
93@@ -789,6 +806,9 @@ class PyBuildExt(build_ext): 96@@ -789,6 +806,9 @@ class PyBuildExt(build_ext):
94 self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32'] 97 self.lib_dirs += ['/usr/lib/hpux64', '/usr/lib/hpux32']
95  98
96 if MACOS: 99 if MACOS:
97+ self.inc_dirs.append(macosx_sdk_root() + '/usr/include') 100+ self.inc_dirs.append(macosx_sdk_root() + '/usr/include')
98+ self.lib_dirs.append(macosx_sdk_root() + '/usr/lib') 101+ self.lib_dirs.append(macosx_sdk_root() + '/usr/lib')
99+ 102+
100 # This should work on any unixy platform ;-) 103 # This should work on any unixy platform ;-)
101 # If the user has bothered specifying additional -I and -L flags 104 # If the user has bothered specifying additional -I and -L flags
102 # in OPT and LDFLAGS we might as well use them here. 105 # in OPT and LDFLAGS we might as well use them here.
103@@ -1006,8 +1026,6 @@ class PyBuildExt(build_ext): 106@@ -971,65 +991,10 @@ class PyBuildExt(build_ext):
104 # use the same library for the readline and curses modules. 107
105 if 'curses' in readline_termcap_library: 108 def detect_readline_curses(self):
106 curses_library = readline_termcap_library 109 # readline
 110- do_readline = self.compiler.find_library_file(self.lib_dirs, 'readline')
 111+ do_readline = True
 112 readline_termcap_library = ""
 113- curses_library = ""
 114- # Cannot use os.popen here in py3k.
 115- tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
 116- if not os.path.exists(self.build_temp):
 117- os.makedirs(self.build_temp)
 118- # Determine if readline is already linked against curses or tinfo.
 119- if do_readline:
 120- if CROSS_COMPILING:
 121- ret = run_command("%s -d %s | grep '(NEEDED)' > %s"
 122- % (sysconfig.get_config_var('READELF'),
 123- do_readline, tmpfile))
 124- elif find_executable('ldd'):
 125- ret = run_command("ldd %s > %s" % (do_readline, tmpfile))
 126- else:
 127- ret = 1
 128- if ret == 0:
 129- with open(tmpfile) as fp:
 130- for ln in fp:
 131- if 'curses' in ln:
 132- readline_termcap_library = re.sub(
 133- r'.*lib(n?cursesw?)\.so.*', r'\1', ln
 134- ).rstrip()
 135- break
 136- # termcap interface split out from ncurses
 137- if 'tinfo' in ln:
 138- readline_termcap_library = 'tinfo'
 139- break
 140- if os.path.exists(tmpfile):
 141- os.unlink(tmpfile)
 142- # Issue 7384: If readline is already linked against curses,
 143- # use the same library for the readline and curses modules.
 144- if 'curses' in readline_termcap_library:
 145- curses_library = readline_termcap_library
107- elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'): 146- elif self.compiler.find_library_file(self.lib_dirs, 'ncursesw'):
108- curses_library = 'ncursesw' 147- curses_library = 'ncursesw'
109 # Issue 36210: OSS provided ncurses does not link on AIX 148- # Issue 36210: OSS provided ncurses does not link on AIX
110 # Use IBM supplied 'curses' for successful build of _curses 149- # Use IBM supplied 'curses' for successful build of _curses
111 elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'): 150- elif AIX and self.compiler.find_library_file(self.lib_dirs, 'curses'):
112@@ -1109,8 +1127,7 @@ class PyBuildExt(build_ext): 151- curses_library = 'curses'
 152- elif self.compiler.find_library_file(self.lib_dirs, 'ncurses'):
 153- curses_library = 'ncurses'
 154- elif self.compiler.find_library_file(self.lib_dirs, 'curses'):
 155- curses_library = 'curses'
 156+ curses_library = "ncurses"
 157
 158- if MACOS:
 159- os_release = int(os.uname()[2].split('.')[0])
 160- dep_target = sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET')
 161- if (dep_target and
 162- (tuple(int(n) for n in dep_target.split('.')[0:2])
 163- < (10, 5) ) ):
 164- os_release = 8
 165- if os_release < 9:
 166- # MacOSX 10.4 has a broken readline. Don't try to build
 167- # the readline module unless the user has installed a fixed
 168- # readline package
 169- if find_file('readline/rlconf.h', self.inc_dirs, []) is None:
 170- do_readline = False
 171 if do_readline:
 172 if MACOS and os_release < 9:
 173 # In every directory on the search path search for a dynamic
 174@@ -1109,8 +1074,7 @@ class PyBuildExt(build_ext):
113 # If the curses module is enabled, check for the panel module 175 # If the curses module is enabled, check for the panel module
114 # _curses_panel needs some form of ncurses 176 # _curses_panel needs some form of ncurses
115 skip_curses_panel = True if AIX else False 177 skip_curses_panel = True if AIX else False
116- if (curses_enabled and not skip_curses_panel and 178- if (curses_enabled and not skip_curses_panel and
117- self.compiler.find_library_file(self.lib_dirs, panel_library)): 179- self.compiler.find_library_file(self.lib_dirs, panel_library)):
118+ if curses_enabled and not skip_curses_panel: 180+ if curses_enabled and not skip_curses_panel:
119 self.add(Extension('_curses_panel', ['_curses_panel.c'], 181 self.add(Extension('_curses_panel', ['_curses_panel.c'],
120 include_dirs=curses_includes, 182 include_dirs=curses_includes,
121 define_macros=curses_defines, 183 define_macros=curses_defines,
122@@ -1361,6 +1378,31 @@ class PyBuildExt(build_ext): 184@@ -1361,6 +1325,31 @@ class PyBuildExt(build_ext):
123 dbm_order = ['gdbm'] 185 dbm_order = ['gdbm']
124 # The standard Unix dbm module: 186 # The standard Unix dbm module:
125 if not CYGWIN: 187 if not CYGWIN:
126+ # Top half based on find_file 188+ # Top half based on find_file
127+ def find_ndbm_h(dirs): 189+ def find_ndbm_h(dirs):
128+ ret = None 190+ ret = None
129+ if MACOS: 191+ if MACOS:
130+ sysroot = macosx_sdk_root() 192+ sysroot = macosx_sdk_root()
131+ for dir in dirs: 193+ for dir in dirs:
132+ f = os.path.join(dir, 'ndbm.h') 194+ f = os.path.join(dir, 'ndbm.h')
133+ if MACOS and is_macosx_sdk_path(dir): 195+ if MACOS and is_macosx_sdk_path(dir):
134+ f = os.path.join(sysroot, dir[1:], 'ndbm.h') 196+ f = os.path.join(sysroot, dir[1:], 'ndbm.h')
135+ if not os.path.exists(f): 197+ if not os.path.exists(f):
@@ -141,43 +203,43 @@ Enable cross-build by setting sys._home  @@ -141,43 +203,43 @@ Enable cross-build by setting sys._home
141+ line = input.readline() 203+ line = input.readline()
142+ if not line: 204+ if not line:
143+ break 205+ break
144+ if re.search('This file is part of GDBM', line): 206+ if re.search('This file is part of GDBM', line):
145+ ret = None 207+ ret = None
146+ break 208+ break
147+ input.close() 209+ input.close()
148+ break 210+ break
149+ return ret 211+ return ret
150+ 212+
151 config_args = [arg.strip("'") 213 config_args = [arg.strip("'")
152 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()] 214 for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
153 dbm_args = [arg for arg in config_args 215 dbm_args = [arg for arg in config_args
154@@ -1372,7 +1414,7 @@ class PyBuildExt(build_ext): 216@@ -1372,7 +1361,7 @@ class PyBuildExt(build_ext):
155 dbmext = None 217 dbmext = None
156 for cand in dbm_order: 218 for cand in dbm_order:
157 if cand == "ndbm": 219 if cand == "ndbm":
158- if find_file("ndbm.h", self.inc_dirs, []) is not None: 220- if find_file("ndbm.h", self.inc_dirs, []) is not None:
159+ if find_ndbm_h(self.inc_dirs) is not None: 221+ if find_ndbm_h(self.inc_dirs) is not None:
160 # Some systems have -lndbm, others have -lgdbm_compat, 222 # Some systems have -lndbm, others have -lgdbm_compat,
161 # others don't have either 223 # others don't have either
162 if self.compiler.find_library_file(self.lib_dirs, 224 if self.compiler.find_library_file(self.lib_dirs,
163@@ -2209,10 +2251,7 @@ class PyBuildExt(build_ext): 225@@ -2209,10 +2198,7 @@ class PyBuildExt(build_ext):
164 sources = ['_decimal/_decimal.c'] 226 sources = ['_decimal/_decimal.c']
165 depends = ['_decimal/docstrings.h'] 227 depends = ['_decimal/docstrings.h']
166 else: 228 else:
167- include_dirs = [os.path.abspath(os.path.join(self.srcdir, 229- include_dirs = [os.path.abspath(os.path.join(self.srcdir,
168- 'Modules', 230- 'Modules',
169- '_decimal', 231- '_decimal',
170- 'libmpdec'))] 232- 'libmpdec'))]
171+ include_dirs = ['Modules/_decimal/libmpdec'] 233+ include_dirs = ['Modules/_decimal/libmpdec']
172 libraries = ['m'] 234 libraries = ['m']
173 sources = [ 235 sources = [
174 '_decimal/_decimal.c', 236 '_decimal/_decimal.c',
175@@ -2597,7 +2636,7 @@ def main(): 237@@ -2597,7 +2583,7 @@ def main():
176 # If you change the scripts installed here, you also need to 238 # If you change the scripts installed here, you also need to
177 # check the PyBuildScripts command above, and change the links 239 # check the PyBuildScripts command above, and change the links
178 # created by the bininstall target in Makefile.pre.in 240 # created by the bininstall target in Makefile.pre.in
179- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", 241- scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
180+ scripts = ["Tools/scripts/pydoc3", 242+ scripts = ["Tools/scripts/pydoc3",
181 "Tools/scripts/2to3"] 243 "Tools/scripts/2to3"]
182 ) 244 )
183  245