commit: 306fdd38627fcfaac7a0331d2f8642c9a7890308 Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net> AuthorDate: Sat Sep 2 17:54:44 2023 +0000 Commit: Lucio Sauer <watermanpaint <AT> posteo <DOT> net> CommitDate: Sat Sep 2 19:46:29 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=306fdd38
dev-cpp/rang: new package, add 3.2 Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net> dev-cpp/rang/Manifest | 1 + dev-cpp/rang/files/rang-3.2-fix-tests.patch | 48 +++++++++++++++++++++++++++++ dev-cpp/rang/metadata.xml | 11 +++++++ dev-cpp/rang/rang-3.2.ebuild | 48 +++++++++++++++++++++++++++++ 4 files changed, 108 insertions(+) diff --git a/dev-cpp/rang/Manifest b/dev-cpp/rang/Manifest new file mode 100644 index 0000000000..969844b485 --- /dev/null +++ b/dev-cpp/rang/Manifest @@ -0,0 +1 @@ +DIST rang-3.2.gh.tar.gz 13601 BLAKE2B 7694a221fc925c5f10e13b7ef4d087629ff6012b53212f45ed527d07ede69165fcf0bef8518e7be3592bf483663a9a2641608c9d8f57cd7a98edcdb1f56f1591 SHA512 f579aaf3bddbfa2325dd31bdbe7c32598af8a340fee62c3a1e7ed1cf189af2808b7838a5fb13b3765279ddd1e7481f6229da72e72218a4916455cf3ae12b5a68 diff --git a/dev-cpp/rang/files/rang-3.2-fix-tests.patch b/dev-cpp/rang/files/rang-3.2-fix-tests.patch new file mode 100644 index 0000000000..c046825ca8 --- /dev/null +++ b/dev-cpp/rang/files/rang-3.2-fix-tests.patch @@ -0,0 +1,48 @@ +https://src.fedoraproject.org/rpms/rang/blob/rawhide/f/0000-rang-fix-tests.patch +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -8,7 +8,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) + + function(rang_add_test file_name) + add_executable("${file_name}" "${file_name}.cpp") +- target_link_libraries("${file_name}" rang) + endfunction() + + # simple tests ################################################################# +@@ -23,7 +22,7 @@ find_package(doctest) + + if (${doctest_FOUND} EQUAL 1) + add_executable(all_rang_tests "test.cpp") +- target_link_libraries(all_rang_tests rang doctest::doctest) ++ target_link_libraries(all_rang_tests doctest::doctest) + + enable_testing() + +--- a/test/colorTest.cpp ++++ b/test/colorTest.cpp +@@ -1,4 +1,4 @@ +-#include "rang.hpp" ++#include "../include/rang.hpp" + #include <string> + + using namespace std; +--- a/test/envTermMissing.cpp ++++ b/test/envTermMissing.cpp +@@ -1,4 +1,4 @@ +-#include "rang.hpp" ++#include "../include/rang.hpp" + #include <cstdlib> + + using std::cout; +--- a/test/test.cpp ++++ b/test/test.cpp +@@ -1,7 +1,7 @@ + #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN +-#include "doctest.h" ++#include "doctest/doctest.h" + +-#include "rang.hpp" ++#include "../include/rang.hpp" + #include <fstream> + #include <string> + diff --git a/dev-cpp/rang/metadata.xml b/dev-cpp/rang/metadata.xml new file mode 100644 index 0000000000..a1c47a66e4 --- /dev/null +++ b/dev-cpp/rang/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>watermanpa...@posteo.net</email> + <name>Lucio Sauer</name> + </maintainer> + <upstream> + <remote-id type="github">agauniyal/rang</remote-id> + </upstream> +</pkgmetadata> diff --git a/dev-cpp/rang/rang-3.2.ebuild b/dev-cpp/rang/rang-3.2.ebuild new file mode 100644 index 0000000000..a06d69c754 --- /dev/null +++ b/dev-cpp/rang/rang-3.2.ebuild @@ -0,0 +1,48 @@ +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="Minimal, header-only, modern C++ library for terminal goodies" +HOMEPAGE="https://agauniyal.github.io/rang/" +SRC_URI="https://github.com/agauniyal/rang/archive/refs/tags/v${PV}.tar.gz + -> ${P}.gh.tar.gz" + +LICENSE="Unlicense" +SLOT="0" +KEYWORDS="~amd64" + +IUSE="test" +RESTRICT="!test? ( test )" + +PATCHES="${FILESDIR}/${P}-fix-tests.patch" + +BDEPEND="test? ( dev-cpp/doctest )" + +src_configure() { + cmake_src_configure + if use test; then + local BUILD_DIR CMAKE_USE_DIR + BUILD_DIR="${WORKDIR}/${P}_test" + CMAKE_USE_DIR="${S}/test" + cmake_src_configure + fi +} + +src_compile() { + if use test; then + local BUILD_DIR CMAKE_USE_DIR + BUILD_DIR="${WORKDIR}/${P}_test" + CMAKE_USE_DIR="${S}/test" + cmake_src_compile + fi +} + +src_test() { + local BUILD_DIR CMAKE_USE_DIR + BUILD_DIR="${WORKDIR}/${P}_test" + CMAKE_USE_DIR="${S}/test" + cmake_src_test +}