python{39,310}: fix the build when the work directory is in $PREFIX

As documented in pkg/56774, when WRKOBJDIR is in LOCALBASE (eg set to
${LOCALBASE}/work) then changes done to Python's setup.py made it
unable to locate its own built-in modules, then failing to bootstrap and
build.

As suggested by tnn@; tested on NetBSD/amd64.

XXX pull-up to pkgsrc-2022Q2
This commit is contained in:
khorben 2022-07-07 15:26:43 +00:00
parent b39714735e
commit 41b45b905b
4 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.16 2022/06/08 17:56:46 adam Exp $
$NetBSD: distinfo,v 1.17 2022/07/07 15:26:43 khorben Exp $
BLAKE2s (Python-3.10.5.tar.xz) = d214998206e2adac9a487633cbb436fbedf31be48e86ef7f391fe6c7854805eb
SHA512 (Python-3.10.5.tar.xz) = aa7f58a9b31de9824185b3e7bfa7da0dcf64ae9e89840664eae9d98d9048a650fa012cd5b873a62ff44b65b856db86f095c4003117406ec5e9583ec5f7e78e90
@ -13,4 +13,4 @@ SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c
SHA1 (patch-Python_thread__pthread.h) = bf1aeab011b3afedc02e68fcf5cef091b3e0aefa
SHA1 (patch-configure) = 8ffe98e51407d10e46e7d1531f2e0e0b58e1cfa6
SHA1 (patch-pyconfig.h.in) = 1ab77914315acbf0352d242ed66200bea54548f6
SHA1 (patch-setup.py) = f71085603ac5d343ee60c1d18f4f4bde0791fa6b
SHA1 (patch-setup.py) = 0fd4a3eb38b324296e6da91612048f5d2dd10995

View file

@ -1,4 +1,4 @@
$NetBSD: patch-setup.py,v 1.5 2022/04/03 10:54:52 riastradh Exp $
$NetBSD: patch-setup.py,v 1.6 2022/07/07 15:26:43 khorben Exp $
Disable certain modules, so they can be built as separate packages.
Do not look for ncursesw.
@ -26,7 +26,7 @@ Enable cross-build by setting sys._home and sys.path to build directory
from glob import glob, escape
import _osx_support
+sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/').match(p)]
+sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/lib').match(p)]
try:
import subprocess

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.29 2022/05/18 08:07:32 adam Exp $
$NetBSD: distinfo,v 1.30 2022/07/07 15:26:43 khorben Exp $
BLAKE2s (Python-3.9.13.tar.xz) = e7774bfb171b74d6ba80e11c3c49a166832ff2fe466b37e885a250cd2a62ecf4
SHA512 (Python-3.9.13.tar.xz) = e9664e7f908092df11236b22465d217531d6f0378e88d889108d19fe77f28f46ffb629b8733f84b41409e255367321893a2b1bd64518930d9d8cae5d1b774d23
@ -18,4 +18,4 @@ SHA1 (patch-Modules_socketmodule.h) = 8761c7238bc74e45adefb6e647dc3b39b7bdd81c
SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be
SHA1 (patch-configure) = 944b8bb9601fd064333305778fb57997ce0ac531
SHA1 (patch-pyconfig.h.in) = 2f06af7358690b46eaff404226b898962b049a0e
SHA1 (patch-setup.py) = 12e485a46c63bfe4da3ee6f9072bdab3694830d2
SHA1 (patch-setup.py) = 81c2ddc3a343c62e228392572d3b6c88b5f49b51

View file

@ -1,4 +1,4 @@
$NetBSD: patch-setup.py,v 1.8 2022/04/03 10:51:19 riastradh Exp $
$NetBSD: patch-setup.py,v 1.9 2022/07/07 15:26:43 khorben Exp $
Disable certain modules, so they can be built as separate packages.
Do not look for ncursesw.
@ -26,7 +26,7 @@ Enable cross-build by setting sys._home and sys.path to build directory
from glob import glob, escape
import _osx_support
+sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/').match(p)]
+sys.path = [p for p in sys.path if not re.compile('^' + sys.base_prefix + '/lib').match(p)]
try:
import subprocess