public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Florian Schmaus" <flow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/gtest/files/, dev-cpp/gtest/
Date: Mon, 14 Oct 2024 07:16:57 +0000 (UTC)	[thread overview]
Message-ID: <1728890040.a9924d310c7adbc1948b1086e3d4b67b8cdecd19.flow@gentoo> (raw)

commit:     a9924d310c7adbc1948b1086e3d4b67b8cdecd19
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Tue Oct  8 08:49:38 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Mon Oct 14 07:14:00 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9924d31

dev-cpp/gtest: add support for abseil and re2

Use abseil for functionality such as using AbslStringify for extensible
print formatting, and use re2 for regex engine and syntax.

Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 .../files/gtest-find-re2-with-pkgconfig.patch      | 32 ++++++++++++++++++++++
 dev-cpp/gtest/gtest-9999.ebuild                    |  9 +++++-
 dev-cpp/gtest/metadata.xml                         |  5 ++++
 3 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/dev-cpp/gtest/files/gtest-find-re2-with-pkgconfig.patch b/dev-cpp/gtest/files/gtest-find-re2-with-pkgconfig.patch
new file mode 100644
index 000000000000..3a78ae15cac3
--- /dev/null
+++ b/dev-cpp/gtest/files/gtest-find-re2-with-pkgconfig.patch
@@ -0,0 +1,32 @@
+dev-libs/re2 is built with a Makefile which doesn't install any cmake modules.
+For now, use pkgconfig.
+
+Bug: https://bugs.gentoo.org/940734
+Signed-off-by: Peter Levine <plevine457@gmail.com>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -25,7 +25,9 @@
+     find_package(absl REQUIRED)
+   endif()
+   if(NOT TARGET re2::re2)
+-    find_package(re2 REQUIRED)
++    find_package(PkgConfig REQUIRED)
++    pkg_check_modules(re2 REQUIRED IMPORTED_TARGET re2)
++    add_library(re2::re2 ALIAS PkgConfig::re2)
+   endif()
+ endif()
+ 
+--- a/googletest/cmake/Config.cmake.in
++++ b/googletest/cmake/Config.cmake.in
+@@ -6,7 +6,9 @@
+ endif()
+ if (@GTEST_HAS_ABSL@)
+   find_dependency(absl)
+-  find_dependency(re2)
++  find_package(PkgConfig)
++  pkg_check_modules(re2 IMPORTED_TARGET re2)
++  add_library(re2::re2 ALIAS PkgConfig::re2)
+ endif()
+ 
+ include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")

diff --git a/dev-cpp/gtest/gtest-9999.ebuild b/dev-cpp/gtest/gtest-9999.ebuild
index f86a47387a97..be6392d028d6 100644
--- a/dev-cpp/gtest/gtest-9999.ebuild
+++ b/dev-cpp/gtest/gtest-9999.ebuild
@@ -29,14 +29,20 @@ HOMEPAGE="https://github.com/google/googletest"
 
 LICENSE="BSD"
 SLOT="0"
-IUSE="doc examples test"
+IUSE="abseil doc examples test"
 RESTRICT="!test? ( test )"
 
 BDEPEND="test? ( ${PYTHON_DEPS} )"
+DEPEND="abseil? (
+	dev-cpp/abseil-cpp:=[${MULTILIB_USEDEP}]
+	dev-libs/re2:=[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}"
 
 # Exclude tests that fail with FEATURES="usersandbox"
 CMAKE_SKIP_TESTS=( "googletest-(death-test|port)-test" )
 
+PATCHES=( "${FILESDIR}"/gtest-find-re2-with-pkgconfig.patch )
+
 pkg_setup() {
 	use test && python-any-r1_pkg_setup
 }
@@ -49,6 +55,7 @@ multilib_src_configure() {
 	local mycmakeargs=(
 		-DBUILD_GMOCK=ON
 		-DINSTALL_GTEST=ON
+		-DGTEST_HAS_ABSL=$(usex abseil)
 
 		# tests
 		-Dgmock_build_tests=$(usex test)

diff --git a/dev-cpp/gtest/metadata.xml b/dev-cpp/gtest/metadata.xml
index 2a73b6d6508d..982d3d7ce6b4 100644
--- a/dev-cpp/gtest/metadata.xml
+++ b/dev-cpp/gtest/metadata.xml
@@ -9,6 +9,11 @@
 		<email>proxy-maint@gentoo.org</email>
 		<name>Proxy Maintainers</name>
 	</maintainer>
+	<use>
+		<flag name="abseil">
+			Build with functionality provided by <pkg>dev-cpp/abseil-cpp</pkg> and <pkg>dev-libs/re2</pkg>
+		</flag>
+	</use>
 	<upstream>
 		<doc lang="en">https://github.com/google/googletest/tree/HEAD/docs</doc>
 		<remote-id type="github">google/googletest</remote-id>


             reply	other threads:[~2024-10-14  7:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14  7:16 Florian Schmaus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-09-04 10:08 [gentoo-commits] repo/gentoo:master commit in: dev-cpp/gtest/files/, dev-cpp/gtest/ David Seifert
2020-07-19 10:43 Joonas Niilola
2019-08-21  5:07 Joonas Niilola
2019-06-17  6:25 Michał Górny
2018-01-09 16:12 Mike Gilbert
2018-01-09 16:12 Mike Gilbert
2017-08-29 20:30 Patrice Clement

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1728890040.a9924d310c7adbc1948b1086e3d4b67b8cdecd19.flow@gentoo \
    --to=flow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox