commit:     b6405d399294fba767ee6047ab2267286f423a84
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  4 12:35:21 2024 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Oct  4 13:01:24 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6405d39

media-libs/zxing-cpp: Fix build with >=libcxx-19

Closes: https://bugs.gentoo.org/939897
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../zxing-cpp/files/zxing-cpp-2.2.1-cmake.patch    | 27 ++++++++++++++++++++
 .../zxing-cpp/files/zxing-cpp-2.2.1-cxx20.patch    | 29 ++++++++++++++++++++++
 media-libs/zxing-cpp/zxing-cpp-2.2.1.ebuild        |  5 ++++
 3 files changed, 61 insertions(+)

diff --git a/media-libs/zxing-cpp/files/zxing-cpp-2.2.1-cmake.patch 
b/media-libs/zxing-cpp/files/zxing-cpp-2.2.1-cmake.patch
new file mode 100644
index 000000000000..58bffda307a6
--- /dev/null
+++ b/media-libs/zxing-cpp/files/zxing-cpp-2.2.1-cmake.patch
@@ -0,0 +1,27 @@
+From 77475338af4920fe2568d69b2318a0d5e9be77ce Mon Sep 17 00:00:00 2001
+From: axxel <awag...@gmail.com>
+Date: Fri, 15 Mar 2024 22:23:17 +0100
+Subject: [PATCH] cmake: if (NOT CMAKE_CXX...) should have been if (NOT DEFINED
+ CMAKE_CXX...)
+
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 678fa6b62b..d7a1d81c85 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -61,10 +61,10 @@ if(NOT BUILD_DEPENDENCIES IN_LIST BUILD_DEPENDENCIES_LIST)
+     message(FATAL_ERROR "BUILD_DEPENDENCIES must be one of 
${BUILD_DEPENDENCIES_LIST}")
+ endif()
+ 
+-if (NOT CMAKE_CXX_STANDARD)
++if (NOT DEFINED CMAKE_CXX_STANDARD)
+     set (CMAKE_CXX_STANDARD 17)
+ endif()
+-if (NOT CMAKE_CXX_EXTENSIONS)
++if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
+     set (CMAKE_CXX_EXTENSIONS OFF)
+ endif()
+ 

diff --git a/media-libs/zxing-cpp/files/zxing-cpp-2.2.1-cxx20.patch 
b/media-libs/zxing-cpp/files/zxing-cpp-2.2.1-cxx20.patch
new file mode 100644
index 000000000000..9d89c9a8b38f
--- /dev/null
+++ b/media-libs/zxing-cpp/files/zxing-cpp-2.2.1-cxx20.patch
@@ -0,0 +1,29 @@
+From d98739ceaac1c477879b9c4fba89ea76dba2d539 Mon Sep 17 00:00:00 2001
+From: axxel <awag...@gmail.com>
+Date: Sun, 22 Sep 2024 22:39:11 +0200
+Subject: [PATCH] cmake: switch to c++-20 by default for the core library
+
+I finally accept the incurred performance penalty from the position
+independent DataMatrix detection by default.
+
+This is finally fixing #386. It also (sufficiently) fixes #822 and thereby
+supersedes #836.
+---
+ CMakeLists.txt           | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b602712d79..fee4c68cdc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -71,7 +71,9 @@ if(NOT ZXING_DEPENDENCIES IN_LIST ZXING_DEPENDENCIES_LIST)
+ endif()
+ 
+ if (NOT DEFINED CMAKE_CXX_STANDARD)
+-    set (CMAKE_CXX_STANDARD 17)
++    set (CMAKE_CXX_STANDARD 20)
++    # Allow the fallback to earlier versions if the compiler does not support 
it.
++    set(CMAKE_CXX_STANDARD_REQUIRED OFF)
+ endif()
+ if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
+     set (CMAKE_CXX_EXTENSIONS OFF)

diff --git a/media-libs/zxing-cpp/zxing-cpp-2.2.1.ebuild 
b/media-libs/zxing-cpp/zxing-cpp-2.2.1.ebuild
index 1fac2dd0fe8e..e1dcb9341fc3 100644
--- a/media-libs/zxing-cpp/zxing-cpp-2.2.1.ebuild
+++ b/media-libs/zxing-cpp/zxing-cpp-2.2.1.ebuild
@@ -14,6 +14,11 @@ SLOT="0/3"
 KEYWORDS="amd64 ~arm arm64 ~loong ppc64 ~riscv x86"
 IUSE=""
 
+PATCHES=(
+       "${FILESDIR}/${P}-cmake.patch"
+       "${FILESDIR}/${P}-cxx20.patch" # bug 939897
+)
+
 src_configure() {
        local mycmakeargs=(
                -DBUILD_EXAMPLES=OFF # nothing is installed

Reply via email to