diff --git a/srcpkgs/termbox/patches/cflags.patch b/srcpkgs/termbox/patches/cflags.patch new file mode 100644 index 00000000000..a3ca8ea2a50 --- /dev/null +++ b/srcpkgs/termbox/patches/cflags.patch @@ -0,0 +1,15 @@ +Index: termbox-1.1.2/wscript +=================================================================== +--- termbox-1.1.2.orig/wscript ++++ termbox-1.1.2/wscript +@@ -21,10 +21,6 @@ def configure(conf): + conf.load('gnu_dirs') + conf.load('compiler_c') + conf.env.append_unique('CFLAGS', ['-std=gnu99', '-Wall', '-Wextra', '-D_XOPEN_SOURCE']) +- if conf.options.debug: +- conf.env.append_unique('CFLAGS', ['-g', '-Og']) +- else: +- conf.env.append_unique('CFLAGS', '-O3') + + def build(bld): + bld.recurse('src') diff --git a/srcpkgs/termbox/patches/python-3.11.patch b/srcpkgs/termbox/patches/python-3.11.patch new file mode 100644 index 00000000000..b93020251ab --- /dev/null +++ b/srcpkgs/termbox/patches/python-3.11.patch @@ -0,0 +1,47 @@ +Index: termbox-1.1.2/.waf3/waflib/ConfigSet.py +=================================================================== +--- termbox-1.1.2.orig/.waf3/waflib/ConfigSet.py ++++ termbox-1.1.2/.waf3/waflib/ConfigSet.py +@@ -134,7 +134,7 @@ class ConfigSet(object): + Utils.writef(filename,''.join(buf)) + def load(self,filename): + tbl=self.table +- code=Utils.readf(filename,m='rU') ++ code=Utils.readf(filename,m='r') + for m in re_imp.finditer(code): + g=m.group + tbl[g(2)]=eval(g(3)) +Index: termbox-1.1.2/.waf3/waflib/Context.py +=================================================================== +--- termbox-1.1.2.orig/.waf3/waflib/Context.py ++++ termbox-1.1.2/.waf3/waflib/Context.py +@@ -113,7 +113,7 @@ class Context(ctx): + cache[node]=True + self.pre_recurse(node) + try: +- function_code=node.read('rU') ++ function_code=node.read('r') + exec(compile(function_code,node.abspath(),'exec'),self.exec_dict) + finally: + self.post_recurse(node) +@@ -321,7 +321,7 @@ def load_module(path): + pass + module=imp.new_module(WSCRIPT_FILE) + try: +- code=Utils.readf(path,m='rU') ++ code=Utils.readf(path,m='r') + except(IOError,OSError): + raise Errors.WafError('Could not read the file %r'%path) + module_dir=os.path.dirname(path) +Index: termbox-1.1.2/.waf3/waflib/Node.py +=================================================================== +--- termbox-1.1.2.orig/.waf3/waflib/Node.py ++++ termbox-1.1.2/.waf3/waflib/Node.py +@@ -282,7 +282,6 @@ class Node(object): + if maxdepth: + for k in node.ant_iter(accept=accept,maxdepth=maxdepth-1,pats=npats,dir=dir,src=src,remove=remove): + yield k +- raise StopIteration + def ant_glob(self,*k,**kw): + src=kw.get('src',True) + dir=kw.get('dir',False) diff --git a/srcpkgs/termbox/template b/srcpkgs/termbox/template index f1c4f8b2727..ac71fb48e27 100644 --- a/srcpkgs/termbox/template +++ b/srcpkgs/termbox/template @@ -10,15 +10,15 @@ homepage="https://github.com/nsf/termbox/" distfiles="https://github.com/nsf/termbox/archive/v${version}.tar.gz" checksum=61c9940b42b3ac44bf0cba67eacba75e3c02088b8c695149528c77def04d69b1 -pre_configure() { +post_extract() { # waf file is self extracting archive written in python # it self extracts in top level, then runs extracted module in __main__ # importing allows to patch contents of archive - mv waf waf.py - python3 -c 'import waf; print(waf.wafdir + "/waflib/Node.py")' > node - vsed -i "$(cat node)" -e '/raise StopIteration/d' - rm node - mv waf.py waf + cp waf waf.py + sed -i '/__name__.*__main__/i sys.exit(0)' waf.py + python3 waf.py + ln -s .waf3-* .waf3 + rm waf.py } post_install() {