SHA256
12
0
forked from pool/wxlua

Accepting request 887318 from home:gmbr3:Lua

- Update to version 3.1.0.0+27:
  * Compilation fixed for Lua 5.4
  * wxSearchCtrl bindings updated to add `SetValue`.
  * wxSearchCtrl bindings updated to add `GetValue`.
  * wxSearchCtrl binding added.
  * Fixed compilation issue with GenericGetHeader
  * Fixed compilation with wxwidgets prior to 3.1.5
  * Updated examples to use GetBitnessName instead of GetArchName
  * Added wxBitness instead of deprecated wxArchitecture
  * Add target dependencies to bindings Makefile
  * Updated example to use proper/current SetColour method name
  * Updated wxLUA_USE_wxTranslations scope to allow encodings to
    be used independently
  * Updated wxLUA_USE* setting handling to allow overwrites
    from command line
  * Add wxLUA_USE_wxTranslations option to control
    wxTranslations compilation
  * Reorganized wxTranslations version checks in prep for
    adding wxLUA_USE check
- Removed wxMemoryBuffer.patch: merged
- Disable translations which cause build failure
- Follow shared library packaging policy
- Use Lua 5.4

OBS-URL: https://build.opensuse.org/request/show/887318
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/wxlua?expand=0&rev=12
This commit is contained in:
Matej Cepl 2021-04-21 22:28:17 +00:00 committed by Git OBS Bridge
parent aaf5350281
commit 8c1726adff
8 changed files with 138 additions and 127 deletions

16
_service Normal file
View File

@ -0,0 +1,16 @@
<services>
<service name="obs_scm" mode="manual">
<param name="scm">git</param>
<param name="url">https://github.com/pkulchenko/wxlua.git</param>
<param name="revision">a30b837fac5a812a51c57b6088551aea75482a67</param>
<param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="changesgenerate">enable</param>
</service>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="compression">xz</param>
<param name="file">*.tar</param>
</service>
<service name="set_version" mode="manual"/>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/pkulchenko/wxlua.git</param>
<param name="changesrevision">a30b837fac5a812a51c57b6088551aea75482a67</param></service></servicedata>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:85d5182eec6e7cbb8428b9c144ef7fbe364f4fed6411aafcead648893e5b6fa0
size 3232516

View File

@ -1,106 +0,0 @@
From b8e7d43a4fe1897cb4e1f7b6749ee3184d3a9011 Mon Sep 17 00:00:00 2001
Message-Id: <b8e7d43a4fe1897cb4e1f7b6749ee3184d3a9011.1593283264.git.matthias@mailaender.name>
From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= <matthias@mailaender.name>
Date: Sat, 27 Jun 2020 20:40:47 +0200
Subject: [PATCH] Fix undefined reference to `wxluatype_wxMemoryBuffer'
---
wxLua/bindings/wxwidgets/wxbase_rules.lua | 1 +
wxLua/modules/wxbind/src/wxbase_bind.cpp | 1 +
wxLua/modules/wxlua/wxlbind.cpp | 1 +
wxLua/modules/wxlua/wxlbind.h | 1 +
wxLua/modules/wxlua/wxllua.cpp | 9 +++------
5 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/wxLua/bindings/wxwidgets/wxbase_rules.lua b/wxLua/bindings/wxwidgets/wxbase_rules.lua
index 3b98165..e6b76ff 100644
--- a/wxLua/bindings/wxwidgets/wxbase_rules.lua
+++ b/wxLua/bindings/wxwidgets/wxbase_rules.lua
@@ -183,6 +183,7 @@ wxLuaBinding_class_implementation =
p_wxluatype_wxSortedArrayString = &wxluatype_wxSortedArrayString;
p_wxluatype_wxArrayInt = &wxluatype_wxArrayInt;
p_wxluatype_wxArrayDouble = &wxluatype_wxArrayDouble;
+ p_wxluatype_wxMemoryBuffer = &wxluatype_wxMemoryBuffer;
return ret;
}
diff --git a/wxLua/modules/wxbind/src/wxbase_bind.cpp b/wxLua/modules/wxbind/src/wxbase_bind.cpp
index 6be3088..d34ec0c 100644
--- a/wxLua/modules/wxbind/src/wxbase_bind.cpp
+++ b/wxLua/modules/wxbind/src/wxbase_bind.cpp
@@ -3138,6 +3138,7 @@ bool wxLuaBinding_wxbase::RegisterBinding(const wxLuaState& wxlState)
p_wxluatype_wxSortedArrayString = &wxluatype_wxSortedArrayString;
p_wxluatype_wxArrayInt = &wxluatype_wxArrayInt;
p_wxluatype_wxArrayDouble = &wxluatype_wxArrayDouble;
+ p_wxluatype_wxMemoryBuffer = &wxluatype_wxMemoryBuffer;
return ret;
}
diff --git a/wxLua/modules/wxlua/wxlbind.cpp b/wxLua/modules/wxlua/wxlbind.cpp
index c7a1ab2..abeeabf 100644
--- a/wxLua/modules/wxlua/wxlbind.cpp
+++ b/wxLua/modules/wxlua/wxlbind.cpp
@@ -55,6 +55,7 @@ int* p_wxluatype_wxArrayString = &wxluatype_TUNKNOWN;
int* p_wxluatype_wxSortedArrayString = &wxluatype_TUNKNOWN;
int* p_wxluatype_wxArrayInt = &wxluatype_TUNKNOWN;
int* p_wxluatype_wxArrayDouble = &wxluatype_TUNKNOWN;
+int* p_wxluatype_wxMemoryBuffer = &wxluatype_TUNKNOWN;
int* p_wxluatype_wxPoint = &wxluatype_TUNKNOWN;
// ----------------------------------------------------------------------------
diff --git a/wxLua/modules/wxlua/wxlbind.h b/wxLua/modules/wxlua/wxlbind.h
index 90aef63..71141ec 100644
--- a/wxLua/modules/wxlua/wxlbind.h
+++ b/wxLua/modules/wxlua/wxlbind.h
@@ -123,6 +123,7 @@ extern WXDLLIMPEXP_DATA_WXLUA(int*) p_wxluatype_wxArrayString; // wxLua type for
extern WXDLLIMPEXP_DATA_WXLUA(int*) p_wxluatype_wxSortedArrayString; // wxLua type for wxSortedArrayString
extern WXDLLIMPEXP_DATA_WXLUA(int*) p_wxluatype_wxArrayInt; // wxLua type for wxArrayInt
extern WXDLLIMPEXP_DATA_WXLUA(int*) p_wxluatype_wxArrayDouble; // wxLua type for wxArrayDouble
+extern WXDLLIMPEXP_DATA_WXLUA(int*) p_wxluatype_wxMemoryBuffer; // wxLua type for wxMemoryBuffer
extern WXDLLIMPEXP_DATA_WXLUA(int*) p_wxluatype_wxPoint; // wxLua type for wxPoint
// ----------------------------------------------------------------------------
diff --git a/wxLua/modules/wxlua/wxllua.cpp b/wxLua/modules/wxlua/wxllua.cpp
index d910816..2214b13 100644
--- a/wxLua/modules/wxlua/wxllua.cpp
+++ b/wxLua/modules/wxlua/wxllua.cpp
@@ -982,15 +982,13 @@ const wxLuaBindClass* LUACALL wxluaT_getclass(lua_State* L, const char* class_na
bool wxluaT_isuserdatatype(lua_State* L, int stack_idx, int wxl_type)
{
- extern int wxluatype_wxMemoryBuffer;
-
int stack_type = wxluaT_type(L, stack_idx);
if (wxlua_iswxuserdatatype(stack_type) &&
((wxluatype_NULL == stack_type) || // FIXME, how to check when NULL is valid or not?
((wxl_type == WXLUA_TSTRING) &&
((wxluaT_isderivedtype(L, stack_type, *p_wxluatype_wxString) >= 0) ||
- (wxluaT_isderivedtype(L, stack_type, wxluatype_wxMemoryBuffer) >= 0))) ||
+ (wxluaT_isderivedtype(L, stack_type, *p_wxluatype_wxMemoryBuffer) >= 0))) ||
(wxluaT_isderivedtype(L, stack_type, wxl_type) >= 0)))
return true;
@@ -1407,7 +1405,6 @@ const char* LUACALL wxlua_getstringtypelen(lua_State *L, int stack_idx, size_t *
return lua_tolstring(L, stack_idx, len);
else if (wxlua_iswxuserdata(L, stack_idx))
{
- extern int wxluatype_wxMemoryBuffer;
int stack_type = wxluaT_type(L, stack_idx);
if (wxluaT_isderivedtype(L, stack_type, *p_wxluatype_wxString) >= 0)
@@ -1419,9 +1416,9 @@ const char* LUACALL wxlua_getstringtypelen(lua_State *L, int stack_idx, size_t *
*len = strlen(retp);
return retp;
}
- else if (wxluaT_isderivedtype(L, stack_type, wxluatype_wxMemoryBuffer) >= 0)
+ else if (wxluaT_isderivedtype(L, stack_type, *p_wxluatype_wxMemoryBuffer) >= 0)
{
- wxMemoryBuffer * wxmem = (wxMemoryBuffer *)wxluaT_getuserdatatype(L, stack_idx, wxluatype_wxMemoryBuffer);
+ wxMemoryBuffer * wxmem = (wxMemoryBuffer *)wxluaT_getuserdatatype(L, stack_idx, *p_wxluatype_wxMemoryBuffer);
const char *datap = (const char *)wxmem->GetData();
if (len != NULL)
*len = wxmem->GetDataLen();
--
2.26.2

3
wxlua-3.1.0.0+27.obscpio Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d42d8fbccbc9b6d13d994025ab3deaaab87a072e2b84c8f88e117609dd47e302
size 21545485

View File

@ -1,3 +1,30 @@
-------------------------------------------------------------------
Wed Apr 21 13:11:01 UTC 2021 - gmbr3@opensuse.org
- Update to version 3.1.0.0+27:
* Compilation fixed for Lua 5.4
* wxSearchCtrl bindings updated to add `SetValue`.
* wxSearchCtrl bindings updated to add `GetValue`.
* wxSearchCtrl binding added.
* Fixed compilation issue with GenericGetHeader
* Fixed compilation with wxwidgets prior to 3.1.5
* Updated examples to use GetBitnessName instead of GetArchName
* Added wxBitness instead of deprecated wxArchitecture
* Add target dependencies to bindings Makefile
* Updated example to use proper/current SetColour method name
* Updated wxLUA_USE_wxTranslations scope to allow encodings to
be used independently
* Updated wxLUA_USE* setting handling to allow overwrites
from command line
* Add wxLUA_USE_wxTranslations option to control
wxTranslations compilation
* Reorganized wxTranslations version checks in prep for
adding wxLUA_USE check
- Removed wxMemoryBuffer.patch: merged
- Disable translations which cause build failure
- Follow shared library packaging policy
- Use Lua 5.4
-------------------------------------------------------------------
Sun Jun 28 09:56:25 UTC 2020 - Matthias Mailänder <mailaender@opensuse.org>

5
wxlua.obsinfo Normal file
View File

@ -0,0 +1,5 @@
name: wxlua
version: 3.1.0.0+27
mtime: 1618795125
commit: a30b837fac5a812a51c57b6088551aea75482a67

View File

@ -1,7 +1,7 @@
#
# spec file for package wxlua
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,19 +15,16 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define lua_version 5.1
%define binds webview;gl;xrc;xml;net;media;propgrid;richtext;aui;stc;html;adv;core;base
%define sover 3_1_0_0
Name: wxlua
Version: 3.0.0.8
Version: 3.1.0.0+27
Release: 0
Summary: Lua bindings for wxWidgets
License: SUSE-wxWidgets-3.1
License: GPL-2.0-or-later WITH WxWindows-exception-3.1
Group: Development/Languages/Other
URL: https://github.com/pkulchenko/wxlua
Source: https://github.com/pkulchenko/wxlua/archive/v%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/pkulchenko/wxlua/pull/64
Patch0: wxMemoryBuffer.patch
Source: %{name}-%{version}.tar.xz
BuildRequires: ccache
BuildRequires: cmake >= 2.8
BuildRequires: cppcheck
@ -35,11 +32,11 @@ BuildRequires: desktop-file-utils
BuildRequires: doxygen
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: lua51-devel
BuildRequires: lua54-devel
BuildRequires: ncurses-devel
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: wxGTK2-devel
BuildRequires: wxGTK3-devel >= 3.1.3
BuildRequires: pkgconfig(glu)
%description
@ -49,6 +46,10 @@ supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and wxWidgets 3.x
%package -n lib%{name}
Summary: Set of Lua bindings to the C++ wxWidgets cross-platform GUI library
Group: System/Libraries
Requires: libwxlua-wx31-%{sover} = %{version}
Requires: libwxlua_bind-wx31-%{sover} = %{version}
Requires: libwxlua_debug-wx31-%{sover} = %{version}
Requires: libwxlua_debugger-wx31-%{sover} = %{version}
%description -n lib%{name}
wxLua is a set of bindings to the C++ wxWidgets cross-platform GUI library for
@ -57,6 +58,51 @@ exposed to Lua, meaning that your programs can have windows, dialogs, menus,
toolbars, controls, image loading and saving, drawing, sockets, streams,
printing, clipboard access... and much more.
%package -n libwxlua-wx31-%{sover}
Summary: Lua bindings to the C++ wxWidgets cross-platform GUI library
Group: System/Libraries
%description -n libwxlua-wx31-%{sover}
wxLua is a set of bindings to the C++ wxWidgets cross-platform GUI library for
the Lua programming language. Nearly all of the functionality of wxWidgets is
exposed to Lua, meaning that your programs can have windows, dialogs, menus,
toolbars, controls, image loading and saving, drawing, sockets, streams,
printing, clipboard access... and much more.
%package -n libwxlua_bind-wx31-%{sover}
Summary: Lua bindings to the C++ wxWidgets cross-platform GUI library
Group: System/Libraries
%description -n libwxlua_bind-wx31-%{sover}
wxLua is a set of bindings to the C++ wxWidgets cross-platform GUI library for
the Lua programming language. Nearly all of the functionality of wxWidgets is
exposed to Lua, meaning that your programs can have windows, dialogs, menus,
toolbars, controls, image loading and saving, drawing, sockets, streams,
printing, clipboard access... and much more.
%package -n libwxlua_debug-wx31-%{sover}
Summary: Lua bindings to the C++ wxWidgets cross-platform GUI library
Group: System/Libraries
%description -n libwxlua_debug-wx31-%{sover}
wxLua is a set of bindings to the C++ wxWidgets cross-platform GUI library for
the Lua programming language. Nearly all of the functionality of wxWidgets is
exposed to Lua, meaning that your programs can have windows, dialogs, menus,
toolbars, controls, image loading and saving, drawing, sockets, streams,
printing, clipboard access... and much more.
%package -n libwxlua_debugger-wx31-%{sover}
Summary: Lua bindings to the C++ wxWidgets cross-platform GUI library
Group: System/Libraries
%description -n libwxlua_debugger-wx31-%{sover}
wxLua is a set of bindings to the C++ wxWidgets cross-platform GUI library for
the Lua programming language. Nearly all of the functionality of wxWidgets is
exposed to Lua, meaning that your programs can have windows, dialogs, menus,
toolbars, controls, image loading and saving, drawing, sockets, streams,
printing, clipboard access... and much more.
%package devel
Summary: Development files of lib%{name}
Group: Development/Languages/C and C++
@ -68,7 +114,6 @@ interpreter with the wxWidgets API.
%prep
%setup -q
%patch0 -p1
cd wxLua
sed -r -i 's|LIBRARY DESTINATION .*$|LIBRARY DESTINATION %{_lib}|' CMakeLists.txt
@ -76,15 +121,16 @@ sed -r -i 's|LIBRARY DESTINATION .*$|LIBRARY DESTINATION %{_lib}|' CMakeLists.tx
%build
cd wxLua/build
cmake .. \
-DCMAKE_CXX_FLAGS="-DwxLUA_USE_wxTranslations=0" \
-DwxWidgets_CONFIG_EXECUTABLE=%{_bindir}/wx-config \
-DwxLua_LUA_LIBRARY_BUILD_SHARED=TRUE \
-DwxLua_LUA_LIBRARY_USE_BUILTIN=FALSE \
-DwxLua_LUA_LIBRARY_VERSION=%{lua_version} \
-DwxLua_LUA_INCLUDE_DIR=%{lua_incdir} \
-DwxLua_LUA_LIBRARY=%{_libdir}/liblua.so.%{lua_version} \
-DwxLua_LUA_LIBRARY=%{_libdir}/liblua%{lua_version}.so.5 \
-DBUILD_SHARED_LIBS=TRUE \
-DwxWidgets_COMPONENTS="gl;xrc;xml;net;media;propgrid;richtext;aui;stc;html;adv;core;base" \
-DwxLuaBind_COMPONENTS="gl;xrc;xml;net;media;propgrid;richtext;aui;stc;html;adv;core;base" \
-DwxWidgets_COMPONENTS="%{binds}" \
-DwxLuaBind_COMPONENTS="%{binds}" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=%{_prefix}
@ -115,8 +161,16 @@ install -Dm644 distrib/autopackage/wxlua.xml %{buildroot}%{_datadir}/mime/packag
mkdir -p %{buildroot}%{_libdir}/lua/%{lua_version}/
mv %{buildroot}%{_libdir}/libwx.so %{buildroot}%{_libdir}/lua/%{lua_version}/wx.so
%post -n lib%{name} -p /sbin/ldconfig
%postun -n lib%{name} -p /sbin/ldconfig
sed 's-#!/usr/bin/env lua-#!/usr/bin/lua%{lua_version}-g' -i %{buildroot}%{_datadir}/wxlua/apps/wxluafreeze/*
%post -n libwxlua-wx31-%{sover} -p /sbin/ldconfig
%postun -n libwxlua-wx31-%{sover} -p /sbin/ldconfig
%post -n libwxlua_bind-wx31-%{sover} -p /sbin/ldconfig
%postun -n libwxlua_bind-wx31-%{sover} -p /sbin/ldconfig
%post -n libwxlua_debug-wx31-%{sover} -p /sbin/ldconfig
%postun -n libwxlua_debug-wx31-%{sover} -p /sbin/ldconfig
%post -n libwxlua_debugger-wx31-%{sover} -p /sbin/ldconfig
%postun -n libwxlua_debugger-wx31-%{sover} -p /sbin/ldconfig
%files
%{_bindir}/wxLua
@ -128,7 +182,18 @@ mv %{buildroot}%{_libdir}/libwx.so %{buildroot}%{_libdir}/lua/%{lua_version}/wx.
%files -n lib%{name}
%{_libdir}/lua/%{lua_version}/wx.so
%{_libdir}/libwxlua*.so
%files -n libwxlua-wx31-%{sover}
%{_libdir}/libwxlua-wx31*.so
%files -n libwxlua_bind-wx31-%{sover}
%{_libdir}/libwxlua_bind-wx31*.so
%files -n libwxlua_debug-wx31-%{sover}
%{_libdir}/libwxlua_debug-wx31*.so
%files -n libwxlua_debugger-wx31-%{sover}
%{_libdir}/libwxlua_debugger-wx31*.so
%files devel
%{_includedir}/wxlua/