aports/testing/glmark2/fix-build.patch
yzewei babfe21f6c testing/glmark2: fix build with python 3.12
https://build.alpinelinux.org/buildlogs/build-edge-loongarch64/testing/glmark2/glmark2-2023.01-r0.log

  File "/home/buildozer/aports/testing/glmark2/src/glmark2-2023.01/waflib/Context.py", line 5, in <module>
    import os,re,imp,sys
ModuleNotFoundError: No module named 'imp'

Signed-off-by: yzewei <yangzewei@loongson.cn>
2024-07-12 02:03:21 +00:00

42 lines
1.5 KiB
Diff

diff --git a/waflib/Context.py b/waflib/Context.py
index 77f310e..2c00cfc 100644
--- a/waflib/Context.py
+++ b/waflib/Context.py
@@ -2,7 +2,7 @@
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-import os,re,imp,sys
+import os,re,types,sys
from waflib import Utils,Errors,Logs
import waflib.Node
HEXVERSION=0x1090300
@@ -338,7 +338,7 @@ def load_module(path,encoding=None):
return cache_modules[path]
except KeyError:
pass
- module=imp.new_module(WSCRIPT_FILE)
+ module=types.ModuleType(WSCRIPT_FILE)
try:
code=Utils.readf(path,m='r',encoding=encoding)
except EnvironmentError:
diff --git a/wscript b/wscript
index fd4dcea..bdac47b 100644
--- a/wscript
+++ b/wscript
@@ -43,13 +43,13 @@ def options(opt):
opt.load('compiler_c')
opt.load('compiler_cxx')
- opt.add_option('--with-flavors', type = 'string', action='callback',
+ opt.add_option('--with-flavors', type = 'str', action='callback',
callback=option_list_cb,
dest = 'flavors',
help = "a list of flavors to build (%s, all-linux (except dispmanx-glesv2), all-win32)" % FLAVORS_STR)
opt.parser.set_default('flavors', [])
- opt.parser.add_option('--version-suffix', type='string', action='store', dest='versionsuffix',
+ opt.parser.add_option('--version-suffix', type='str', action='store', dest='versionsuffix',
default='', help='add a suffix to the version number')
opt.add_option('--no-debug', action='store_false', dest = 'debug',