commit:     89bae30fab90f218bd7a1d56e825819e4576a4c4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon May 26 02:37:29 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon May 26 02:37:29 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89bae30f

dev-cpp/glog: backport fixes to 0.6.0

* Fix CMake 4
* Skip buggy tests

Bug: https://bugs.gentoo.org/863599
Bug: https://bugs.gentoo.org/954083
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/glog/files/glog-0.6.0-cmake-4.patch | 18 ++++++++
 dev-cpp/glog/glog-0.6.0-r1.ebuild           | 64 +++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/dev-cpp/glog/files/glog-0.6.0-cmake-4.patch 
b/dev-cpp/glog/files/glog-0.6.0-cmake-4.patch
new file mode 100644
index 000000000000..0f17e373e2e3
--- /dev/null
+++ b/dev-cpp/glog/files/glog-0.6.0-cmake-4.patch
@@ -0,0 +1,18 @@
+https://bugs.gentoo.org/954083
+https://github.com/google/glog/commit/3411d58669fe07e70335b252299432a00d1e7c6c
+
+From 3411d58669fe07e70335b252299432a00d1e7c6c Mon Sep 17 00:00:00 2001
+From: Sergiu Deitsch <[email protected]>
+Date: Thu, 5 Oct 2023 00:48:10 +0200
+Subject: [PATCH] cmake: eliminate deprecation warning
+
+--- a/cmake/GetCacheVariables.cmake
++++ b/cmake/GetCacheVariables.cmake
+@@ -1,5 +1,5 @@
+ cmake_policy (PUSH)
+-cmake_policy (VERSION 3.3)
++cmake_policy (VERSION 3.16...3.27)
+ 
+ include (CMakeParseArguments)
+ 
+

diff --git a/dev-cpp/glog/glog-0.6.0-r1.ebuild 
b/dev-cpp/glog/glog-0.6.0-r1.ebuild
new file mode 100644
index 000000000000..fca47051d4d7
--- /dev/null
+++ b/dev-cpp/glog/glog-0.6.0-r1.ebuild
@@ -0,0 +1,64 @@
+# Copyright 2011-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Google Logging library"
+HOMEPAGE="https://github.com/google/glog";
+
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://github.com/google/glog";
+       inherit git-r3
+else
+       SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+       KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="BSD"
+SLOT="0/1"
+IUSE="gflags +libunwind llvm-libunwind test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       gflags? ( dev-cpp/gflags:=[${MULTILIB_USEDEP}] )
+       libunwind? (
+               llvm-libunwind? ( llvm-runtimes/libunwind:=[${MULTILIB_USEDEP}] 
)
+               !llvm-libunwind? ( sys-libs/libunwind:=[${MULTILIB_USEDEP}] )
+       )
+"
+DEPEND="
+       ${RDEPEND}
+       test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.6.0-cmake-4.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_TESTING=$(usex test ON OFF)
+               -DWITH_GFLAGS=$(usex gflags ON OFF)
+               -DWITH_GTEST=$(usex test ON OFF)
+               -DWITH_UNWIND=$(usex libunwind ON OFF)
+       )
+
+       cmake-multilib_src_configure
+}
+
+src_test() {
+       # Tests have a history of being brittle: bug #863599
+       CMAKE_SKIP_TESTS=(
+               logging
+               stacktrace
+               symbolize
+               log_severity_conversion
+               includes_vlog_is_on
+               includes_raw_logging
+       )
+
+       cmake-multilib_src_test -j1
+}

Reply via email to