Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] gpick: update to 0.3
@ 2023-01-04 11:11 pascal-huber
  2023-01-10 22:34 ` [PR REVIEW] " Piraty
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pascal-huber @ 2023-01-04 11:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

There is a new pull request by pascal-huber against master on the void-packages repository

https://github.com/pascal-huber/void-packages gpick
https://github.com/void-linux/void-packages/pull/41434

gpick: update to 0.3
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures:
  - x86_64-musl
  - aarch64 (crossbuild)
  - armv7l (crossbuild)

#### Notes
 - Adapted `cmake.patch` for (cross?) compiling arm
 - `revert-cpp-lua.patch` is from alpine (https://git.alpinelinux.org/aports/tree/community/gpick/revert-cpp-lua.patch)


A patch file from https://github.com/void-linux/void-packages/pull/41434.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gpick-41434.patch --]
[-- Type: text/x-diff, Size: 19396 bytes --]

From c074fa418554ae904c5d90d179269f7655509bd9 Mon Sep 17 00:00:00 2001
From: Pascal Huber <pascal.huber@resolved.ch>
Date: Wed, 4 Jan 2023 11:32:08 +0100
Subject: [PATCH] gpick: update to 0.3

---
 srcpkgs/gpick/patches/cmake.patch          |  30 +-
 srcpkgs/gpick/patches/revert-cpp-lua.patch | 472 +++++++++++++++++++++
 srcpkgs/gpick/template                     |   8 +-
 3 files changed, 493 insertions(+), 17 deletions(-)
 create mode 100644 srcpkgs/gpick/patches/revert-cpp-lua.patch

diff --git a/srcpkgs/gpick/patches/cmake.patch b/srcpkgs/gpick/patches/cmake.patch
index 222c22df2d5d..b50c9b5ffb17 100644
--- a/srcpkgs/gpick/patches/cmake.patch
+++ b/srcpkgs/gpick/patches/cmake.patch
@@ -6,21 +6,25 @@ Subject: [PATCH] cmake/Version: fix cross compilation.
 
 It's a CMake weirdness, sometimes it can't find files when cross compiling unless that option is added.
 ---
- cmake/Version.cmake | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
 diff --git a/cmake/Version.cmake b/cmake/Version.cmake
-index fd0487d..8cbf3c0 100644
+index e80c400..e0dac25 100644
 --- a/cmake/Version.cmake
 +++ b/cmake/Version.cmake
-@@ -1,8 +1,8 @@
- cmake_minimum_required(VERSION 2.8)
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 3.12)
  find_program(GIT_EXECUTABLE git DOC "Git version control")
  mark_as_advanced(GIT_EXECUTABLE)
--find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
--find_file(VERSION_FILE NAMES version.py PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
-+find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-+find_file(VERSION_FILE NAMES version.py PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- if (NOT VERSION_FILE)
- 	message(SEND_ERROR "Missing version file \"version.py\"")
- endif()
+-find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH)
++find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ if (GIT_EXECUTABLE AND GITDIR)
+ 	set(old_tz $ENV{TZ})
+ 	set(ENV{TZ} UTC)
+@@ -36,7 +36,7 @@ if (GIT_EXECUTABLE AND GITDIR)
+ 	list(GET version_parts 1 GPICK_BUILD_DATE)
+ 	file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/.version" "${GPICK_BUILD_VERSION}\n${GPICK_BUILD_REVISION}\n${GPICK_BUILD_HASH}\n${GPICK_BUILD_DATE}")
+ else()
+-	find_file(VERSION_FILE NAMES .version PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH)
++	find_file(VERSION_FILE NAMES .version PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ 	if (NOT VERSION_FILE)
+ 		message(FATAL_ERROR "Version file \".version\" is required when GIT can not be used to get version information.")
+ 	endif()
diff --git a/srcpkgs/gpick/patches/revert-cpp-lua.patch b/srcpkgs/gpick/patches/revert-cpp-lua.patch
new file mode 100644
index 000000000000..93e21ab87341
--- /dev/null
+++ b/srcpkgs/gpick/patches/revert-cpp-lua.patch
@@ -0,0 +1,472 @@
+From 0a724b1ac6036f316b3e84c41908f2269cdfc907 Mon Sep 17 00:00:00 2001
+From: knuxify <knuxify@gmail.com>
+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
+
diff --git a/srcpkgs/gpick/template b/srcpkgs/gpick/template
index 37a8f1664119..734b9676d06b 100644
--- a/srcpkgs/gpick/template
+++ b/srcpkgs/gpick/template
@@ -1,7 +1,7 @@
 # Template file for 'gpick'
 pkgname=gpick
-version=0.2.6
-revision=3
+version=0.3
+revision=1
 build_style=cmake
 hostmakedepends="gettext pkg-config ragel"
 makedepends="boost-devel gtk+3-devel lua52-devel expat-devel"
@@ -9,8 +9,8 @@ short_desc="Advanced color picker written in C++ using GTK+ toolkit"
 maintainer="Alexander Mamay <alexander@mamay.su>"
 license="BSD-3-Clause"
 homepage="https://github.com/thezbyg/gpick"
-distfiles="https://github.com/thezbyg/gpick/archive/${pkgname}-${version}.tar.gz"
-checksum=7d02be171cc88c44ad3e3572c0922bbabedc9d542b989f324fca9d5db3161e9c
+distfiles="https://github.com/thezbyg/gpick/releases/download/v${version}/gpick-${version}.tar.gz"
+checksum=90b03ce10d2f3e211a3f37d262596e4ae40d05cbd633aa0560d0891562c93474
 
 post_install() {
 	rm -rf ${DESTDIR}/usr/share/doc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR REVIEW] gpick: update to 0.3
  2023-01-04 11:11 [PR PATCH] gpick: update to 0.3 pascal-huber
@ 2023-01-10 22:34 ` Piraty
  2023-01-10 23:52 ` [PR PATCH] [Updated] " pascal-huber
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Piraty @ 2023-01-10 22:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 181 bytes --]

New review comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/pull/41434#discussion_r1066411638

Comment:
please state the patch source here

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Updated] gpick: update to 0.3
  2023-01-04 11:11 [PR PATCH] gpick: update to 0.3 pascal-huber
  2023-01-10 22:34 ` [PR REVIEW] " Piraty
@ 2023-01-10 23:52 ` pascal-huber
  2023-01-10 23:53 ` [PR REVIEW] " pascal-huber
  2023-01-22 20:56 ` [PR PATCH] [Merged]: " Piraty
  3 siblings, 0 replies; 5+ messages in thread
From: pascal-huber @ 2023-01-10 23:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

There is an updated pull request by pascal-huber against master on the void-packages repository

https://github.com/pascal-huber/void-packages gpick
https://github.com/void-linux/void-packages/pull/41434

gpick: update to 0.3
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures:
  - x86_64-musl
  - aarch64 (crossbuild)
  - armv7l (crossbuild)

#### Notes
 - Adapted `cmake.patch` for (cross?) compiling arm
 - `revert-cpp-lua.patch` is from alpine (https://git.alpinelinux.org/aports/tree/community/gpick/revert-cpp-lua.patch)


A patch file from https://github.com/void-linux/void-packages/pull/41434.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gpick-41434.patch --]
[-- Type: text/x-diff, Size: 19519 bytes --]

From 9ddbf4af49405160fdb2b86b097922da499bbd6f Mon Sep 17 00:00:00 2001
From: Pascal Huber <pascal.huber@resolved.ch>
Date: Wed, 4 Jan 2023 11:32:08 +0100
Subject: [PATCH] gpick: update to 0.3

---
 srcpkgs/gpick/patches/cmake.patch          |  30 +-
 srcpkgs/gpick/patches/revert-cpp-lua.patch | 473 +++++++++++++++++++++
 srcpkgs/gpick/template                     |   8 +-
 3 files changed, 494 insertions(+), 17 deletions(-)
 create mode 100644 srcpkgs/gpick/patches/revert-cpp-lua.patch

diff --git a/srcpkgs/gpick/patches/cmake.patch b/srcpkgs/gpick/patches/cmake.patch
index 222c22df2d5d..b50c9b5ffb17 100644
--- a/srcpkgs/gpick/patches/cmake.patch
+++ b/srcpkgs/gpick/patches/cmake.patch
@@ -6,21 +6,25 @@ Subject: [PATCH] cmake/Version: fix cross compilation.
 
 It's a CMake weirdness, sometimes it can't find files when cross compiling unless that option is added.
 ---
- cmake/Version.cmake | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
 diff --git a/cmake/Version.cmake b/cmake/Version.cmake
-index fd0487d..8cbf3c0 100644
+index e80c400..e0dac25 100644
 --- a/cmake/Version.cmake
 +++ b/cmake/Version.cmake
-@@ -1,8 +1,8 @@
- cmake_minimum_required(VERSION 2.8)
+@@ -1,7 +1,7 @@
+ cmake_minimum_required(VERSION 3.12)
  find_program(GIT_EXECUTABLE git DOC "Git version control")
  mark_as_advanced(GIT_EXECUTABLE)
--find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
--find_file(VERSION_FILE NAMES version.py PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
-+find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
-+find_file(VERSION_FILE NAMES version.py PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
- if (NOT VERSION_FILE)
- 	message(SEND_ERROR "Missing version file \"version.py\"")
- endif()
+-find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH)
++find_file(GITDIR NAMES .git PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ if (GIT_EXECUTABLE AND GITDIR)
+ 	set(old_tz $ENV{TZ})
+ 	set(ENV{TZ} UTC)
+@@ -36,7 +36,7 @@ if (GIT_EXECUTABLE AND GITDIR)
+ 	list(GET version_parts 1 GPICK_BUILD_DATE)
+ 	file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/.version" "${GPICK_BUILD_VERSION}\n${GPICK_BUILD_REVISION}\n${GPICK_BUILD_HASH}\n${GPICK_BUILD_DATE}")
+ else()
+-	find_file(VERSION_FILE NAMES .version PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH)
++	find_file(VERSION_FILE NAMES .version PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH NO_PACKAGE_ROOT_PATH NO_CMAKE_FIND_ROOT_PATH)
+ 	if (NOT VERSION_FILE)
+ 		message(FATAL_ERROR "Version file \".version\" is required when GIT can not be used to get version information.")
+ 	endif()
diff --git a/srcpkgs/gpick/patches/revert-cpp-lua.patch b/srcpkgs/gpick/patches/revert-cpp-lua.patch
new file mode 100644
index 000000000000..09f13d368f16
--- /dev/null
+++ b/srcpkgs/gpick/patches/revert-cpp-lua.patch
@@ -0,0 +1,473 @@
+https://git.alpinelinux.org/aports/plain/community/gpick/revert-cpp-lua.patch?id=3c7a8d560f9c2700d6a5ea52d0f451411f4b183d
+From 0a724b1ac6036f316b3e84c41908f2269cdfc907 Mon Sep 17 00:00:00 2001
+From: knuxify <knuxify@gmail.com>
+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
+
diff --git a/srcpkgs/gpick/template b/srcpkgs/gpick/template
index 37a8f1664119..734b9676d06b 100644
--- a/srcpkgs/gpick/template
+++ b/srcpkgs/gpick/template
@@ -1,7 +1,7 @@
 # Template file for 'gpick'
 pkgname=gpick
-version=0.2.6
-revision=3
+version=0.3
+revision=1
 build_style=cmake
 hostmakedepends="gettext pkg-config ragel"
 makedepends="boost-devel gtk+3-devel lua52-devel expat-devel"
@@ -9,8 +9,8 @@ short_desc="Advanced color picker written in C++ using GTK+ toolkit"
 maintainer="Alexander Mamay <alexander@mamay.su>"
 license="BSD-3-Clause"
 homepage="https://github.com/thezbyg/gpick"
-distfiles="https://github.com/thezbyg/gpick/archive/${pkgname}-${version}.tar.gz"
-checksum=7d02be171cc88c44ad3e3572c0922bbabedc9d542b989f324fca9d5db3161e9c
+distfiles="https://github.com/thezbyg/gpick/releases/download/v${version}/gpick-${version}.tar.gz"
+checksum=90b03ce10d2f3e211a3f37d262596e4ae40d05cbd633aa0560d0891562c93474
 
 post_install() {
 	rm -rf ${DESTDIR}/usr/share/doc

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR REVIEW] gpick: update to 0.3
  2023-01-04 11:11 [PR PATCH] gpick: update to 0.3 pascal-huber
  2023-01-10 22:34 ` [PR REVIEW] " Piraty
  2023-01-10 23:52 ` [PR PATCH] [Updated] " pascal-huber
@ 2023-01-10 23:53 ` pascal-huber
  2023-01-22 20:56 ` [PR PATCH] [Merged]: " Piraty
  3 siblings, 0 replies; 5+ messages in thread
From: pascal-huber @ 2023-01-10 23:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 157 bytes --]

New review comment by pascal-huber on void-packages repository

https://github.com/void-linux/void-packages/pull/41434#discussion_r1066453467

Comment:
done

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Merged]: gpick: update to 0.3
  2023-01-04 11:11 [PR PATCH] gpick: update to 0.3 pascal-huber
                   ` (2 preceding siblings ...)
  2023-01-10 23:53 ` [PR REVIEW] " pascal-huber
@ 2023-01-22 20:56 ` Piraty
  3 siblings, 0 replies; 5+ messages in thread
From: Piraty @ 2023-01-22 20:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 632 bytes --]

There's a merged pull request on the void-packages repository

gpick: update to 0.3
https://github.com/void-linux/void-packages/pull/41434

Description:
#### Testing the changes
- I tested the changes in this PR: **briefly**

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures:
  - x86_64-musl
  - aarch64 (crossbuild)
  - armv7l (crossbuild)

#### Notes
 - Adapted `cmake.patch` for (cross?) compiling arm
 - `revert-cpp-lua.patch` is from alpine (https://git.alpinelinux.org/aports/tree/community/gpick/revert-cpp-lua.patch)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-22 20:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-04 11:11 [PR PATCH] gpick: update to 0.3 pascal-huber
2023-01-10 22:34 ` [PR REVIEW] " Piraty
2023-01-10 23:52 ` [PR PATCH] [Updated] " pascal-huber
2023-01-10 23:53 ` [PR REVIEW] " pascal-huber
2023-01-22 20:56 ` [PR PATCH] [Merged]: " Piraty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).