summaryrefslogtreecommitdiff
path: root/dev-cpp/benchmark/benchmark-1.9.2.ebuild
diff options
context:
space:
mode:
authorMattéo Rossillol‑‑Laruelle <beatussum@protonmail.com>2025-04-07 15:06:17 +0200
committerSam James <sam@gentoo.org>2025-04-20 03:59:35 +0100
commit84c519c349a61d42d1e75ec04139cb1509e49f8f (patch)
treeb18932c77e57e140e9013dfba868cb514320205d /dev-cpp/benchmark/benchmark-1.9.2.ebuild
parent6351bf5ecd06be2b87df53e483949ffa1578d6c3 (diff)
downloadgentoo-84c519c349a61d42d1e75ec04139cb1509e49f8f.tar.gz
gentoo-84c519c349a61d42d1e75ec04139cb1509e49f8f.tar.bz2
gentoo-84c519c349a61d42d1e75ec04139cb1509e49f8f.zip
dev-cpp/benchmark: add 1.9.2
Signed-off-by: Mattéo Rossillol‑‑Laruelle <beatussum@protonmail.com> Closes: https://github.com/gentoo/gentoo/pull/41493 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp/benchmark/benchmark-1.9.2.ebuild')
-rw-r--r--dev-cpp/benchmark/benchmark-1.9.2.ebuild93
1 files changed, 93 insertions, 0 deletions
diff --git a/dev-cpp/benchmark/benchmark-1.9.2.ebuild b/dev-cpp/benchmark/benchmark-1.9.2.ebuild
new file mode 100644
index 000000000000..3e6747fb2d8a
--- /dev/null
+++ b/dev-cpp/benchmark/benchmark-1.9.2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..13} )
+
+inherit cmake-multilib flag-o-matic python-single-r1
+
+DESCRIPTION="A microbenchmark support library"
+HOMEPAGE="https://github.com/google/benchmark/"
+SRC_URI="https://github.com/google/benchmark/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="Apache-2.0"
+SLOT="0/$(ver_cut 1)"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="doc debug libpfm test +tools"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="tools? ( ${PYTHON_REQUIRED_USE} )"
+
+DEPEND="libpfm? ( dev-libs/libpfm:= )"
+
+RDEPEND="
+ ${DEPEND}
+
+ tools? (
+ $(python_gen_cond_dep '
+ dev-python/numpy[${PYTHON_USEDEP}]
+ >=dev-python/scipy-1.10.0[${PYTHON_USEDEP}]
+ ')
+
+ ${PYTHON_DEPS}
+ )
+"
+
+BDEPEND="
+ doc? ( app-text/doxygen )
+ test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )
+"
+
+PATCHES=( "${FILESDIR}/${PN}-1.9.0-fix-documentation-installation.patch" )
+
+pkg_setup() {
+ use tools && python-single-r1_pkg_setup
+}
+
+multilib_src_configure() {
+ # bug #943629
+ use debug || append-cppflags -DNDEBUG
+
+ local mycmakeargs=(
+ -DBENCHMARK_ENABLE_DOXYGEN="$(usex doc)"
+ -DBENCHMARK_ENABLE_GTEST_TESTS="$(usex test)"
+
+ # Users should control this via *FLAGS
+ -DBENCHMARK_ENABLE_LTO=OFF
+
+ -DBENCHMARK_ENABLE_LIBPFM="$(multilib_native_usex libpfm)"
+ -DBENCHMARK_ENABLE_TESTING="$(usex test)"
+ -DBENCHMARK_ENABLE_WERROR=OFF
+ -DBENCHMARK_INSTALL_DOCS="$(usex doc)"
+ -DBENCHMARK_USE_BUNDLED_GTEST=OFF
+
+ # This is determined by profile
+ -DBENCHMARK_USE_LIBCXX=OFF
+ )
+
+ cmake_src_configure
+}
+
+multilib_src_test() {
+ CMAKE_SKIP_TESTS=(
+ # CMake already warns on these being brittle w/ diff
+ # compiler versions. Could do with investigation if bored
+ # but not critical. See bug #941538.
+
+ run_donotoptimize_assembly_test_CHECK
+ run_state_assembly_test_CHECK
+ run_clobber_memory_assembly_test_CHECK
+ )
+
+ cmake_src_test
+}
+
+multilib_src_install_all() {
+ dodoc CONTRIBUTING.md
+ dodoc CONTRIBUTORS
+
+ if use tools; then
+ python_domodule tools/gbench
+ python_doscript tools/compare.py
+ python_doscript tools/strip_asm.py
+ fi
+}