From cdfd5f89c878a9762086e8723068860d2ca6a9c26cc5f55086a2ddf526a6d525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 2 Feb 2018 12:32:50 +0000 Subject: [PATCH] - Fix build with py3 scons: * toluapp-scons-py3.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-toluapp?expand=0&rev=17 --- lua-toluapp.changes | 6 ++++++ lua-toluapp.spec | 9 ++++++--- toluapp-scons-py3.patch | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 toluapp-scons-py3.patch diff --git a/lua-toluapp.changes b/lua-toluapp.changes index 884d646..60d8eca 100644 --- a/lua-toluapp.changes +++ b/lua-toluapp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 25 20:16:23 UTC 2018 - tchvatal@suse.com + +- Fix build with py3 scons: + * toluapp-scons-py3.patch + ------------------------------------------------------------------- Mon Oct 30 14:45:32 UTC 2017 - jmatejek@suse.com diff --git a/lua-toluapp.spec b/lua-toluapp.spec index 8adc9ef..f5fed1e 100644 --- a/lua-toluapp.spec +++ b/lua-toluapp.spec @@ -1,7 +1,7 @@ # # spec file for package lua-toluapp # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -40,6 +40,7 @@ Patch0: toluapp-libdir.patch Patch1: toluapp-versioned-shared-lib.patch Patch2: toluapp-build-compare.patch Patch3: tolua++-1.0.93-lua52.patch +Patch4: toluapp-scons-py3.patch BuildRequires: %{flavor}-devel BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -93,6 +94,7 @@ This package provides development headers for tolua++. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch4 -p1 %if "%{flavor}" != "lua51" %patch3 -p1 %endif @@ -106,6 +108,7 @@ CCFLAGS = re.split(r"\s+", os.environ['CCFLAGS']) LIBS = re.split(r"\s+", os.environ['LIBS']) prefix = "%{_prefix}" EOF +cp config_linux.py config_posix.py CCFLAGS="%{optflags} -fPIC -I%{lua_incdir}" \ LIBS="-llua -lm -ldl" \ @@ -114,7 +117,7 @@ scons %{?_smp_mflags} \ libdir="%{_libdir}" \ shared=1 \ lib bin \ - -Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC -DDATAPATH=\\\"%{lua_noarchdir}/%{name}\\\"" + -Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC -DDATAPATH=\\\"%{lua_noarchdir}/%{name}\\\"" \ %install CCFLAGS="%{optflags} -fPIC -I%{lua_incdir}" \ @@ -124,7 +127,7 @@ scons %{?_smp_mflags} \ libdir="%{buildroot}%{_libdir}" \ shared=1 \ install \ - -Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC -DDATAPATH=\\\"%{lua_noarchdir}/%{name}\\\"" + -Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC -DDATAPATH=\\\"%{lua_noarchdir}/%{name}\\\"" \ # pkgconfig file mkdir -p %{buildroot}%{_libdir}/pkgconfig diff --git a/toluapp-scons-py3.patch b/toluapp-scons-py3.patch new file mode 100644 index 0000000..f505233 --- /dev/null +++ b/toluapp-scons-py3.patch @@ -0,0 +1,34 @@ +Index: toluapp-1.0.93/SConstruct +=================================================================== +--- toluapp-1.0.93.orig/SConstruct ++++ toluapp-1.0.93/SConstruct +@@ -52,9 +52,9 @@ env['TOLUAPP_BOOTSTRAP'] = env['tolua_bi + env['build_dev'] = int(env['build_dev']) + + ## detecting the install directory on win32 +-if 'msvc' in env['TOOLS'] and not (env.has_key('prefix') or env['prefix']): ++if 'msvc' in env['TOOLS'] and not ('prefix' in env or env['prefix']): + +- if env['MSVS'].has_key('PLATFORMSDKDIR'): ++ if 'PLATFORMSDKDIR' in env['MSVS']: + env['prefix'] = env['MSVS']['PLATFORMSDKDIR'] + + +@@ -68,7 +68,7 @@ def pkg_scan_dep(self, target, source): + ## TODO: detectar si el archivo existe antes de abrirlo asi nomas + pkg = open(source, "rt") + +- for linea in pkg.xreadlines(): ++ for linea in pkg: + dep = re.search("^[\t\w]*\$[cphl]file\s*\"([^\"]+)\"", linea) + if dep: + self.Depends(target, '#' + dep.groups()[0]); +@@ -91,7 +91,7 @@ def make_tolua_code(self, target, source + tolua = 'bin\\'+self['TOLUAPP_BOOTSTRAP'] + else: + tolua = 'bin/'+self['TOLUAPP_BOOTSTRAP'] +- print("********* tolua is ", tolua) ++ print(("********* tolua is ", tolua)) + else: + if use_own: + if 'msvc' in self['TOOLS']: