Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 9BA6C84FB7 for ; Thu, 2 Nov 2023 13:20:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id NPvJHyPFgWbk for ; Thu, 2 Nov 2023 13:20:35 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id C27D584EC5 for ; Thu, 2 Nov 2023 13:20:35 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id BF8E5FA2A; Thu, 2 Nov 2023 13:20:35 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1698931235296440" MIME-Version: 1.0 Date: Thu, 2 Nov 2023 13:20:35 +0000 From: "Adam Ciarcinski" Subject: CVS commit: pkgsrc/lang/nodejs18 To: pkgsrc-changes@NetBSD.org Approved: commit_and_comment Reply-To: adam@netbsd.org X-Mailer: log_accum Message-Id: <20231102132035.BF8E5FA2A@cvs.NetBSD.org> This is a multi-part message in MIME format. --_----------=_1698931235296440 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: adam Date: Thu Nov 2 13:20:35 UTC 2023 Modified Files: pkgsrc/lang/nodejs18: distinfo Added Files: pkgsrc/lang/nodejs18/patches: patch-configure patch-configure.py patch-tools_gyp_pylib_gyp_input.py Log Message: nodejs18: allow build with Python 3.12 To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 pkgsrc/lang/nodejs18/distinfo cvs rdiff -u -r0 -r1.1 pkgsrc/lang/nodejs18/patches/patch-configure \ pkgsrc/lang/nodejs18/patches/patch-configure.py \ pkgsrc/lang/nodejs18/patches/patch-tools_gyp_pylib_gyp_input.py Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1698931235296440 Content-Disposition: inline Content-Length: 6219 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/lang/nodejs18/distinfo diff -u pkgsrc/lang/nodejs18/distinfo:1.13 pkgsrc/lang/nodejs18/distinfo:1.14 --- pkgsrc/lang/nodejs18/distinfo:1.13 Mon Oct 16 19:16:58 2023 +++ pkgsrc/lang/nodejs18/distinfo Thu Nov 2 13:20:35 2023 @@ -1,9 +1,11 @@ -$NetBSD: distinfo,v 1.13 2023/10/16 19:16:58 adam Exp $ +$NetBSD: distinfo,v 1.14 2023/11/02 13:20:35 adam Exp $ BLAKE2s (node-v18.18.2.tar.xz) = 2633585b4999d02882a9a41ed90e280a9f3156480a9535e62bf7a502a57e53bb SHA512 (node-v18.18.2.tar.xz) = 00af3c737d735a320481d764f1c23b1348c0454f2b9700cadb10e087feb47c75e7e9344277bb3149305c3e08ff69d9b17b0da81b1b9d9e978fd830c67858ce92 Size (node-v18.18.2.tar.xz) = 40834428 bytes SHA1 (patch-common.gypi) = 333fffbc32b36391c347c6cb9ef00d66ca5d6341 +SHA1 (patch-configure) = b1ac7b6baa594bb49f04dad9705e9f38fe9ed13d +SHA1 (patch-configure.py) = f31cd2349806d49148eeeb08b428a9b021185604 SHA1 (patch-deps_cares_cares.gyp) = 22b44f2ac59963f694dfe4f4585e08960b3dec32 SHA1 (patch-deps_uv_common.gypi) = 0a07799ec675f2426f7c2d7a7d80fd422250f260 SHA1 (patch-deps_uvwasi_include_wasi__serdes.h) = 32b85ef5824b96b35aba9280bbe7aa7899d9e5cf @@ -22,6 +24,7 @@ SHA1 (patch-src_crypto_crypto__rsa.cc) = SHA1 (patch-src_inspector__agent.cc) = 3fd3d71f9d6013a6eb2a79e0442b31d2e2408a2f 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) = 997748c6663e7931ead02ee47654933ec051e688 Added files: Index: pkgsrc/lang/nodejs18/patches/patch-configure diff -u /dev/null pkgsrc/lang/nodejs18/patches/patch-configure:1.1 --- /dev/null Thu Nov 2 13:20:35 2023 +++ pkgsrc/lang/nodejs18/patches/patch-configure Thu Nov 2 13:20:35 2023 @@ -0,0 +1,23 @@ +$NetBSD: patch-configure,v 1.1 2023/11/02 13:20:35 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: Index: pkgsrc/lang/nodejs18/patches/patch-configure.py diff -u /dev/null pkgsrc/lang/nodejs18/patches/patch-configure.py:1.1 --- /dev/null Thu Nov 2 13:20:35 2023 +++ pkgsrc/lang/nodejs18/patches/patch-configure.py Thu Nov 2 13:20:35 2023 @@ -0,0 +1,30 @@ +$NetBSD: patch-configure.py,v 1.1 2023/11/02 13:20:35 adam Exp $ + +Use packaging instead of deprecated distutils. + +--- configure.py.orig 2023-10-13 14:42:13.000000000 +0000 ++++ configure.py +@@ -14,7 +14,7 @@ import bz2 + import io + from pathlib import Path + +-from distutils.version import StrictVersion ++from packaging.version import Version + + # If not run from node/, cd to node/. + os.chdir(Path(__file__).parent) +@@ -1605,10 +1605,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 Index: pkgsrc/lang/nodejs18/patches/patch-tools_gyp_pylib_gyp_input.py diff -u /dev/null pkgsrc/lang/nodejs18/patches/patch-tools_gyp_pylib_gyp_input.py:1.1 --- /dev/null Thu Nov 2 13:20:35 2023 +++ pkgsrc/lang/nodejs18/patches/patch-tools_gyp_pylib_gyp_input.py Thu Nov 2 13:20:35 2023 @@ -0,0 +1,24 @@ +$NetBSD: patch-tools_gyp_pylib_gyp_input.py,v 1.1 2023/11/02 13:20:35 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, "", "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 --_----------=_1698931235296440--