From d5a68be7f3777ffd87ea0b3bb8bcea24374a6d18 Mon Sep 17 00:00:00 2001 From: "Andrew J. Hesford" Date: Wed, 11 Oct 2023 08:34:46 -0400 Subject: [PATCH] nodejs: fix build with Python 3.12 --- srcpkgs/nodejs/patches/python312.patch | 19 +++++++++++++++++++ srcpkgs/nodejs/template | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/nodejs/patches/python312.patch diff --git a/srcpkgs/nodejs/patches/python312.patch b/srcpkgs/nodejs/patches/python312.patch new file mode 100644 index 00000000000000..b5f1d22877f7e4 --- /dev/null +++ b/srcpkgs/nodejs/patches/python312.patch @@ -0,0 +1,19 @@ +--- ./configure.orig 2023-10-11 07:49:24.971659089 -0400 ++++ ./configure 2023-10-11 07:49:51.615780727 -0400 +@@ -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 @@ + 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: diff --git a/srcpkgs/nodejs/template b/srcpkgs/nodejs/template index 7f1a09bff0ac37..2576dbdbbbe895 100644 --- a/srcpkgs/nodejs/template +++ b/srcpkgs/nodejs/template @@ -3,7 +3,7 @@ pkgname=nodejs version=18.16.0 revision=3 # Need these for host v8 for torque, see https://github.com/nodejs/node/pull/21079 -hostmakedepends="which pkg-config python3 zlib-devel +hostmakedepends="which pkg-config python3-setuptools zlib-devel $(vopt_if icu icu-devel) $(vopt_if ssl openssl-devel) $(vopt_if libuv libuv-devel) $(vopt_if nghttp2 nghttp2-devel) $(vopt_if cares c-ares-devel)" makedepends="zlib-devel $(vopt_if icu icu-devel)