From 40b367a7be8444f86e60cb1fcc1630bea2e64278 Mon Sep 17 00:00:00 2001 From: "Liguros - Gitlab CI/CD [develop]" Date: Tue, 2 Aug 2022 12:49:03 +0000 Subject: Adding metadata --- .../mastodonpp-0.5.7-add-support-for-catch-3.patch | 139 +++++++++++++++++++++ dev-cpp/mastodonpp/mastodonpp-0.5.7-r1.ebuild | 61 +++++++++ dev-cpp/mastodonpp/mastodonpp-0.5.7.ebuild | 59 --------- dev-cpp/mastodonpp/mastodonpp-9999.ebuild | 4 +- 4 files changed, 202 insertions(+), 61 deletions(-) create mode 100644 dev-cpp/mastodonpp/files/mastodonpp-0.5.7-add-support-for-catch-3.patch create mode 100644 dev-cpp/mastodonpp/mastodonpp-0.5.7-r1.ebuild delete mode 100644 dev-cpp/mastodonpp/mastodonpp-0.5.7.ebuild (limited to 'dev-cpp/mastodonpp') diff --git a/dev-cpp/mastodonpp/files/mastodonpp-0.5.7-add-support-for-catch-3.patch b/dev-cpp/mastodonpp/files/mastodonpp-0.5.7-add-support-for-catch-3.patch new file mode 100644 index 000000000000..e63324cfc352 --- /dev/null +++ b/dev-cpp/mastodonpp/files/mastodonpp-0.5.7-add-support-for-catch-3.patch @@ -0,0 +1,139 @@ +# Upstream commit: + +From 7255df01e047da9bf88dcb6945d07b49126e24b4 Mon Sep 17 00:00:00 2001 +From: tastytea +Date: Mon, 1 Aug 2022 14:01:38 +0200 +Subject: [PATCH] add support for testing with catch 3 + +--- + tests/CMakeLists.txt | 11 ++++++++--- + tests/main.cpp | 9 +++++++-- + tests/test_connection.cpp | 9 +++++++-- + tests/test_html_unescape.cpp | 9 +++++++-- + tests/test_instance.cpp | 9 +++++++-- + 5 files changed, 36 insertions(+), 11 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 3f7107b..dacc10d 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -3,11 +3,16 @@ include(CTest) + file(GLOB sources_tests test_*.cpp) + + find_package(Catch2 CONFIG) +-if(Catch2_FOUND) # Catch 2.x ++if(Catch2_FOUND) # Catch 2.x / 3.x + include(Catch) + add_executable(all_tests main.cpp ${sources_tests}) +- target_link_libraries(all_tests +- PRIVATE Catch2::Catch2 ${PROJECT_NAME}) ++ if(TARGET Catch2::Catch2WithMain) # Catch 3.x ++ target_link_libraries(all_tests ++ PRIVATE Catch2::Catch2WithMain ${PROJECT_NAME}) ++ else() # Catch 2.x ++ target_link_libraries(all_tests ++ PRIVATE Catch2::Catch2 ${PROJECT_NAME}) ++ endif() + target_include_directories(all_tests PRIVATE "/usr/include/catch2") + catch_discover_tests(all_tests EXTRA_ARGS "${EXTRA_TEST_ARGS}") + else() # Catch 1.x +diff --git a/tests/main.cpp b/tests/main.cpp +index 162dfdf..c6d12ed 100644 +--- a/tests/main.cpp ++++ b/tests/main.cpp +@@ -1,5 +1,5 @@ + /* This file is part of mastodonpp. +- * Copyright © 2020 tastytea ++ * Copyright © 2020, 2022 tastytea + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by +@@ -16,4 +16,9 @@ + + #define CATCH_CONFIG_MAIN + +-#include ++// catch 3 does not have catch.hpp anymore ++#if __has_include() ++# include ++#else ++# include ++#endif +diff --git a/tests/test_connection.cpp b/tests/test_connection.cpp +index 05d7668..208e8de 100644 +--- a/tests/test_connection.cpp ++++ b/tests/test_connection.cpp +@@ -1,5 +1,5 @@ + /* This file is part of mastodonpp. +- * Copyright © 2020 tastytea ++ * Copyright © 2020, 2022 tastytea + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by +@@ -17,7 +17,12 @@ + #include "connection.hpp" + #include "instance.hpp" + +-#include ++// catch 3 does not have catch.hpp anymore ++#if __has_include() ++# include ++#else ++# include ++#endif + + #include + +diff --git a/tests/test_html_unescape.cpp b/tests/test_html_unescape.cpp +index d141921..1c75dd8 100644 +--- a/tests/test_html_unescape.cpp ++++ b/tests/test_html_unescape.cpp +@@ -1,5 +1,5 @@ + /* This file is part of mastodonpp. +- * Copyright © 2020 tastytea ++ * Copyright © 2020, 2022 tastytea + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by +@@ -16,7 +16,12 @@ + + #include "helpers.hpp" + +-#include ++// catch 3 does not have catch.hpp anymore ++#if __has_include() ++# include ++#else ++# include ++#endif + + #include + #include +diff --git a/tests/test_instance.cpp b/tests/test_instance.cpp +index 768cc2a..ebc2c0c 100644 +--- a/tests/test_instance.cpp ++++ b/tests/test_instance.cpp +@@ -1,5 +1,5 @@ + /* This file is part of mastodonpp. +- * Copyright © 2020 tastytea ++ * Copyright © 2020, 2022 tastytea + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by +@@ -16,7 +16,12 @@ + + #include "instance.hpp" + +-#include ++// catch 3 does not have catch.hpp anymore ++#if __has_include() ++# include ++#else ++# include ++#endif + + #include + #include +-- +2.35.1 + diff --git a/dev-cpp/mastodonpp/mastodonpp-0.5.7-r1.ebuild b/dev-cpp/mastodonpp/mastodonpp-0.5.7-r1.ebuild new file mode 100644 index 000000000000..96ce9cef8b60 --- /dev/null +++ b/dev-cpp/mastodonpp/mastodonpp-0.5.7-r1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake +[[ "${PV}" == "9999" ]] && inherit git-r3 + +DESCRIPTION="C++ wrapper for the Mastodon and Pleroma APIs." +HOMEPAGE="https://schlomp.space/tastytea/mastodonpp" +if [[ "${PV}" != "9999" ]]; then + SRC_URI="https://schlomp.space/tastytea/mastodonpp/archive/${PV}.tar.gz -> ${P}.tar.gz" + S="${WORKDIR}/${PN}" + KEYWORDS="~amd64" +else + EGIT_REPO_URI="https://schlomp.space/tastytea/mastodonpp.git" +fi + +LICENSE="AGPL-3" +SLOT="0" +IUSE="doc examples test" + +RDEPEND=">=net-misc/curl-7.56.0[ssl]" +DEPEND="${RDEPEND}" +BDEPEND=" + doc? ( app-doc/doxygen[dot] ) + test? ( dev-cpp/catch ) +" + +RESTRICT="!test? ( test )" + +PATCHES=( "${FILESDIR}"/${PN}-0.5.7-add-support-for-catch-3.patch ) + +src_configure() { + local mycmakeargs=( + -DWITH_EXAMPLES=NO + -DWITH_TESTS="$(usex test)" + -DWITH_DOC="$(usex doc)" + ) + + cmake_src_configure +} + +src_test() { + BUILD_DIR="${BUILD_DIR}/tests" cmake_src_test +} + +src_install() { + if use doc; then + HTML_DOCS="${BUILD_DIR}/doc/html/*" + fi + + if use examples; then + docinto examples + for file in examples/*.cpp; do + dodoc ${file} + done + fi + + cmake_src_install +} diff --git a/dev-cpp/mastodonpp/mastodonpp-0.5.7.ebuild b/dev-cpp/mastodonpp/mastodonpp-0.5.7.ebuild deleted file mode 100644 index 60770d518b57..000000000000 --- a/dev-cpp/mastodonpp/mastodonpp-0.5.7.ebuild +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit cmake -[[ "${PV}" == "9999" ]] && inherit git-r3 - -DESCRIPTION="C++ wrapper for the Mastodon and Pleroma APIs." -HOMEPAGE="https://schlomp.space/tastytea/mastodonpp" -if [[ "${PV}" != "9999" ]]; then - SRC_URI="https://schlomp.space/tastytea/mastodonpp/archive/${PV}.tar.gz -> ${P}.tar.gz" - S="${WORKDIR}/${PN}" - KEYWORDS="~amd64" -else - EGIT_REPO_URI="https://schlomp.space/tastytea/mastodonpp.git" -fi - -LICENSE="AGPL-3" -SLOT="0" -IUSE="doc examples test" - -RDEPEND=">=net-misc/curl-7.56.0[ssl]" -DEPEND="${RDEPEND}" -BDEPEND=" - doc? ( app-doc/doxygen[dot] ) - test? ( dev-cpp/catch ) -" - -RESTRICT="!test? ( test )" - -src_configure() { - local mycmakeargs=( - -DWITH_EXAMPLES=NO - -DWITH_TESTS="$(usex test)" - -DWITH_DOC="$(usex doc)" - ) - - cmake_src_configure -} - -src_test() { - BUILD_DIR="${BUILD_DIR}/tests" cmake_src_test -} - -src_install() { - if use doc; then - HTML_DOCS="${BUILD_DIR}/doc/html/*" - fi - - if use examples; then - docinto examples - for file in examples/*.cpp; do - dodoc ${file} - done - fi - - cmake_src_install -} diff --git a/dev-cpp/mastodonpp/mastodonpp-9999.ebuild b/dev-cpp/mastodonpp/mastodonpp-9999.ebuild index 60770d518b57..2be3056dc8ec 100644 --- a/dev-cpp/mastodonpp/mastodonpp-9999.ebuild +++ b/dev-cpp/mastodonpp/mastodonpp-9999.ebuild @@ -1,7 +1,7 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 inherit cmake [[ "${PV}" == "9999" ]] && inherit git-r3 -- cgit v1.3