diff --git a/dev-libs/mtxclient/Manifest b/dev-libs/mtxclient/Manifest new file mode 100644 index 0000000000..5afa0f8c2a --- /dev/null +++ b/dev-libs/mtxclient/Manifest @@ -0,0 +1 @@ +DIST mtxclient-0.3.0.tar.gz 507299 BLAKE2B 4c36762a3a0a3aafebd414d2c967cc5183710c7be34df9b50078538e7971e86182114ed310ed96a452a02f3d8c1c18fa5aa0de414d0c391d97efb1ce7f1b49f9 SHA512 113eb2c1042e0aeea6607fae0b7fd0ff1655d6b902fa11a3492561c53240901e641f53d413810e932ac210e519026016c5fac38bda1592336c95b2d79781557e diff --git a/dev-libs/mtxclient/files/0.3.0_remove_failing_tests.patch b/dev-libs/mtxclient/files/0.3.0_remove_failing_tests.patch new file mode 100644 index 0000000000..55de213f10 --- /dev/null +++ b/dev-libs/mtxclient/files/0.3.0_remove_failing_tests.patch @@ -0,0 +1,38 @@ +From b95f9d85f87f78ce5cfbaeed513ea284678eaa83 Mon Sep 17 00:00:00 2001 +From: tastytea +Date: Mon, 25 May 2020 00:57:57 +0200 +Subject: [PATCH] Remove failing tests. + +--- + CMakeLists.txt | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 689a091..58868b6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -345,13 +345,6 @@ if(BUILD_LIB_TESTS) + GTest::Main) + target_include_directories(utils PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) + +- add_executable(pushrules tests/pushrules.cpp) +- target_link_libraries(pushrules +- MatrixClient::MatrixClient +- GTest::GTest +- GTest::Main) +- target_include_directories(pushrules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) +- + add_executable(identifiers tests/identifiers.cpp) + target_link_libraries(identifiers + MatrixClient::MatrixClient +@@ -395,7 +388,6 @@ if(BUILD_LIB_TESTS) + GTest::Main) + + add_test(Utilities utils) +- add_test(Pushrules pushrules) + add_test(Identifiers identifiers) + add_test(Errors errors) + add_test(CryptoStructs crypto) +-- +2.26.2 + diff --git a/dev-libs/mtxclient/files/0.3.0_remove_network_tests.patch b/dev-libs/mtxclient/files/0.3.0_remove_network_tests.patch new file mode 100644 index 0000000000..32fc72bb6c --- /dev/null +++ b/dev-libs/mtxclient/files/0.3.0_remove_network_tests.patch @@ -0,0 +1,72 @@ +From e4e068ba5dd3964c890f25bbe668c8a964562ded Mon Sep 17 00:00:00 2001 +From: tastytea +Date: Mon, 25 May 2020 00:50:30 +0200 +Subject: [PATCH] Remove tests that require a network connection. + +--- + CMakeLists.txt | 35 ----------------------------------- + 1 file changed, 35 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0073604..689a091 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -338,29 +338,6 @@ if(BUILD_LIB_TESTS) + + file(COPY tests/fixtures DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + +- add_executable(client_api tests/client_api.cpp) +- target_link_libraries(client_api +- MatrixClient::MatrixClient +- GTest::GTest +- GTest::Main) +- target_include_directories(client_api PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/tests) +- +- add_executable(media_api tests/media_api.cpp) +- target_link_libraries(media_api +- MatrixClient::MatrixClient +- GTest::GTest +- GTest::Main) +- target_include_directories(media_api PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/tests) +- +- add_executable(e2ee tests/e2ee.cpp) +- target_link_libraries(e2ee +- MatrixClient::MatrixClient +- GTest::GTest +- GTest::Main) +- target_include_directories(e2ee PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) +- + add_executable(utils tests/utils.cpp) + target_link_libraries(utils + MatrixClient::MatrixClient +@@ -375,14 +352,6 @@ if(BUILD_LIB_TESTS) + GTest::Main) + target_include_directories(pushrules PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tests) + +- add_executable(connection tests/connection.cpp) +- target_link_libraries(connection +- MatrixClient::MatrixClient +- GTest::GTest +- GTest::Main) +- target_include_directories(connection PRIVATE +- ${CMAKE_CURRENT_SOURCE_DIR}/tests) +- + add_executable(identifiers tests/identifiers.cpp) + target_link_libraries(identifiers + MatrixClient::MatrixClient +@@ -425,10 +394,6 @@ if(BUILD_LIB_TESTS) + GTest::GTest + GTest::Main) + +- add_test(BasicConnectivity connection) +- add_test(ClientAPI client_api) +- add_test(MediaAPI media_api) +- add_test(Encryption e2ee) + add_test(Utilities utils) + add_test(Pushrules pushrules) + add_test(Identifiers identifiers) +-- +2.26.2 + diff --git a/dev-libs/mtxclient/metadata.xml b/dev-libs/mtxclient/metadata.xml new file mode 100644 index 0000000000..d028932962 --- /dev/null +++ b/dev-libs/mtxclient/metadata.xml @@ -0,0 +1,11 @@ + + + + + gentoo@tastytea.de + Ronny (tastytea) Gutbrod + + + Nheko-Reborn/mtxclient + + diff --git a/dev-libs/mtxclient/mtxclient-0.3.0.ebuild b/dev-libs/mtxclient/mtxclient-0.3.0.ebuild new file mode 100644 index 0000000000..8690faf6d7 --- /dev/null +++ b/dev-libs/mtxclient/mtxclient-0.3.0.ebuild @@ -0,0 +1,51 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit cmake + +DESCRIPTION="Client API library for Matrix, built on top of Boost.Asio" +HOMEPAGE="https://github.com/Nheko-Reborn/mtxclient" +SRC_URI="https://github.com/Nheko-Reborn/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +IUSE="test" +KEYWORDS="~amd64" + +RDEPEND=" + dev-libs/libsodium + >=dev-libs/boost-1.70.0 + dev-libs/olm + dev-libs/openssl + dev-cpp/nlohmann_json +" +DEPEND=" + ${RDEPEND} + dev-libs/spdlog + test? ( dev-cpp/gtest ) +" + +# remove_failing_tests depends on remove_network_tests. +PATCHES=( + "${FILESDIR}/0.3.0_remove_network_tests.patch" + "${FILESDIR}/0.3.0_remove_failing_tests.patch" +) + +src_configure() { + local -a mycmakeargs=( + -DBUILD_LIB_TESTS="$(usex test)" + -DBUILD_LIB_EXAMPLES=OFF + ) + + if use test; then + # Upstream uses a toolchain file to set these. + mycmakeargs+=( + -DCMAKE_CXX_STANDARD=17 + -DCMAKE_CXX_STANDARD_REQUIRED=ON + ) + fi + + cmake_src_configure +}