Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gpick for openSUSE:Factory checked 
in at 2024-07-10 16:49:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gpick (Old)
 and      /work/SRC/openSUSE:Factory/.gpick.new.2080 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gpick"

Wed Jul 10 16:49:46 2024 rev:19 rq:1186464 version:0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/gpick/gpick.changes      2024-02-09 
23:52:52.080148913 +0100
+++ /work/SRC/openSUSE:Factory/.gpick.new.2080/gpick.changes    2024-07-10 
16:49:50.384332347 +0200
@@ -1,0 +2,25 @@
+Thu Jun 13 18:11:36 UTC 2024 - Joshua Smith <[email protected]>
+
+- Switch to CMake
+- Enable tests
+- Remove patches that are fixed upstream:
+  * 0001-build-support-scons-python3.patch
+  * reproducible.patch
+- Add fix-boost-184.patch: Fix builds with boost 184
+  (gh#thezbyg/gpick#227)
+- Add fix-version-check.patch: Fix path in build
+  (gh#thezbyg/gpick#215)
+- Add import-missing-scons.patch: Fix import of SCons in SConscript
+  (gh#thezbyg/gpick#216)
+- Add revert-cpp-lua.patch: Use system lua-c instead of lua-c++
+  (gh#thezbyg/gpick#217)
+- Update to 0.3:
+  Bug Fixes
+  * Fix layout switching
+  * Prevent wrong data directory selection
+  * Fix crash due to zero-length string access
+  Features
+  * Add alpha channel support
+  * Add additional converters
+
+-------------------------------------------------------------------

Old:
----
  0001-build-support-scons-python3.patch
  gpick_0.2.5.tar.gz
  reproducible.patch

New:
----
  fix-boost-184.patch
  fix-version-check.patch
  gpick-0.3.tar.gz
  import-missing-scons.patch
  revert-cpp-lua.patch

BETA DEBUG BEGIN:
  Old:- Remove patches that are fixed upstream:
  * 0001-build-support-scons-python3.patch
  * reproducible.patch
  Old:  * 0001-build-support-scons-python3.patch
  * reproducible.patch
- Add fix-boost-184.patch: Fix builds with boost 184
BETA DEBUG END:

BETA DEBUG BEGIN:
  New:  * reproducible.patch
- Add fix-boost-184.patch: Fix builds with boost 184
  (gh#thezbyg/gpick#227)
  New:  (gh#thezbyg/gpick#227)
- Add fix-version-check.patch: Fix path in build
  (gh#thezbyg/gpick#215)
  New:  (gh#thezbyg/gpick#215)
- Add import-missing-scons.patch: Fix import of SCons in SConscript
  (gh#thezbyg/gpick#216)
  New:  (gh#thezbyg/gpick#216)
- Add revert-cpp-lua.patch: Use system lua-c instead of lua-c++
  (gh#thezbyg/gpick#217)
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gpick.spec ++++++
--- /var/tmp/diff_new_pack.A4ZDzr/_old  2024-07-10 16:49:51.168361135 +0200
+++ /var/tmp/diff_new_pack.A4ZDzr/_new  2024-07-10 16:49:51.172361282 +0200
@@ -16,39 +16,44 @@
 #
 
 
+%define appname org.gpick.gpick
 Name:           gpick
-Version:        0.2.5
+Version:        0.3
 Release:        0
 Summary:        Advanced color picker writen in GTK+
 License:        BSD-3-Clause
 Group:          Productivity/Graphics/Visualization/Other
 URL:            http://www.gpick.org/
-Source0:        http://gpick.googlecode.com/files/%{name}_%{version}.tar.gz
+Source0:        
https://github.com/thezbyg/gpick/releases/download/v%{version}/%{name}-%{version}.tar.gz
 Source1:        copyright
-# PATCH-FIX-UPSTREAM reproducible.patch gh#thezbyg/gpick#138 
[email protected] -- Fix reproducible builds
-Patch0:         reproducible.patch
-# PATCH-FIX-UPSTREAM 0001-build-support-scons-python3.patch 
[email protected] -- Support scons running with python3 as interpreter
-Patch1:         0001-build-support-scons-python3.patch
-%if 0%{?suse_version} > 1325
-BuildRequires:  libboost_headers-devel
-%else
+# PATCH-FIX-UPSTREAM fix-boost-184.patch gh#thezbyg/gpick#227 
[email protected] -- Fix builds with boost
+Patch1:         fix-boost-184.patch
+# PATCH-FIX-UPSTREAM fix-version-check.patch gh#thezbyg/gpick#215 
[email protected] -- Fix path in build
+Patch2:         fix-version-check.patch
+# PATCH-FIX-UPSTREAM import-missing-scons.patch gh#thezbyg/gpick#216 
[email protected] -- Fix import of SCons
+Patch3:         import-missing-scons.patch
+# PATCH-FIX-UPSTREAM revert-cpp-lua.patch gh#thezbyg/gpick#217 
[email protected] -- Don't use nonexistant lua-c++
+Patch4:         revert-cpp-lua.patch
 BuildRequires:  boost-devel
-%endif
 BuildRequires:  expat
 BuildRequires:  flex
 BuildRequires:  gcc-c++
+BuildRequires:  libboost_filesystem-devel
+BuildRequires:  libboost_system-devel
+BuildRequires:  libboost_test-devel
 # hicolor-icon-theme BuildRequires for directory ownership
 BuildRequires:  hicolor-icon-theme
+BuildRequires:  cmake
 BuildRequires:  libexpat-devel
 BuildRequires:  pkgconfig
+BuildRequires:  ragel
 BuildRequires:  scons
 %if 0%{?suse_version}
 BuildRequires:  update-desktop-files
 %endif
 BuildRequires:  pkgconfig(dbus-glib-1)
-BuildRequires:  pkgconfig(gtk+-2.0)
-BuildRequires:  pkgconfig(lua) >= 5.2
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+BuildRequires:  pkgconfig(gtk+-3.0)
+BuildRequires:  pkgconfig(lua) >= 5.3
 
 %description
 Gpick is a featured color picker with palette creation and modification
@@ -57,19 +62,23 @@
 %lang_package
 
 %prep
-%autosetup -n %{name}_%{version} -p1
+%autosetup -p1
 
 %build
 export CFLAGS="%optflags"
 export CXXFLAGS="%optflags"
-scons %{?_smp_mflags}
+%cmake
+%cmake_build
+
+%check
+./build/tests
 
 %install
 export CFLAGS="%optflags"
 export CXXFLAGS="%optflags"
-scons install DESTDIR=%{buildroot}%{_prefix} LOCALEDIR=%{_datadir}/locale
+%cmake_install
 %if 0%{?suse_version}
-%suse_update_desktop_file %{name} Viewer
+%suse_update_desktop_file %{appname} Viewer
 %endif
 # Install copyright file. This file was given to me by the author/upstream.
 cp %{SOURCE1} COPYRIGHT
@@ -102,7 +111,9 @@
 %defattr(-,root,root)
 %doc COPYRIGHT
 %{_bindir}/%{name}
-%{_datadir}/applications/*.desktop
+%{_datadir}/applications/%{appname}.desktop
+%{_datadir}/metainfo/%{appname}.metainfo.xml
+%{_datadir}/mime/packages/%{appname}.xml
 %{_datadir}/%{name}/
 %{_datadir}/doc/%{name}/
 %{_datadir}/icons/hicolor/*/*/%{name}.*

++++++ fix-boost-184.patch ++++++
>From 69b0df86aaa63ee75725e62049f0d9c3ea782874 Mon Sep 17 00:00:00 2001
From: Sertonix <[email protected]>
Date: Tue, 11 Jun 2024 12:08:40 +0000
Subject: [PATCH] Add missing include

---
 source/dynv/Types.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source/dynv/Types.cpp b/source/dynv/Types.cpp
index 8163077..d2b1d64 100644
--- a/source/dynv/Types.cpp
+++ b/source/dynv/Types.cpp
@@ -21,6 +21,7 @@
 #include "Color.h"
 #include <algorithm>
 #include <boost/endian/conversion.hpp>
+#include <boost/version.hpp>
 namespace dynv {
 namespace xml {
 bool serialize(std::ostream &stream, const Map &map, bool addRootElement = 
true);

++++++ fix-version-check.patch ++++++
diff --git a/tools/gpick.py b/tools/gpick.py
index 8538af1..22631e8 100644
--- a/tools/gpick.py
+++ b/tools/gpick.py
@@ -156,7 +156,7 @@ class GpickEnvironment(SConsEnvironment):
                        (version, revision, hash, date) = getVersionInfo()
                except:
                        try:
-                               with open("../.version", "r", encoding = 
'utf-8') as version_file:
+                               with open(self.File('#.version').abspath, "r", 
encoding = 'utf-8') as version_file:
                                        (version, revision, hash, date) = 
version_file.read().splitlines()
                        except:
                                print("Version file \".version\" is required 
when GIT can not be used to get version information.")

++++++ import-missing-scons.patch ++++++
diff --git a/SConscript b/SConscript
index 79b3b30..20fb81b 100644
--- a/SConscript
+++ b/SConscript
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 # coding: utf-8
-import os, string, sys, shutil, math
+import os, string, sys, shutil, math, SCons.Util
 from tools import *
 
 env = GpickEnvironment(ENV = os.environ)

++++++ revert-cpp-lua.patch ++++++
>From 0a724b1ac6036f316b3e84c41908f2269cdfc907 Mon Sep 17 00:00:00 2001
From: knuxify <[email protected]>
Date: Sun, 8 May 2022 19:20:06 +0200
Subject: [PATCH] Revert "Use C++ Lua variant."

The C++ variant seems to be Ubuntu-specific from my brief research;
most sources say not to compile Lua as C++, so it probably makes no
sense to modify the lua package to support it.
---
 .azure-pipelines/ubuntu-latest.yml | 22 ++----------------
 CMakeLists.txt                     | 21 ++++++++---------
 README.md                          |  2 ++
 SConscript                         |  4 +++-
 source/ColorSpaceType.cpp          |  2 ++
 source/Converter.cpp               |  4 +++-
 source/GlobalState.cpp             |  2 ++
 source/layout/Layout.cpp           |  2 ++
 source/lua/Color.cpp               |  2 ++
 source/lua/ColorObject.cpp         |  2 ++
 source/lua/DynvSystem.cpp          |  2 ++
 source/lua/Extensions.cpp          |  2 ++
 source/lua/GlobalState.cpp         |  2 ++
 source/lua/I18N.cpp                |  2 ++
 source/lua/Layout.cpp              |  2 ++
 source/lua/Ref.cpp                 |  2 ++
 source/lua/Script.cpp              |  2 ++
 source/test/Script.cpp             | 36 ++----------------------------
 source/uiDialogOptions.cpp         |  5 ++++-
 19 files changed, 51 insertions(+), 67 deletions(-)

diff --git a/.azure-pipelines/ubuntu-latest.yml 
b/.azure-pipelines/ubuntu-latest.yml
index a9d5a09..1e76696 100644
--- a/.azure-pipelines/ubuntu-latest.yml
+++ b/.azure-pipelines/ubuntu-latest.yml
@@ -9,34 +9,16 @@ jobs:
       gcc_gtk3_lua52:
         publish_prefix: gcc-gtk3-lua52
         lua_package: liblua5.2-dev
-        compiler: g++
-        CC: gcc
-        CXX: g++
       gcc_gtk3_lua53:
         publish_prefix: gcc-gtk3-lua53
         lua_package: liblua5.3-dev
-        compiler: g++
-        CC: gcc
-        CXX: g++
-      clang_gtk3_lua52:
-        publish_prefix: clang-gtk3-lua52
-        lua_package: liblua5.2-dev
-        compiler: clang
-        CC: clang
-        CXX: clang++
-      clang_gtk3_lua53:
-        publish_prefix: clang-gtk3-lua53
-        lua_package: liblua5.3-dev
-        compiler: clang
-        CC: clang
-        CXX: clang++
   pool:
     vmImage: ubuntu-latest
   steps:
   - script: >
       sudo apt-get update && sudo apt-get install
-      $(compiler) $(lua_package) git ragel gettext libgtk-3-dev libexpat1-dev
-      libboost-test-dev
+      git ragel g++ gcc gettext libgtk-3-dev $(lua_package) libexpat1-dev
+      libboost-filesystem-dev libboost-system-dev libboost-test-dev
   - task: CMake@1
     inputs:
       workingDirectory: 'build'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb6c670..f433c95 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,12 +16,11 @@ file(GLOB SOURCES
        source/transformation/*.cpp source/transformation/*.h
        source/version/*.cpp source/version/*.h
 )
-list(REMOVE_ITEM SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/source/Color.cpp 
${CMAKE_CURRENT_SOURCE_DIR}/source/Color.h 
${CMAKE_CURRENT_SOURCE_DIR}/source/lua/Script.cpp 
${CMAKE_CURRENT_SOURCE_DIR}/source/lua/Script.h)
-
+list(REMOVE_ITEM SOURCES source/Color.cpp source/Color.h source/lua/Script.cpp 
source/lua/Script.h)
 include(Version)
 configure_file("${CMAKE_CURRENT_SOURCE_DIR}/source/version/Version.cpp.in" 
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Version.cpp" @ONLY)
 list(APPEND SOURCES 
"${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Version.cpp")
-find_package(Boost 1.58 COMPONENTS unit_test_framework REQUIRED)
+find_package(Boost 1.58 COMPONENTS filesystem system unit_test_framework 
REQUIRED)
 find_package(PkgConfig)
 if (PkgConfig_FOUND)
        if (USE_GTK3)
@@ -30,7 +29,7 @@ if (PkgConfig_FOUND)
                pkg_check_modules(GTK2 gtk+-2.0>=2.24)
                pkg_check_modules(GioUnix gio-unix-2.0>=2.24)
        endif()
-       pkg_search_module(Lua lua5.4-c++>=5.4 lua5-c++>=5.4 lua5.3-c++>=5.3 
lua5-c++>=5.3 lua-c++>=5.3 lua5.2-c++>=5.2 lua-c++>=5.2)
+       pkg_search_module(Lua lua5.4>=5.4 lua5>=5.4 lua5.3>=5.3 lua5>=5.3 
lua>=5.3 lua5.2>=5.2 lua>=5.2)
        pkg_check_modules(Expat expat>=1.0)
 endif()
 set(THREADS_PREFER_PTHREAD_FLAG ON)
@@ -81,7 +80,7 @@ function(add_gtk_options target)
 endfunction()
 
 file(GLOB MATH_SOURCES source/math/Empty.cpp)
-add_library(gpick-math OBJECT ${MATH_SOURCES})
+add_library(gpick-math STATIC ${MATH_SOURCES})
 set_compile_options(gpick-math)
 target_include_directories(gpick-math PRIVATE
        source
@@ -89,7 +88,7 @@ target_include_directories(gpick-math PRIVATE
 )
 
 file(GLOB COLOR_SOURCES source/Color.cpp source/Color.h)
-add_library(gpick-color OBJECT ${COLOR_SOURCES})
+add_library(gpick-color STATIC ${COLOR_SOURCES})
 set_compile_options(gpick-color)
 target_link_libraries(gpick-color PRIVATE gpick-math)
 target_include_directories(gpick-color PRIVATE
@@ -98,7 +97,7 @@ target_include_directories(gpick-color PRIVATE
 )
 
 file(GLOB COMMON_SOURCES source/common/*.cpp source/common/*.h)
-add_library(gpick-common OBJECT ${COMMON_SOURCES})
+add_library(gpick-common STATIC ${COMMON_SOURCES})
 set_compile_options(gpick-common)
 target_include_directories(gpick-common PRIVATE
        source
@@ -106,7 +105,7 @@ target_include_directories(gpick-common PRIVATE
 )
 
 file(GLOB DYNV_SOURCES source/dynv/*.cpp source/dynv/*.h)
-add_library(gpick-dynv OBJECT ${DYNV_SOURCES})
+add_library(gpick-dynv STATIC ${DYNV_SOURCES})
 set_compile_options(gpick-dynv)
 target_link_libraries(gpick-dynv PRIVATE gpick-color)
 target_include_directories(gpick-dynv PRIVATE
@@ -116,7 +115,7 @@ target_include_directories(gpick-dynv PRIVATE
 )
 
 file(GLOB LUA_SOURCES source/lua/Script.cpp source/lua/Script.h)
-add_library(gpick-lua OBJECT ${LUA_SOURCES})
+add_library(gpick-lua STATIC ${LUA_SOURCES})
 set_compile_options(gpick-lua)
 target_link_libraries(gpick-lua PRIVATE
        ${Lua_LIBRARIES}
@@ -130,7 +129,7 @@ target_include_directories(gpick-lua PRIVATE
 file(GLOB PARSER_SOURCES source/parser/*.cpp source/parser/*.h)
 ragel_target(text_file_parser source/parser/TextFileParser.rl 
${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TextFileParser.cpp)
 list(APPEND PARSER_SOURCES ${RAGEL_text_file_parser_OUTPUTS})
-add_library(gpick-parser OBJECT ${PARSER_SOURCES})
+add_library(gpick-parser STATIC ${PARSER_SOURCES})
 set_compile_options(gpick-parser)
 target_include_directories(gpick-parser PRIVATE
        source
@@ -168,6 +167,8 @@ target_link_libraries(gpick PRIVATE
        gpick-lua
        gpick-parser
        gpick-common
+       ${Boost_FILESYSTEM_LIBRARY}
+       ${Boost_SYSTEM_LIBRARY}
        ${Lua_LIBRARIES}
        ${Expat_LIBRARIES}
        Threads::Threads
diff --git a/README.md b/README.md
index ac87f64..d3fdd73 100644
--- a/README.md
+++ b/README.md
@@ -45,6 +45,8 @@ Expat 
([http://expat.sourceforge.net](http://expat.sourceforge.net)).
 Boost 1.71 or newer ([http://www.boost.org](http://www.boost.org)).
 Used libraries:
 
+ * Filesystem.
+ * System.
  * Interprocess.
  * Test (only when building/running tests).
 
diff --git a/SConscript b/SConscript
index 79b3b30..0bb9783 100644
--- a/SConscript
+++ b/SConscript
@@ -77,7 +77,7 @@ if not env.GetOption('clean'):
                        libs['GIO_PC'] = {'checks':{'gio-unix-2.0': '>= 
2.26.0', 'gio-2.0': '>= 2.26.0'}}
                else:
                        libs['GTK_PC'] = {'checks':{'gtk+-3.0': '>= 3.0.0'}}
-               libs['LUA_PC'] = {'checks':{'lua5.4-c++': '>= 5.4', 
'lua5.3-c++': '>= 5.3', 'lua-c++': '>= 5.2', 'lua5.2-c++': '>= 5.2'}}
+               libs['LUA_PC'] = {'checks':{'lua5.4': '>= 5.4', 'lua5.3': '>= 
5.3', 'lua': '>= 5.2', 'lua5.2': '>= 5.2'}}
        env.ConfirmLibs(conf, libs)
        env.ConfirmBoost(conf, '1.71')
        env = conf.Finish()
@@ -292,6 +292,8 @@ def buildGpick(env):
                gpick_env.Append(LIBS = ['glib-2.0', 'gtk-win32-2.0', 
'gobject-2.0', 'gdk-win32-2.0', 'cairo', 'gdk_pixbuf-2.0', 'lua5.2', 
'expat2.1', 'pango-1.0', 'pangocairo-1.0', 'intl'])
                gpick_env.Append(LINKFLAGS = ['/SUBSYSTEM:WINDOWS', 
'/ENTRY:mainCRTStartup'], CPPDEFINES = ['XML_STATIC'])
                objects += buildWindowsResources(env)
+       else:
+               gpick_env.Append(LIBS = ['boost_filesystem', 'boost_system'])
 
        if not gpick_env['BUILD_TARGET'] == 'win32':
                gpick_env.Append(LIBS = ['expat'])
diff --git a/source/ColorSpaceType.cpp b/source/ColorSpaceType.cpp
index 8f5d124..69e8fab 100644
--- a/source/ColorSpaceType.cpp
+++ b/source/ColorSpaceType.cpp
@@ -22,7 +22,9 @@
 #include "lua/Color.h"
 #include "lua/Script.h"
 #include "lua/Callbacks.h"
+extern "C"{
 #include <lua.h>
+}
 #include <iostream>
 using namespace std;
 
diff --git a/source/Converter.cpp b/source/Converter.cpp
index ee9d7d7..6847b87 100644
--- a/source/Converter.cpp
+++ b/source/Converter.cpp
@@ -33,9 +33,11 @@
 #include <vector>
 #include <iostream>
 #include <functional>
+using namespace std;
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
-using namespace std;
+}
 Converter::Converter(const char *name, const char *label, lua::Ref 
&&serialize, lua::Ref &&deserialize):
        m_name(name),
        m_label(label),
diff --git a/source/GlobalState.cpp b/source/GlobalState.cpp
index ca6542b..c848141 100644
--- a/source/GlobalState.cpp
+++ b/source/GlobalState.cpp
@@ -37,8 +37,10 @@
 #include <filesystem>
 #include <stdlib.h>
 #include <glib/gstdio.h>
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 #include <fstream>
 #include <iostream>
 struct GlobalState::Impl {
diff --git a/source/layout/Layout.cpp b/source/layout/Layout.cpp
index c81a927..c513244 100644
--- a/source/layout/Layout.cpp
+++ b/source/layout/Layout.cpp
@@ -20,8 +20,10 @@
 #include "System.h"
 #include "../lua/Layout.h"
 #include <iostream>
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 using namespace std;
 namespace layout
 {
diff --git a/source/lua/Color.cpp b/source/lua/Color.cpp
index 724831a..55475dc 100644
--- a/source/lua/Color.cpp
+++ b/source/lua/Color.cpp
@@ -18,8 +18,10 @@
 
 #include "Color.h"
 #include "../Color.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 static int newColor(lua_State *L)
diff --git a/source/lua/ColorObject.cpp b/source/lua/ColorObject.cpp
index a1971b5..2a13e26 100644
--- a/source/lua/ColorObject.cpp
+++ b/source/lua/ColorObject.cpp
@@ -20,8 +20,10 @@
 #include "Color.h"
 #include "Script.h"
 #include "../ColorObject.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 static int newColorObject(lua_State *L)
diff --git a/source/lua/DynvSystem.cpp b/source/lua/DynvSystem.cpp
index ff3508c..b7b56e5 100644
--- a/source/lua/DynvSystem.cpp
+++ b/source/lua/DynvSystem.cpp
@@ -17,8 +17,10 @@
  */
 
 #include "DynvSystem.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua {
 dynv::Ref checkDynvSystem(lua_State *L, int index) {
        void *ud = luaL_checkudata(L, index, "dynvSystem");
diff --git a/source/lua/Extensions.cpp b/source/lua/Extensions.cpp
index 62c6c1b..e17d05e 100644
--- a/source/lua/Extensions.cpp
+++ b/source/lua/Extensions.cpp
@@ -31,8 +31,10 @@
 #include "../Converters.h"
 #include "../Converter.h"
 #include "version/Version.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 static void checkArgumentIsFunctionOrNil(lua_State *L, int index)
diff --git a/source/lua/GlobalState.cpp b/source/lua/GlobalState.cpp
index 8908538..d125f68 100644
--- a/source/lua/GlobalState.cpp
+++ b/source/lua/GlobalState.cpp
@@ -18,8 +18,10 @@
 
 #include "GlobalState.h"
 #include "../GlobalState.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 void setGlobalState(lua_State *L, GlobalState &global_state)
diff --git a/source/lua/I18N.cpp b/source/lua/I18N.cpp
index 6791c97..d59ce3f 100644
--- a/source/lua/I18N.cpp
+++ b/source/lua/I18N.cpp
@@ -18,8 +18,10 @@
 
 #include "I18N.h"
 #include "../I18N.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 int getText(lua_State *L)
diff --git a/source/lua/Layout.cpp b/source/lua/Layout.cpp
index be83686..b9dfc8d 100644
--- a/source/lua/Layout.cpp
+++ b/source/lua/Layout.cpp
@@ -23,8 +23,10 @@
 #include "../layout/Box.h"
 #include "../layout/System.h"
 #include "../layout/Layout.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 #include <typeinfo>
 #include <iostream>
 using namespace std;
diff --git a/source/lua/Ref.cpp b/source/lua/Ref.cpp
index 9b1acc7..fced0cc 100644
--- a/source/lua/Ref.cpp
+++ b/source/lua/Ref.cpp
@@ -17,8 +17,10 @@
  */
 
 #include "Ref.h"
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 namespace lua
 {
 Ref::Ref():
diff --git a/source/lua/Script.cpp b/source/lua/Script.cpp
index a39e3eb..50f31d2 100644
--- a/source/lua/Script.cpp
+++ b/source/lua/Script.cpp
@@ -18,8 +18,10 @@
 
 #include "Script.h"
 #include <sstream>
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
+}
 #include <iostream>
 using namespace std;
 namespace lua
diff --git a/source/test/Script.cpp b/source/test/Script.cpp
index 8fdeaa9..498a9eb 100644
--- a/source/test/Script.cpp
+++ b/source/test/Script.cpp
@@ -18,25 +18,15 @@
 
 #include <boost/test/unit_test.hpp>
 #include "lua/Script.h"
-#include "common/Scoped.h"
+extern "C" {
 #include <lualib.h>
 #include <lauxlib.h>
+}
 using namespace lua;
 static int test(lua_State *L) {
        lua_pushstring(L, "ok");
        return 1;
 }
-static int error(lua_State *L) {
-       lua_getglobal(L, "cleanupOnError");
-       auto &cleanupOnError = *reinterpret_cast<bool *>(lua_touserdata(L, -1));
-       lua_pop(L, 1);
-       common::Scoped<std::function<void()>> 
callOnScopeEnd([&cleanupOnError]() {
-               cleanupOnError = true;
-       });
-       luaL_error(L, "error");
-       return 0;
-}
-BOOST_AUTO_TEST_SUITE(script)
 BOOST_AUTO_TEST_CASE(register_extension) {
        Script script;
        bool status = script.registerExtension("test", [](Script &script) {
@@ -72,25 +62,3 @@ BOOST_AUTO_TEST_CASE(register_nullptr_extension) {
        std::string returnValue = script.getString(-1);
        BOOST_CHECK(returnValue == "ok");
 }
-BOOST_AUTO_TEST_CASE(error_handling) {
-       Script script;
-       lua_State *L = script;
-       bool cleanupOnError = false;
-       lua_pushlightuserdata(L, &cleanupOnError);
-       lua_setglobal(L, "cleanupOnError");
-       bool status = script.registerExtension("test", [](Script &script) {
-               static const struct luaL_Reg functions[] = {
-                       { "error", error },
-                       { nullptr, nullptr }
-               };
-               luaL_newlib(script, functions);
-               return 1;
-       });
-       BOOST_CHECK(status == true);
-       status = script.loadCode("test = require(\"gpick/test\")\nreturn 
test.error()");
-       BOOST_CHECK(status == true);
-       status = script.run(0, 0);
-       BOOST_CHECK(status == false);
-       BOOST_CHECK(cleanupOnError == true);
-}
-BOOST_AUTO_TEST_SUITE_END()
diff --git a/source/uiDialogOptions.cpp b/source/uiDialogOptions.cpp
index e70debb..7a2e53c 100644
--- a/source/uiDialogOptions.cpp
+++ b/source/uiDialogOptions.cpp
@@ -28,9 +28,12 @@
 #include "lua/Callbacks.h"
 #include <string>
 #include <iostream>
+using namespace std;
+extern "C"{
 #include <lualib.h>
 #include <lauxlib.h>
-using namespace std;
+}
+
 static const struct{
        const char *label;
        const char *setting;
-- 
2.36.0

Reply via email to