summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-12-30 11:05:02 -0800
committerKhem Raj <raj.khem@gmail.com>2023-12-30 11:06:30 -0800
commit7d8115d5507bac6c018fbff8a7aa9bc513c2bc46 (patch)
tree4e84a85c13b917cd47eee368481521b7829c6005 /meta-multimedia/recipes-multimedia
parentc6c636e3203f987afd83ab0dda358cb636461492 (diff)
downloadmeta-openembedded-7d8115d5507bac6c018fbff8a7aa9bc513c2bc46.tar.gz
libcamera: Fix build with python 3.12
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia/recipes-multimedia')
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-mojom-Drop-using-imp-module.patch176
-rw-r--r--meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb1
2 files changed, 177 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-mojom-Drop-using-imp-module.patch b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-mojom-Drop-using-imp-module.patch
new file mode 100644
index 000000000..b07a79059
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera/0001-mojom-Drop-using-imp-module.patch
@@ -0,0 +1,176 @@
1From 23a9bbb9ab380344c5daf5bc0109fab249e41afd Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 30 Dec 2023 10:55:44 -0800
4Subject: [PATCH] mojom: Drop using imp module.
5
6This module is gone in python 3.12 onwards, in most places it is unused
7so remove from those places, in some places where its still is needed
8replace it with importlib.util
9
10Fixes [1]
11
12[1] https://bugs.libcamera.org/show_bug.cgi?id=206
13
14Upstream-Status: Submitted [https://lists.libcamera.org/pipermail/libcamera-devel/2023-December/039986.html]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 utils/ipc/mojo/public/tools/mojom/mojom/fileutil.py | 1 -
18 .../ipc/mojo/public/tools/mojom/mojom/fileutil_unittest.py | 1 -
19 .../tools/mojom/mojom/generate/generator_unittest.py | 7 ++-----
20 .../tools/mojom/mojom/generate/translate_unittest.py | 1 -
21 .../mojo/public/tools/mojom/mojom/parse/ast_unittest.py | 1 -
22 .../mojom/mojom/parse/conditional_features_unittest.py | 7 ++-----
23 utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer.py | 1 -
24 .../mojo/public/tools/mojom/mojom/parse/lexer_unittest.py | 6 ++----
25 .../mojo/public/tools/mojom/mojom/parse/parser_unittest.py | 1 -
26 9 files changed, 6 insertions(+), 20 deletions(-)
27
28diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/fileutil.py b/utils/ipc/mojo/public/tools/mojom/mojom/fileutil.py
29index bf626f54..e1c823da 100644
30--- a/utils/ipc/mojo/public/tools/mojom/mojom/fileutil.py
31+++ b/utils/ipc/mojo/public/tools/mojom/mojom/fileutil.py
32@@ -3,7 +3,6 @@
33 # found in the LICENSE file.
34
35 import errno
36-import imp
37 import os.path
38 import sys
39
40diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/fileutil_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/fileutil_unittest.py
41index ff5753a2..e754151f 100644
42--- a/utils/ipc/mojo/public/tools/mojom/mojom/fileutil_unittest.py
43+++ b/utils/ipc/mojo/public/tools/mojom/mojom/fileutil_unittest.py
44@@ -2,7 +2,6 @@
45 # Use of this source code is governed by a BSD-style license that can be
46 # found in the LICENSE file.
47
48-import imp
49 import os.path
50 import shutil
51 import sys
52diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/generate/generator_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/generate/generator_unittest.py
53index 32c884a8..6cae6092 100644
54--- a/utils/ipc/mojo/public/tools/mojom/mojom/generate/generator_unittest.py
55+++ b/utils/ipc/mojo/public/tools/mojom/mojom/generate/generator_unittest.py
56@@ -2,7 +2,7 @@
57 # Use of this source code is governed by a BSD-style license that can be
58 # found in the LICENSE file.
59
60-import imp
61+import importlib.util
62 import os.path
63 import sys
64 import unittest
65@@ -18,10 +18,7 @@ def _GetDirAbove(dirname):
66 if tail == dirname:
67 return path
68
69-
70-try:
71- imp.find_module("mojom")
72-except ImportError:
73+if importlib.util.find_spec("mojom") is None:
74 sys.path.append(os.path.join(_GetDirAbove("pylib"), "pylib"))
75 from mojom.generate import generator
76
77diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/generate/translate_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/generate/translate_unittest.py
78index 19905c8a..09724d88 100644
79--- a/utils/ipc/mojo/public/tools/mojom/mojom/generate/translate_unittest.py
80+++ b/utils/ipc/mojo/public/tools/mojom/mojom/generate/translate_unittest.py
81@@ -2,7 +2,6 @@
82 # Use of this source code is governed by a BSD-style license that can be
83 # found in the LICENSE file.
84
85-import imp
86 import os.path
87 import sys
88 import unittest
89diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/parse/ast_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/parse/ast_unittest.py
90index 62798631..4ab51033 100644
91--- a/utils/ipc/mojo/public/tools/mojom/mojom/parse/ast_unittest.py
92+++ b/utils/ipc/mojo/public/tools/mojom/mojom/parse/ast_unittest.py
93@@ -2,7 +2,6 @@
94 # Use of this source code is governed by a BSD-style license that can be
95 # found in the LICENSE file.
96
97-import imp
98 import os.path
99 import sys
100 import unittest
101diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
102index aa609be7..f3c2c95f 100644
103--- a/utils/ipc/mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
104+++ b/utils/ipc/mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
105@@ -2,7 +2,7 @@
106 # Use of this source code is governed by a BSD-style license that can be
107 # found in the LICENSE file.
108
109-import imp
110+import importlib.util
111 import os
112 import sys
113 import unittest
114@@ -18,10 +18,7 @@ def _GetDirAbove(dirname):
115 if tail == dirname:
116 return path
117
118-
119-try:
120- imp.find_module('mojom')
121-except ImportError:
122+if importlib.util.find_spec("mojom") is None:
123 sys.path.append(os.path.join(_GetDirAbove('pylib'), 'pylib'))
124 import mojom.parse.ast as ast
125 import mojom.parse.conditional_features as conditional_features
126diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer.py b/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer.py
127index 3e084bbf..1e8b49f2 100644
128--- a/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer.py
129+++ b/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer.py
130@@ -2,7 +2,6 @@
131 # Use of this source code is governed by a BSD-style license that can be
132 # found in the LICENSE file.
133
134-import imp
135 import os.path
136 import sys
137
138diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer_unittest.py
139index eadc6587..77976507 100644
140--- a/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer_unittest.py
141+++ b/utils/ipc/mojo/public/tools/mojom/mojom/parse/lexer_unittest.py
142@@ -2,7 +2,7 @@
143 # Use of this source code is governed by a BSD-style license that can be
144 # found in the LICENSE file.
145
146-import imp
147+import importlib.util
148 import os.path
149 import sys
150 import unittest
151@@ -22,9 +22,7 @@ def _GetDirAbove(dirname):
152 sys.path.insert(1, os.path.join(_GetDirAbove("mojo"), "third_party"))
153 from ply import lex
154
155-try:
156- imp.find_module("mojom")
157-except ImportError:
158+if importlib.util.find_spec("mojom") is None:
159 sys.path.append(os.path.join(_GetDirAbove("pylib"), "pylib"))
160 import mojom.parse.lexer
161
162diff --git a/utils/ipc/mojo/public/tools/mojom/mojom/parse/parser_unittest.py b/utils/ipc/mojo/public/tools/mojom/mojom/parse/parser_unittest.py
163index 6d6b7153..7e8acf43 100644
164--- a/utils/ipc/mojo/public/tools/mojom/mojom/parse/parser_unittest.py
165+++ b/utils/ipc/mojo/public/tools/mojom/mojom/parse/parser_unittest.py
166@@ -2,7 +2,6 @@
167 # Use of this source code is governed by a BSD-style license that can be
168 # found in the LICENSE file.
169
170-import imp
171 import os.path
172 import sys
173 import unittest
174--
1752.43.0
176
diff --git a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
index 2a3c6473e..c8ccff6f4 100644
--- a/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
+++ b/meta-multimedia/recipes-multimedia/libcamera/libcamera_0.1.0.bb
@@ -10,6 +10,7 @@ LIC_FILES_CHKSUM = "\
10 10
11SRC_URI = " \ 11SRC_URI = " \
12 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \ 12 git://git.libcamera.org/libcamera/libcamera.git;protocol=https;branch=master \
13 file://0001-mojom-Drop-using-imp-module.patch \
13" 14"
14 15
15SRCREV = "960d0c1e19feaf310321c906e14bd5410c6be629" 16SRCREV = "960d0c1e19feaf310321c906e14bd5410c6be629"