aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/nodejs/nodejs/0001-gyp-resolve-python-3.12-issues.patch
blob: 9d878dfb8dd0d04f8f1f94c65c385578b7f4300f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From bf8c96ba6936050ed4a0de5bc8aeeaf2b3c50dc1 Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Thu, 7 Dec 2023 12:54:30 +0100
Subject: [PATCH] gyp: resolve python 3.12 issues

Upstream has updated gyp wholesale in the main branch, so
this patch can be dropped in due time.

Upstream-Status: Inappropriate [issue will be fixed upstream with the next nodejs LTS update]

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 4 ++--
 tools/gyp/pylib/gyp/input.py                          | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
index d9699a0a..173e9465 100644
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py
+++ b/deps/npm/node_modules/node-gyp/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
 
@@ -1183,7 +1183,7 @@ def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, buil
         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
diff --git a/tools/gyp/pylib/gyp/input.py b/tools/gyp/pylib/gyp/input.py
index 354958bf..ab6112e5 100644
--- a/tools/gyp/pylib/gyp/input.py
+++ b/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_dict, false_dict, phase, variables, buil
         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
-- 
2.39.2