commit:     8fc4a928bfd3c81a153c7094a52a5180d76521de
Author:     Violet Purcell <vimproved <AT> inventati <DOT> org>
AuthorDate: Fri Sep 22 00:24:12 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 22 15:42:47 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8fc4a928

media-plugins/calf: Remove usage of std::bind2nd

Fixes build with C++17+.

Upstream-PR: https://github.com/calf-studio-gear/calf/pull/331
Closes: https://bugs.gentoo.org/914506
Signed-off-by: Violet Purcell <vimproved <AT> inventati.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-plugins/calf/calf-0.90.3-r2.ebuild           |  1 +
 media-plugins/calf/calf-9999.ebuild                |  1 +
 .../files/calf-0.90.3-replace-std-bind2nd.patch    | 32 ++++++++++++++++++++++
 3 files changed, 34 insertions(+)

diff --git a/media-plugins/calf/calf-0.90.3-r2.ebuild 
b/media-plugins/calf/calf-0.90.3-r2.ebuild
index 0d4c5797eb81..45506cd79a76 100644
--- a/media-plugins/calf/calf-0.90.3-r2.ebuild
+++ b/media-plugins/calf/calf-0.90.3-r2.ebuild
@@ -47,6 +47,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-0.90.1-htmldir.patch"
        "${FILESDIR}/${PN}-0.90.1-desktop.patch"
        "${FILESDIR}/${PN}-0.90.3-fix-build-with-lld.patch"
+       "${FILESDIR}/${PN}-0.90.3-replace-std-bind2nd.patch"
 )
 
 src_prepare() {

diff --git a/media-plugins/calf/calf-9999.ebuild 
b/media-plugins/calf/calf-9999.ebuild
index 26b234a8a03a..f232db75e494 100644
--- a/media-plugins/calf/calf-9999.ebuild
+++ b/media-plugins/calf/calf-9999.ebuild
@@ -47,6 +47,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-0.90.1-htmldir.patch"
        "${FILESDIR}/${PN}-0.90.1-desktop.patch"
        "${FILESDIR}/${PN}-9999-fix-build-with-lld.patch"
+       "${FILESDIR}/${PN}-0.90.3-replace-std-bind2nd.patch"
 )
 
 src_prepare() {

diff --git a/media-plugins/calf/files/calf-0.90.3-replace-std-bind2nd.patch 
b/media-plugins/calf/files/calf-0.90.3-replace-std-bind2nd.patch
new file mode 100644
index 000000000000..5ba16efcfb1b
--- /dev/null
+++ b/media-plugins/calf/files/calf-0.90.3-replace-std-bind2nd.patch
@@ -0,0 +1,32 @@
+From 
https://github.com/calf-studio-gear/calf/pull/331/commits/849a0b589fb86cb4b9869738b270fd24859bd23b
 Mon Sep 17 00:00:00 2001
+From: Violet Purcell <[email protected]>
+Date: Thu, 21 Sep 2023 18:16:35 -0400
+Subject: [PATCH] Replace use of std::bind2nd with std::bind
+
+std::bind2nd was deprecated in C++11 and removed in C++17. Remove usage
+of it and replace with std::bind.
+
+Signed-off-by: Violet Purcell <[email protected]>
+--- a/src/calf/orfanidis_eq.h
++++ b/src/calf/orfanidis_eq.h
+@@ -748,7 +748,7 @@ private:
+                       std::vector<eq_double_t> v = landen(k, tol);
+ 
+                       std::transform(v.begin(), v.end(), v.begin(),
+-                          bind2nd(std::plus<eq_double_t>(), 1.0));
++                          bind(std::plus<eq_double_t>(), 1.0, 
std::placeholders::_1));
+ 
+                       K = std::accumulate(v.begin(), v.end(),
+                           1, std::multiplies<eq_double_t>()) * M_PI/2.0;
+@@ -764,7 +764,7 @@ private:
+                       std::vector<eq_double_t> vp = landen(kp, tol);
+ 
+                       std::transform(vp.begin(), vp.end(), vp.begin(),
+-                          bind2nd(std::plus<eq_double_t>(), 1.0));
++                          bind(std::plus<eq_double_t>(), 1.0, 
std::placeholders::_1));
+ 
+                       Kprime = std::accumulate(vp.begin(), vp.end(),
+                           1.0, std::multiplies<eq_double_t>()) * M_PI/2.0;
+-- 
+2.42.0
+

Reply via email to