diff options
Diffstat (limited to 'dev-cpp/sol2')
-rw-r--r-- | dev-cpp/sol2/Manifest | 1 | ||||
-rw-r--r-- | dev-cpp/sol2/files/sol2-3.2.2-luajit-pkgconf.patch | 17 | ||||
-rw-r--r-- | dev-cpp/sol2/files/sol2-3.3.0-catch-depend.patch | 16 | ||||
-rw-r--r-- | dev-cpp/sol2/files/sol2-3.3.0-cmake-dir.patch | 31 | ||||
-rw-r--r-- | dev-cpp/sol2/files/sol2-3.3.0-dont-install-tests.patch | 10 | ||||
-rw-r--r-- | dev-cpp/sol2/files/sol2-3.3.0-werror.patch | 21 | ||||
-rw-r--r-- | dev-cpp/sol2/metadata.xml | 19 | ||||
-rw-r--r-- | dev-cpp/sol2/sol2-3.3.1.ebuild | 67 |
8 files changed, 182 insertions, 0 deletions
diff --git a/dev-cpp/sol2/Manifest b/dev-cpp/sol2/Manifest new file mode 100644 index 000000000000..ca4b7ec7ad33 --- /dev/null +++ b/dev-cpp/sol2/Manifest @@ -0,0 +1 @@ +DIST sol2-3.3.1.tar.gz 8453954 BLAKE2B f9fced4f001a5f681598e45bf74cdf064f655c950be5b91789d2bf66c0180b5048610d3d4416c024a07db11d41fceaee786800c5ca1412811cbc1a449a894a9e SHA512 4404b124a4f331d77459c01a92cd73895301e7d3ef829a0285980f0138b9cc66782de3713d54f017d5aad7d8a11d23eeffbc5f3b39ccb4d4306a955711d385dd 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/files/sol2-3.3.0-catch-depend.patch b/dev-cpp/sol2/files/sol2-3.3.0-catch-depend.patch new file mode 100644 index 000000000000..8f53144ad37c --- /dev/null +++ b/dev-cpp/sol2/files/sol2-3.3.0-catch-depend.patch @@ -0,0 +1,16 @@ +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -23,12 +23,7 @@ + # # # # sol2 tests + + # # Dependencies +-FetchContent_Declare( +- catch2 +- GIT_REPOSITORY https://github.com/catchorg/Catch2.git +- GIT_TAG devel +-) +-FetchContent_MakeAvailable(catch2) ++find_package(Catch2 REQUIRED) + + function(sol2_add_test_properties target-name) + target_link_libraries(${target-name} diff --git a/dev-cpp/sol2/files/sol2-3.3.0-cmake-dir.patch b/dev-cpp/sol2/files/sol2-3.3.0-cmake-dir.patch new file mode 100644 index 000000000000..6782b05abf78 --- /dev/null +++ b/dev-cpp/sol2/files/sol2-3.3.0-cmake-dir.patch @@ -0,0 +1,31 @@ +Install to share, it's header-only + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -105,7 +105,7 @@ target_include_directories(sol2 ${sol2-system-include} + configure_package_config_file( + cmake/sol2-config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake" +- INSTALL_DESTINATION lib/cmake/sol2 ++ INSTALL_DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/sol2 + NO_CHECK_REQUIRED_COMPONENTS_MACRO) + + write_basic_package_version_file( +@@ -121,7 +121,7 @@ if(SOL2_ENABLE_INSTALL) + + install(EXPORT sol2 + FILE sol2-targets.cmake +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sol2") ++ DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2") + + install(DIRECTORY include/sol + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") +@@ -129,7 +129,7 @@ if(SOL2_ENABLE_INSTALL) + install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/cmake/sol2-config-version.cmake" +- DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/sol2") ++ DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/sol2") + endif() + + # # # sol2 Library - Single header target diff --git a/dev-cpp/sol2/files/sol2-3.3.0-dont-install-tests.patch b/dev-cpp/sol2/files/sol2-3.3.0-dont-install-tests.patch new file mode 100644 index 000000000000..e1186958973a --- /dev/null +++ b/dev-cpp/sol2/files/sol2-3.3.0-dont-install-tests.patch @@ -0,0 +1,10 @@ +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -60,7 +60,6 @@ function(sol2_add_test_properties target-name) + + add_test(NAME ${target-name} COMMAND ${target-name}) + if(SOL2_ENABLE_INSTALL) +- install(TARGETS ${target-name} RUNTIME DESTINATION bin) + endif() + endfunction() + diff --git a/dev-cpp/sol2/files/sol2-3.3.0-werror.patch b/dev-cpp/sol2/files/sol2-3.3.0-werror.patch new file mode 100644 index 000000000000..27118f38cafd --- /dev/null +++ b/dev-cpp/sol2/files/sol2-3.3.0-werror.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -208,7 +208,6 @@ if (sol2-is-top-level-project) + check_compiler_flag(warn-pedantic GCC -Wpedantic) + check_compiler_flag(warn-all MSVC /W4 GCC -Wall) + check_compiler_flag(warn-extra GCC -Wextra) +- check_compiler_flag(warn-errors MSVC /WX GCC -Werror) + # Individual warnings/errors + check_compiler_diagnostic(unknown-warning) + check_compiler_diagnostic(unknown-warning-option) +--- a/examples/customization/CMakeLists.txt ++++ b/examples/customization/CMakeLists.txt +@@ -45,7 +45,7 @@ function (MAKE_CUSTOMIZATION_EXAMPLE example_suffix target_sol) + PRIVATE -std=c++1z
+ -ftemplate-backtrace-limit=0
+ -Wno-unknown-warning -Wno-unknown-warning-option
+- -Wall -Wpedantic -Werror -pedantic -pedantic-errors
++ -Wall -Wpedantic -pedantic -pedantic-errors
+ -Wno-noexcept-type)
+ endif()
+
diff --git a/dev-cpp/sol2/metadata.xml b/dev-cpp/sol2/metadata.xml new file mode 100644 index 000000000000..beb567113454 --- /dev/null +++ b/dev-cpp/sol2/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://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.3.1.ebuild b/dev-cpp/sol2/sol2-3.3.1.ebuild new file mode 100644 index 000000000000..585aae692d6f --- /dev/null +++ b/dev-cpp/sol2/sol2-3.3.1.ebuild @@ -0,0 +1,67 @@ +# Copyright 2021-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +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 ~arm64 ~ppc64 ~x86" +IUSE="test" +REQUIRED_USE="${LUA_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +DEPEND=" + ${LUA_DEPS} + test? ( + >=dev-cpp/catch-3 + ) +" +BDEPEND=" + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/sol2-3.3.0-werror.patch + "${FILESDIR}"/sol2-3.2.2-luajit-pkgconf.patch + "${FILESDIR}"/sol2-3.3.0-catch-depend.patch + "${FILESDIR}"/sol2-3.3.0-cmake-dir.patch + "${FILESDIR}"/sol2-3.3.0-dont-install-tests.patch +) + +src_configure() { + sol2_configure_wrapper() { + local mycmakeargs=( + -DSOL2_BUILD_LUA=no + -DSOL2_TESTS=$(usex test) + -DSOL2_LUA_VERSION="${ELUA}" + ) + cmake_src_configure + } + lua_foreach_impl sol2_configure_wrapper +} + +src_compile() { + 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 +} + +src_install() { + lua_foreach_impl cmake_src_install +} |