nodejs16: allow build with Python 3.12

This commit is contained in:
adam 2023-11-02 13:21:07 +00:00
parent da9f23f382
commit 5946ea6052
4 changed files with 81 additions and 1 deletions

View file

@ -1,9 +1,11 @@
$NetBSD: distinfo,v 1.13 2023/08/11 05:55:02 adam Exp $
$NetBSD: distinfo,v 1.14 2023/11/02 13:21:07 adam Exp $
BLAKE2s (node-v16.20.2.tar.xz) = eb904c033715431edcac18fe60d13173cbe3a9b5c6cd663c524e4fbf9ca686e9
SHA512 (node-v16.20.2.tar.xz) = c7953630b7d0eb832ab5a4b839c07e6505cf5f4e37853f59cd0ffc6b8742ac2ecaba20bfb47d8995ef88f3c7005bb456c1eb70cb2fc6b6fc506e1d8b81f25cb4
Size (node-v16.20.2.tar.xz) = 36834468 bytes
SHA1 (patch-common.gypi) = 15393846d9dce28f963ef66faa504d5bb3e92018
SHA1 (patch-configure) = b1ac7b6baa594bb49f04dad9705e9f38fe9ed13d
SHA1 (patch-configure.py) = 425d3fd96299fcb62136d23480aea9aefaeacc9b
SHA1 (patch-deps_cares_cares.gyp) = 22b44f2ac59963f694dfe4f4585e08960b3dec32
SHA1 (patch-deps_uv_common.gypi) = d38a9c8d9e3522f15812aec2f5b1e1e636d4bab3
SHA1 (patch-deps_uvwasi_include_wasi__serdes.h) = 32b85ef5824b96b35aba9280bbe7aa7899d9e5cf
@ -22,6 +24,7 @@ SHA1 (patch-src_crypto_crypto__rsa.cc) = 497007952507326ceba89c1d2cf76d0e7d00936
SHA1 (patch-src_inspector__agent.cc) = d3de81b0cb439731fb73339c55d33fe4f1b30ae7
SHA1 (patch-src_node__postmortem__metadata.cc) = 9938482d724ad6636af5dc3fa719ec26ed8539ff
SHA1 (patch-tools_gyp_pylib_gyp_generator_make.py) = 570fe9889767c555468a225cd7f0b398ea6a193c
SHA1 (patch-tools_gyp_pylib_gyp_input.py) = fe9a9f0e62d54e0553ebda0a305280dc70968c8e
SHA1 (patch-tools_gyp_pylib_gyp_xcode__emulation.py) = 4ee24115f5e97ffbd23aaa6dc62f408d381d4e22
SHA1 (patch-tools_install.py) = c01515e3001bebd50f12bcada548f1cc0c25a49f
SHA1 (patch-tools_v8_gypfiles_v8.gyp) = a1a40e77ee2f28d9d3dec11d6d73f2deff0d4701

View file

@ -0,0 +1,23 @@
$NetBSD: patch-configure,v 1.1 2023/11/02 13:21:07 adam Exp $
Allow build with Python 3.12.
--- configure.orig 2023-10-13 12:33:28.000000000 +0000
+++ configure
@@ -4,6 +4,7 @@
# Note that the mix of single and double quotes is intentional,
# as is the fact that the ] goes on a new line.
_=[ 'exec' '/bin/sh' '-c' '''
+command -v python3.12 >/dev/null && exec python3.12 "$0" "$@"
command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"
command -v python3.10 >/dev/null && exec python3.10 "$0" "$@"
command -v python3.9 >/dev/null && exec python3.9 "$0" "$@"
@@ -23,7 +24,7 @@ except ImportError:
from distutils.spawn import find_executable as which
print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
-acceptable_pythons = ((3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
+acceptable_pythons = ((3, 12), (3, 11), (3, 10), (3, 9), (3, 8), (3, 7), (3, 6))
if sys.version_info[:2] in acceptable_pythons:
import configure
else:

View file

@ -0,0 +1,30 @@
$NetBSD: patch-configure.py,v 1.1 2023/11/02 13:21:07 adam Exp $
Use packaging instead of deprecated distutils.
--- configure.py.orig 2023-08-08 22:32:47.000000000 +0000
+++ configure.py
@@ -14,7 +14,7 @@ import shutil
import bz2
import io
-from distutils.version import StrictVersion
+from packaging.version import Version
# If not run from node/, cd to node/.
os.chdir(os.path.dirname(__file__) or '.')
@@ -1550,10 +1550,10 @@ def configure_openssl(o):
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
openssl110_asm_supported = \
- ('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \
- ('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \
- ('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \
- ('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10'))
+ ('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \
+ ('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \
+ ('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \
+ ('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10'))
if is_x86 and not openssl110_asm_supported:
error('''Did not find a new enough assembler, install one or build with

View file

@ -0,0 +1,24 @@
$NetBSD: patch-tools_gyp_pylib_gyp_input.py,v 1.1 2023/11/02 13:21:07 adam Exp $
Use packaging instead of deprecated distutils.
--- tools/gyp/pylib/gyp/input.py.orig 2023-11-02 12:06:18.318323105 +0000
+++ tools/gyp/pylib/gyp/input.py
@@ -16,7 +16,7 @@ import subprocess
import sys
import threading
import traceback
-from distutils.version import StrictVersion
+from packaging.version import Version
from gyp.common import GypError
from gyp.common import OrderedSet
@@ -1190,7 +1190,7 @@ def EvalSingleCondition(cond_expr, true_
else:
ast_code = compile(cond_expr_expanded, "<string>", "eval")
cached_conditions_asts[cond_expr_expanded] = ast_code
- env = {"__builtins__": {}, "v": StrictVersion}
+ env = {"__builtins__": {}, "v": Version}
if eval(ast_code, env, variables):
return true_dict
return false_dict