SHA256
1
0
forked from pool/lua-toluapp

Accepting request 521095 from devel:languages:lua

- Tweak the tolua++-1.0.93-lua52.patch to work with lua5.1 too correctly

OBS-URL: https://build.opensuse.org/request/show/521095
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-toluapp?expand=0&rev=2
This commit is contained in:
Dominique Leuenberger 2017-09-07 20:14:34 +00:00 committed by Git OBS Bridge
commit 9c1cc589c9
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Sep 5 10:56:14 UTC 2017 - tchvatal@suse.com
- Tweak the tolua++-1.0.93-lua52.patch to work with lua5.1 too correctly
-------------------------------------------------------------------
Fri Jul 14 11:53:09 UTC 2017 - tchvatal@suse.com

View File

@ -112,7 +112,7 @@ scons %{?_smp_mflags} \
libdir="%{_libdir}" \
shared=1 \
lib bin \
-Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC"
-Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC -DDATAPATH=\\\"%{lua_noarchdir}/%{name}\\\""
%install
CCFLAGS="%{optflags} -fPIC -I%{lua_incdir}" \
@ -122,7 +122,7 @@ scons %{?_smp_mflags} \
libdir="%{buildroot}%{_libdir}" \
shared=1 \
install \
-Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC"
-Q CCFLAGS="%{optflags} -I%{lua_incdir} -fPIC -DDATAPATH=\\\"%{lua_noarchdir}/%{name}\\\""
# pkgconfig file
mkdir -p %{buildroot}%{_libdir}/pkgconfig
@ -141,6 +141,9 @@ Libs: -ltolua++-%{lua_version}
Cflags: -I%{_includedir}
EOF
mkdir -p %{buildroot}%{lua_noarchdir}/%{name}
install -p -m 644 src/bin/lua/*.lua %{buildroot}%{lua_noarchdir}/%{name}
# update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
touch %{buildroot}%{_sysconfdir}/alternatives/tolua++
@ -163,6 +166,7 @@ fi
%ghost %{_sysconfdir}/alternatives/tolua++
%{_bindir}/tolua++
%{_bindir}/toluapp-%{lua_version}
%{lua_noarchdir}/%{name}
%files -n libtolua++-%{lua_suffix}-devel
%{_includedir}/tolua++.h

View File

@ -432,8 +432,8 @@ Index: toluapp-1.0.93/src/bin/tolua.c
- lua_pushstring(L,path); lua_setglobal(L,"path");
- strcat(path,"all.lua");
- lua_dofile(L,path);
+ lua_pushstring(L, "/usr/share/toluapp/luapp/"); lua_setglobal(L,"path");
+ if (luaL_loadfile(L, "/usr/share/toluapp/luapp/all.lua") != 0) {
+ lua_pushstring(L, DATAPATH"/"); lua_setglobal(L,"path");
+ if (luaL_loadfile(L, DATAPATH"/all.lua") != 0) {
+ fprintf(stderr, "luaL_loadfile failed\n");
+ return 1;
+ }