public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/google-benchmark] f44: Use the cmake declarative buildsystem
@ 2026-08-06  5:54 Benjamin A. Beasley
  0 siblings, 0 replies; only message in thread
From: Benjamin A. Beasley @ 2026-08-06  5:54 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/google-benchmark
Branch : f44
Commit : af48cef0722385f4b8b1ddeee4f1f1c4e6d8d30f
Author : Benjamin A. Beasley <code@musicinmybrain.net>
Date   : 2026-05-17T16:28:47+01:00
Stats  : +49/-61 in 1 file(s)
URL    : https://src.fedoraproject.org/rpms/google-benchmark/c/af48cef0722385f4b8b1ddeee4f1f1c4e6d8d30f?branch=f44

Log:
Use the cmake declarative buildsystem

---
diff --git a/google-benchmark.spec b/google-benchmark.spec
index 933edbf..6f31729 100644
--- a/google-benchmark.spec
+++ b/google-benchmark.spec
@@ -1,3 +1,5 @@
+%bcond ctest 1
+# Build with libpfm for hardware performance counter support?
 %bcond libpfm   1
 
 Name:           google-benchmark
@@ -19,68 +21,24 @@ Source:         %{url}/archive/v%{version}/benchmark-%{version}.tar.gz
 # https://github.com/google/benchmark/issues/2173
 Patch:          0001-In-PerfCountersTest.MultiThreaded-serialize-worker-t.patch
 
-BuildRequires:  cmake
-BuildRequires:  gcc
-BuildRequires:  gcc-c++
-
-BuildRequires:  cmake(GTest)
-BuildRequires:  gmock-devel
-# Required for locale_impermeablity_test so the en_US.UTF-8 locale is valid.
-BuildRequires:  glibc-langpack-en
-%if %{with libpfm}
-BuildRequires:  libpfm-devel
-%endif
-
-%description
-A library to support the benchmarking of functions, similar to unit-tests.
-
-
-%package devel
-Summary:        Development files for %{name}
-
-Requires:       %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
-# Removed for Fedora 43; we can drop the Obsoletes after Fedora 45.
-Obsoletes:      %{name}-doc < 1.9.4-9
-
-%description devel
-%{summary}.
-
-
-%prep
-%autosetup -n benchmark-%{version} -p1
-sed -e '/get_git_version/d' -e '/-Werror/d' -i CMakeLists.txt
-
-
-%conf
+BuildSystem:    cmake
 # Do not enable BENCHMARK_ENABLE_ASSEMBLY_TESTS, since it is for a very
 # specific OS and compiler:
 # https://github.com/google/benchmark/issues/1326#issuecomment-1015221235
-%cmake \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DGIT_VERSION='%{version}' \
-    -DBENCHMARK_DOWNLOAD_DEPENDENCIES:BOOL=OFF \
-    -DBENCHMARK_ENABLE_DOXYGEN:BOOL=OFF \
-    -DBENCHMARK_ENABLE_GTEST_TESTS:BOOL=ON \
-    -DBENCHMARK_ENABLE_ASSEMBLY_TESTS:BOOL=OFF \
-%if %{with libpfm}
-    -DBENCHMARK_ENABLE_LIBPFM:BOOL=ON \
-%endif
-    -DBENCHMARK_ENABLE_INSTALL:BOOL=ON \
-    -DBENCHMARK_ENABLE_TESTING:BOOL=ON \
-    -DBENCHMARK_INSTALL_DOCS:BOOL=OFF \
-    -DBENCHMARK_INSTALL_TOOLS:BOOL=OFF \
+BuildOption(conf): %{shrink:
+    -DCMAKE_BUILD_TYPE=Release
+    -DGIT_VERSION='%{version}'
+    -DBENCHMARK_DOWNLOAD_DEPENDENCIES:BOOL=OFF
+    -DBENCHMARK_ENABLE_DOXYGEN:BOOL=OFF
+    -DBENCHMARK_ENABLE_GTEST_TESTS:BOOL=%{?with_ctest:ON}%{?!with_ctest:OFF}
+    -DBENCHMARK_ENABLE_ASSEMBLY_TESTS:BOOL=OFF
+    -DBENCHMARK_ENABLE_LIBPFM:BOOL=%{?with_libfpm:ON}%{?!with_libfpm:OFF}
+    -DBENCHMARK_ENABLE_INSTALL:BOOL=ON
+    -DBENCHMARK_ENABLE_TESTING:BOOL=%{?with_ctest:ON}%{?!with_ctest:OFF}
+    -DBENCHMARK_INSTALL_DOCS:BOOL=OFF
+    -DBENCHMARK_INSTALL_TOOLS:BOOL=OFF
     -DBENCHMARK_USE_BUNDLED_GTEST:BOOL=OFF
-
-
-%build
-%cmake_build
-
-
-%install
-%cmake_install
-
-
-%check
+    }
 %ifarch s390x
 # [BUG] Multiple PerfCountersTest failures with counter.num_counters() zero on
 # some s390x systems
@@ -106,11 +64,41 @@ sed -e '/get_git_version/d' -e '/-Werror/d' -i CMakeLists.txt
 # We don’t bother attempting to run the four tests that do succeed in
 # perf_counters_gtest; it’s much more straightforward to just skip these two
 # executables at the ctest level entirely, and little is lost by doing so.
-%ctest --exclude-regex '^perf_counters_g?test$'
-%else
-%ctest
+BuildOption(check): --exclude-regex '^perf_counters_g?test$'
 %endif
 
+BuildRequires:  gcc
+BuildRequires:  gcc-c++
+
+%if %{with libpfm}
+BuildRequires:  libpfm-devel
+%endif
+
+%if %{with ctest}
+BuildRequires:  cmake(GTest)
+BuildRequires:  gmock-devel
+# Required for locale_impermeablity_test so the en_US.UTF-8 locale is valid.
+BuildRequires:  glibc-langpack-en
+%endif
+
+%description
+A library to support the benchmarking of functions, similar to unit-tests.
+
+
+%package devel
+Summary:        Development files for %{name}
+
+Requires:       %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
+# Removed for Fedora 43; we can drop the Obsoletes after Fedora 45.
+Obsoletes:      %{name}-doc < 1.9.4-9
+
+%description devel
+%{summary}.
+
+
+%prep -a
+sed -e '/get_git_version/d' -e '/-Werror/d' -i CMakeLists.txt
+
 
 %files
 %license AUTHORS

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-06  5:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-06  5:54 [rpms/google-benchmark] f44: Use the cmake declarative buildsystem Benjamin A. Beasley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox