<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/7375653e34deb7d53d4223fcb81cf1aaadf8f963">https://github.com/macports/macports-ports/commit/7375653e34deb7d53d4223fcb81cf1aaadf8f963</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 7375653e34d gperftools: use cmake; add variants benchmark, tests Fixes: https://trac.macports.org/ticket/67472
</span>7375653e34d is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 7375653e34deb7d53d4223fcb81cf1aaadf8f963
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Sun Jun 4 11:42:35 2023 -0400
<span style='display:block; white-space:pre;color:#404040;'> gperftools: use cmake; add variants benchmark, tests
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/67472
</span>---
devel/gperftools/Portfile | 44 +++++++++++++++++++---
.../files/patch-malloc_bench-random_shuffle.diff | 26 +++++++++++++
2 files changed, 65 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/gperftools/Portfile b/devel/gperftools/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index bfc4edebbc2..7d814fee6f8 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/gperftools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/gperftools/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2,8 +2,11 @@
</span>
PortSystem 1.0
PortGroup github 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+PortGroup cmake 1.1
</span>
github.setup gperftools gperftools 2.10 gperftools-
<span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> categories devel
license BSD
maintainers nomaintainer
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -17,10 +20,41 @@ checksums rmd160 54e35f78813b5409bc6f82e0894b0b8e42ad711a \
</span> sha256 83e3bfdd28b8bcf53222c3798d4d395d52dadbbae59e8730c4a6d31a9c3732d8 \
size 1616679
<span style='display:block; white-space:pre;background:#ffe0e0;'>-patchfiles patch-rosetta.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Patch to replace use of std::random_shuffle, removed in Cxx 2017 and later
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-malloc_bench-random_shuffle.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-rosetta.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+compiler.cxx_standard 2017
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+cmake.set_cxx_standard yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if { [string match *clang* ${configure.compiler}] } {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Quiet deprecation warnings
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.cxxflags-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-deprecated-declarations \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-error=unknown-warning-option \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Wno-unknown-warning-option
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+depends_lib-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ port:libunwind
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+configure.args-append \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DBUILD_TESTING:BOOL=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Dgperftools_build_benchmark:BOOL=OFF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant benchmark description {Enable benchmark support} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-replace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Dgperftools_build_benchmark:BOOL=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -Dgperftools_build_benchmark:BOOL=ON
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-compiler.cxx_standard \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 2011
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# TODO: Add check to verify that port is already installed first, otherwise fails
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+variant tests description {Enable test support} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ configure.args-replace \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DBUILD_TESTING:BOOL=OFF \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ -DBUILD_TESTING:BOOL=ON
</span>
<span style='display:block; white-space:pre;background:#ffe0e0;'>-test.run yes
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-test.target check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test.run yes
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ test.target check
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/gperftools/files/patch-malloc_bench-random_shuffle.diff b/devel/gperftools/files/patch-malloc_bench-random_shuffle.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..8b89d5f545a
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/gperftools/files/patch-malloc_bench-random_shuffle.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,26 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#==================================================================================================
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Patch to replace use of std::random_shuffle - removed in Cxx 2017 and later - with the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# official replacement: std::shuffle, along with an explicit random device source.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#==================================================================================================
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- benchmark/malloc_bench.cc.orig 2023-06-04 11:06:08.000000000 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ benchmark/malloc_bench.cc 2023-06-04 11:08:48.000000000 -0400
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -30,6 +30,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <stdint.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include <algorithm>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#include <random>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #include "run_benchmark.h"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -233,7 +234,10 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (int i = 0; i < count; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ randomize_buffer[i] = malloc(size);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- std::random_shuffle(randomize_buffer, randomize_buffer + count);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // https://en.cppreference.com/w/cpp/algorithm/random_shuffle
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::random_device rd;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::mt19937 g(rd());
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ std::shuffle(randomize_buffer, randomize_buffer + count, g);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (int i = 0; i < count; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ free(randomize_buffer[i]);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span></pre><pre style='margin:0'>
</pre>