summaryrefslogtreecommitdiff
path: root/dev-cpp/sol2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-07-17 19:04:28 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-07-17 19:04:28 +0100
commit514d1bbe260df2521fe60f1a3ec87cfcfde1a829 (patch)
tree555c194dbeb0fb2ac4ad3cde7c0f6a80fd330ce2 /dev-cpp/sol2
parent4df3bf9762850b34cd1ead5c80374d1a0fc3362e (diff)
gentoo resync : 17.07.2021
Diffstat (limited to 'dev-cpp/sol2')
-rw-r--r--dev-cpp/sol2/Manifest6
-rw-r--r--dev-cpp/sol2/files/sol2-3.2.2-catch-depend.patch27
-rw-r--r--dev-cpp/sol2/files/sol2-3.2.2-gcc11.patch10
-rw-r--r--dev-cpp/sol2/files/sol2-3.2.2-luajit-pkgconf.patch17
-rw-r--r--dev-cpp/sol2/metadata.xml19
-rw-r--r--dev-cpp/sol2/sol2-3.2.2.ebuild80
6 files changed, 159 insertions, 0 deletions
diff --git a/dev-cpp/sol2/Manifest b/dev-cpp/sol2/Manifest
new file mode 100644
index 000000000000..526588355b6a
--- /dev/null
+++ b/dev-cpp/sol2/Manifest
@@ -0,0 +1,6 @@
+AUX sol2-3.2.2-catch-depend.patch 910 BLAKE2B 2f4dc2a173500be6a0822f6e6e4a581facebc9f15d8a8b04151c9ec330c5c0962c5f521108fdc3681af9b74e0209505dfc9eb560076922998fc97ebc700d2c8e SHA512 a908179c944fed61cf22c5f14fb9670bf2cf2c63dd9d00ac6f5121c7058012d8dc551ad1f335d96d203152371ed98df4f18933aca7c96150b8402df2eff568bf
+AUX sol2-3.2.2-gcc11.patch 317 BLAKE2B 882fbef1e17414d81994896294aeb0e08304e310fec50f99f855391c02571117fbbb8debf9b07975a1c98063fc06560b559f75d11911ef7bf2f07d07830b810f SHA512 7936714263cccf67283afeba2d7a1ebdf3fb39cac45e3c82fd39a75b17c2f9fcb50424f476c486756a13c3235d63816a29f2e5aacebfda435cb21af07f2c51ef
+AUX sol2-3.2.2-luajit-pkgconf.patch 651 BLAKE2B 87460b8bca3281ed2d82a359225d5af072524a8b0dc1bb3d51dc17325d3863623579da25f6ffd9e696acf953ddd48525677a9b4367518b9c259cfe91a9cd7672 SHA512 bca0b431f7c63512e75aa3806a940062991077be58b7227cd042d686c0ae7446dd82adbf856d0824668ff35b86f90521e266b7738e13b4654e25c4bd0e3d2539
+DIST sol2-3.2.2.tar.gz 8531029 BLAKE2B 65fd220f5109e4917d06d5ef906ceccb7e292276f69bd49dfd826089a77e566af1811fdf660ffbfbd2437dca4b86ef5c4790dace9029805926e1ee0445b2e965 SHA512 e5a739b37aea7150f141f6a003c2689dd33155feed5bb3cf2569abbfe9f0062eacdaaf346be523d627f0e491b35e68822c80e1117fa09ece8c9d8d5af09fdbec
+EBUILD sol2-3.2.2.ebuild 1627 BLAKE2B 3614d7bfe8302da7716432d8a685e7837284863f672bde0c69e38e0eef41100cefa6c55951269eb248b70630dee89439d8d5ba0a79a71c6e950798d4238a9cfe SHA512 90ec2722fee65395d562039aed8609df9c5b17c60b3f8331bf5e177c996b6ff83ef1097b0405357ea243701b2aca09f41058c3099e3f48301e6eaa495cdc8b6e
+MISC metadata.xml 593 BLAKE2B 08278ba618676136058a0b7f07dd7ddc46c3b95dcd1f5a0c903cd6d8883ab65adf71296f3e25776c6b10fa7ab0db14b2e1cc11b9e5a68adb04dbe57d175d59d9 SHA512 bde42b613d126d4a1ef1e60ad153d816dbca9f57aca9c7f87955f629bfb6622c9f3434f2cb3f71c315d6c5fb866eb7386defdc343ce98bee56229b1f96ce3b4a
diff --git a/dev-cpp/sol2/files/sol2-3.2.2-catch-depend.patch b/dev-cpp/sol2/files/sol2-3.2.2-catch-depend.patch
new file mode 100644
index 000000000000..2da3c00c1612
--- /dev/null
+++ b/dev-cpp/sol2/files/sol2-3.2.2-catch-depend.patch
@@ -0,0 +1,27 @@
+Use catch library from system
+
+--- a/tests/runtime_tests/CMakeLists.txt
++++ b/tests/runtime_tests/CMakeLists.txt
+@@ -22,12 +22,6 @@
+
+ # # # # sol3 tests - runtime tests
+
+-if (CMAKE_GENERATOR MATCHES "Visual Studio 14 2015")
+- find_package(Catch 1.12.1 REQUIRED)
+-else()
+- find_package(Catch REQUIRED)
+-endif()
+-
+ file(GLOB SOL2_RUNTIME_TEST_SOURCES source/*.cpp)
+ source_group(test_sources FILES ${SOL2_RUNTIME_TEST_SOURCES})
+
+@@ -38,7 +32,8 @@ function(CREATE_TEST test_target_name test_name target_sol)
+ OUTPUT_NAME ${test_name}
+ EXPORT_NAME sol2::${test_name})
+ target_link_libraries(${test_target_name}
+- PUBLIC Threads::Threads ${LUA_LIBRARIES} ${CATCH_LIBRARIES} ${target_sol})
++ PUBLIC Threads::Threads ${LUA_LIBRARIES} ${target_sol})
++ target_include_directories(${test_target_name} PRIVATE ${CATCH_INC_DIR})
+
+ if (MSVC)
+ if (NOT CMAKE_COMPILER_ID MATCHES "Clang")
diff --git a/dev-cpp/sol2/files/sol2-3.2.2-gcc11.patch b/dev-cpp/sol2/files/sol2-3.2.2-gcc11.patch
new file mode 100644
index 000000000000..cc8c6bb1b4f7
--- /dev/null
+++ b/dev-cpp/sol2/files/sol2-3.2.2-gcc11.patch
@@ -0,0 +1,10 @@
+Add missing include needed for tests (and possibly consumers) with gcc11.
+
+Fixed upstream in:
+https://github.com/ThePhD/sol2/commit/e5e6466e09b632677d24a8f204d6a0ea0a8862b1
+--- a/include/sol/stack_core.hpp
++++ b/include/sol/stack_core.hpp
+@@ -42,2 +42,3 @@
+ #include <string>
++#include <limits>
+ #include <algorithm>
diff --git a/dev-cpp/sol2/files/sol2-3.2.2-luajit-pkgconf.patch b/dev-cpp/sol2/files/sol2-3.2.2-luajit-pkgconf.patch
new file mode 100644
index 000000000000..9b9c9f101769
--- /dev/null
+++ b/dev-cpp/sol2/files/sol2-3.2.2-luajit-pkgconf.patch
@@ -0,0 +1,17 @@
+Use the lua version selected by lua eclass
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -188,7 +188,11 @@ if (SOL2_IS_TOP_LEVEL AND (SOL2_DO_TESTS OR SOL2_DO_EXAMPLES))
+
+ string(TOLOWER ${SOL2_LUA_VERSION} NORMALIZED_LUA_VERSION)
+ # Find way to get Lua: build if requested, or attempt to build if no matching version is found
+- if (SOL2_BUILD_LUA)
++ if (TRUE)
++ find_package(PkgConfig REQUIRED)
++ pkg_check_modules(LUA REQUIRED lua IMPORTED_TARGET)
++ set(LUA_LIBRARIES PkgConfig::LUA)
++ elseif (SOL2_BUILD_LUA)
+ find_package(LuaBuild REQUIRED COMPONENTS ${SOL2_LUA_VERSION})
+ elseif (NOT SOL2_LUA_VERSION)
+ find_package(LuaBuild REQUIRED)
diff --git a/dev-cpp/sol2/metadata.xml b/dev-cpp/sol2/metadata.xml
new file mode 100644
index 000000000000..4376dd4a4616
--- /dev/null
+++ b/dev-cpp/sol2/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>alexey+gentoo@asokolov.org</email>
+ <name>Alexey Sokolov</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">ThePhD/sol2</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-cpp/sol2/sol2-3.2.2.ebuild b/dev-cpp/sol2/sol2-3.2.2.ebuild
new file mode 100644
index 000000000000..8af75c6deec7
--- /dev/null
+++ b/dev-cpp/sol2/sol2-3.2.2.ebuild
@@ -0,0 +1,80 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-{1,3,4} luajit )
+inherit cmake lua
+
+DESCRIPTION="Header-only C++ <-> Lua API wrapper"
+HOMEPAGE="https://github.com/ThePhD/sol2"
+SRC_URI="https://github.com/ThePhD/sol2/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+REQUIRED_USE="test? ( ${LUA_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ test? (
+ ${LUA_DEPS}
+ dev-cpp/catch:0
+ )
+"
+BDEPEND="
+ test? (
+ virtual/pkgconfig
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc11.patch
+ "${FILESDIR}"/${P}-luajit-pkgconf.patch
+ "${FILESDIR}"/${P}-catch-depend.patch
+)
+
+src_prepare() {
+ # TODO: remove this sed on next bump
+ sed -i -e 's/-Werror//' \
+ tests/runtime_tests/CMakeLists.txt \
+ tests/regression_tests/1011/CMakeLists.txt \
+ tests/config_tests/function_pointers/CMakeLists.txt \
+ examples/customization/CMakeLists.txt \
+ examples/CMakeLists.txt || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ cmake_src_configure
+
+ if use test; then
+ sol2_configure_wrapper() {
+ local mycmakeargs=(
+ -DSOL2_BUILD_LUA=no
+ -DSOL2_TESTS=yes
+ -DSOL2_LUA_VERSION="${ELUA}"
+ -DCATCH_INC_DIR="${ESYSROOT}/usr/include/catch2"
+ )
+ cmake_src_configure
+ }
+ lua_foreach_impl sol2_configure_wrapper
+ fi
+}
+
+src_compile() {
+ use test && lua_foreach_impl cmake_src_compile
+}
+
+src_test() {
+ sol2_test_wrapper() {
+ if [[ ${ELUA} == luajit ]]; then
+ einfo "Skipping test due to https://github.com/ThePhD/sol2/issues/1221"
+ else
+ cmake_src_test
+ fi
+ }
+ lua_foreach_impl sol2_test_wrapper
+}