mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
build: fix python 3.12
This commit is contained in:
@@ -56,3 +56,4 @@ fs_fix_wtf-8_decoding_issue.patch
|
||||
stream_do_not_defer_construction_by_one_microtick.patch
|
||||
deps_disable_io_uring_support_in_libuv_by_default.patch
|
||||
src_deps_disable_setuid_etc_if_io_uring_enabled.patch
|
||||
build_fix_build_with_python_3_12.patch
|
||||
|
||||
49
patches/node/build_fix_build_with_python_3_12.patch
Normal file
49
patches/node/build_fix_build_with_python_3_12.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Luigi Pinca <luigipinca@gmail.com>
|
||||
Date: Wed, 8 Nov 2023 21:20:53 +0100
|
||||
Subject: build: fix build with Python 3.12
|
||||
|
||||
Replace `distutils.version.StrictVersion` with
|
||||
`packaging.version.Version`.
|
||||
|
||||
Refs: https://github.com/nodejs/node/pull/50209#issuecomment-1795852539
|
||||
PR-URL: https://github.com/nodejs/node/pull/50582
|
||||
Reviewed-By: Richard Lau <rlau@redhat.com>
|
||||
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
|
||||
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 926659883d3bd6d447c89a50d6770988b59d6f88..0ec6031a0a2696d7808c37b507ea16f470057f8f 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -14,8 +14,6 @@ import bz2
|
||||
import io
|
||||
from pathlib import Path
|
||||
|
||||
-from distutils.version import StrictVersion
|
||||
-
|
||||
# If not run from node/, cd to node/.
|
||||
os.chdir(Path(__file__).parent)
|
||||
|
||||
@@ -30,6 +28,7 @@ tools_path = Path('tools')
|
||||
|
||||
sys.path.insert(0, str(tools_path / 'gyp' / 'pylib'))
|
||||
from gyp.common import GetFlavor
|
||||
+from packaging.version import Version
|
||||
|
||||
# imports in tools/configure.d
|
||||
sys.path.insert(0, str(tools_path / 'configure.d'))
|
||||
@@ -1567,10 +1566,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
|
||||
Reference in New Issue
Block a user