diff options
Diffstat (limited to 'dev-cpp')
| -rw-r--r-- | dev-cpp/catch/catch-1.12.2-r1.ebuild | 44 | ||||
| -rw-r--r-- | dev-cpp/catch/catch-1.9999.ebuild | 8 | ||||
| -rw-r--r-- | dev-cpp/catch/files/catch-1.12.2-glibc-2.34-sigstksz.patch | 67 | ||||
| -rw-r--r-- | dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild | 40 | ||||
| -rw-r--r-- | dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch | 51 |
5 files changed, 206 insertions, 4 deletions
diff --git a/dev-cpp/catch/catch-1.12.2-r1.ebuild b/dev-cpp/catch/catch-1.12.2-r1.ebuild new file mode 100644 index 000000000000..868e734cdd93 --- /dev/null +++ b/dev-cpp/catch/catch-1.12.2-r1.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/catchorg/Catch2.git" + EGIT_BRANCH="Catch1.x" +else + MY_P=${PN^}-${PV} + SRC_URI="https://github.com/catchorg/Catch2/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz" + KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86" + + S="${WORKDIR}/${PN^}2-${PV}" +fi + +DESCRIPTION="Modern C++ header-only framework for unit-tests" +HOMEPAGE="https://github.com/catchorg/Catch2" + +LICENSE="Boost-1.0" +SLOT="1" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="!<dev-cpp/catch-1.12.2:0" + +PATCHES=( + "${FILESDIR}"/${PN}-1.12.2-glibc-2.34-sigstksz.patch +) + +src_configure() { + local mycmakeargs=( + -DNO_SELFTEST=$(usex !test) + ) + cmake_src_configure +} + +src_install() { + cmake_src_install + dodoc -r docs/. +} diff --git a/dev-cpp/catch/catch-1.9999.ebuild b/dev-cpp/catch/catch-1.9999.ebuild index 3514580992a3..9b275ede9827 100644 --- a/dev-cpp/catch/catch-1.9999.ebuild +++ b/dev-cpp/catch/catch-1.9999.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit cmake-utils +inherit cmake if [[ ${PV} == *9999 ]]; then inherit git-r3 @@ -31,10 +31,10 @@ src_configure() { local mycmakeargs=( -DNO_SELFTEST=$(usex !test) ) - cmake-utils_src_configure + cmake_src_configure } src_install() { - cmake-utils_src_install + cmake_src_install dodoc -r docs/. } diff --git a/dev-cpp/catch/files/catch-1.12.2-glibc-2.34-sigstksz.patch b/dev-cpp/catch/files/catch-1.12.2-glibc-2.34-sigstksz.patch new file mode 100644 index 000000000000..3c6e08384a5b --- /dev/null +++ b/dev-cpp/catch/files/catch-1.12.2-glibc-2.34-sigstksz.patch @@ -0,0 +1,67 @@ +https://src.fedoraproject.org/rpms/catch1/raw/rawhide/f/catch1-sigstksz.patch +https://bugs.gentoo.org/803962 + +commit 34650cd9ea2f7e4aa1e61b84ecf9913b87870680 +Author: Tom Hughes <tom@compton.nu> +Date: Fri Feb 19 10:45:49 2021 +0000 + + Patch for non-constant SIGSTKSZ + +--- a/include/internal/catch_fatal_condition.hpp ++++ b/include/internal/catch_fatal_condition.hpp +@@ -136,7 +136,7 @@ namespace Catch { + static bool isSet; + static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)]; + static stack_t oldSigStack; +- static char altStackMem[SIGSTKSZ]; ++ static char altStackMem[32768]; + + static void handleSignal( int sig ) { + std::string name = "<unknown signal>"; +@@ -156,7 +156,7 @@ namespace Catch { + isSet = true; + stack_t sigStack; + sigStack.ss_sp = altStackMem; +- sigStack.ss_size = SIGSTKSZ; ++ sigStack.ss_size = 32768; + sigStack.ss_flags = 0; + sigaltstack(&sigStack, &oldSigStack); + struct sigaction sa = { 0 }; +@@ -188,7 +188,7 @@ namespace Catch { + bool FatalConditionHandler::isSet = false; + struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; + stack_t FatalConditionHandler::oldSigStack = {}; +- char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; ++ char FatalConditionHandler::altStackMem[32768] = {}; + + + } // namespace Catch +--- a/single_include/catch.hpp ++++ b/single_include/catch.hpp +@@ -6540,7 +6540,7 @@ namespace Catch { + static bool isSet; + static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)]; + static stack_t oldSigStack; +- static char altStackMem[SIGSTKSZ]; ++ static char altStackMem[32768]; + + static void handleSignal( int sig ) { + std::string name = "<unknown signal>"; +@@ -6560,7 +6560,7 @@ namespace Catch { + isSet = true; + stack_t sigStack; + sigStack.ss_sp = altStackMem; +- sigStack.ss_size = SIGSTKSZ; ++ sigStack.ss_size = 32768; + sigStack.ss_flags = 0; + sigaltstack(&sigStack, &oldSigStack); + struct sigaction sa = { 0 }; +@@ -6591,7 +6591,7 @@ namespace Catch { + bool FatalConditionHandler::isSet = false; + struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {}; + stack_t FatalConditionHandler::oldSigStack = {}; +- char FatalConditionHandler::altStackMem[SIGSTKSZ] = {}; ++ char FatalConditionHandler::altStackMem[32768] = {}; + + } // namespace Catch + diff --git a/dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild b/dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild new file mode 100644 index 000000000000..c3a4a5914aa4 --- /dev/null +++ b/dev-cpp/cpp-hocon/cpp-hocon-0.3.0-r1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake prefix + +DESCRIPTION="Provides C++ support for the HOCON configuration file format" +HOMEPAGE="https://github.com/puppetlabs/cpp-hocon" +SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" +IUSE="debug test" +RESTRICT="!test? ( test )" + +RDEPEND=" + >=dev-libs/boost-1.54:=[nls] + >=dev-libs/leatherman-0.9.3:= +" +DEPEND="${DEPEND} + test? ( dev-cpp/catch:1 )" + +#PATCHES=( "${FILESDIR}"/${PN}-0.2.1-cmake.patch ) +PATCHES=( "${FILESDIR}"/${PN}-0.3.0-use-system-catch.patch ) + +src_prepare() { + cmake_src_prepare + + eprefixify lib/tests/CMakeLists.txt +} + +src_configure() { + local mycmakeargs=( + -DBUILD_TESTING=$(usex test) + ) + + cmake_src_configure +} diff --git a/dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch b/dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch new file mode 100644 index 000000000000..0964e3e7bc7a --- /dev/null +++ b/dev-cpp/cpp-hocon/files/cpp-hocon-0.3.0-use-system-catch.patch @@ -0,0 +1,51 @@ +https://bugs.gentoo.org/823419 + +Wanted to make this "proper" but Catch2 lacks a pkgconfig file (or a CMake one) +and it's easier to just do this for now. + +Based on patch version of sed commands from upstream bug +(https://github.com/puppetlabs/cpp-hocon/issues/132) and +Fedora (https://src.fedoraproject.org/rpms/cpp-hocon/blob/rawhide/f/cpp-hocon.spec#_76). + +Makes tests conditional too. +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,12 +16,16 @@ if (NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) + endif() + +-enable_testing() +- + # Leatherman setup +-set(LEATHERMAN_COMPONENTS locale catch nowide util) ++set(LEATHERMAN_COMPONENTS locale nowide util) + find_package(Leatherman REQUIRED COMPONENTS ${LEATHERMAN_COMPONENTS}) + ++option(BUILD_TESTING "Build test suite (needs Catch)" ON) ++ ++if(BUILD_TESTING) ++ enable_testing() ++endif() ++ + ## Before we find any packages, we want to pull in the common leatherman options, as they can affect commonly-used packages. + include(options) + ## Pull in common cflags setting from leatherman. Don't override CMAKE_CXX_FLAGS at the project root to avoid impacting 3rd party code. +--- a/lib/CMakeLists.txt ++++ b/lib/CMakeLists.txt +@@ -91,4 +91,6 @@ symbol_exports(lib${PROJECT_NAME} "${CMAKE_CURRENT_LIST_DIR}/inc/hocon/export.h" + leatherman_install(lib${PROJECT_NAME}) + install(DIRECTORY inc/hocon DESTINATION include) + +-add_subdirectory(tests) ++if (BUILD_TESTING) ++ add_subdirectory(tests) ++endif() +--- a/lib/tests/CMakeLists.txt ++++ b/lib/tests/CMakeLists.txt +@@ -1,5 +1,5 @@ + # Setup compiling the test executable. C++ compile flags are inherited from the parent directory. +-include_directories(${LEATHERMAN_CATCH_INCLUDE}) ++include_directories(@GENTOO_PORTAGE_EPREFIX@/usr/include/catch) + + set(TEST_CASES + concatenation_test.cc |
