1 |
commit: c79a0e06a7be1a76ec0368168cafdcf708b977b7 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 14 22:45:05 2023 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 14 22:46:19 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c79a0e06 |
7 |
|
8 |
net-print/cups-filters: fix build w/ C++17 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/898076 |
11 |
Closes: https://bugs.gentoo.org/901243 |
12 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
13 |
|
14 |
.../cups-filters/cups-filters-1.28.17-r1.ebuild | 4 +++ |
15 |
.../files/cups-filters-1.28.17-c++17.patch | 31 ++++++++++++++++++++++ |
16 |
2 files changed, 35 insertions(+) |
17 |
|
18 |
diff --git a/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild b/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild |
19 |
index 2e2bbd3cef13..13b7dac3fc7b 100644 |
20 |
--- a/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild |
21 |
+++ b/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild |
22 |
@@ -51,6 +51,10 @@ BDEPEND=" |
23 |
test? ( media-fonts/dejavu ) |
24 |
" |
25 |
|
26 |
+PATCHES=( |
27 |
+ "${FILESDIR}"/${PN}-1.28.17-c++17.patch |
28 |
+) |
29 |
+ |
30 |
src_configure() { |
31 |
# Bug #898156 |
32 |
append-cxxflags -std=c++17 |
33 |
|
34 |
diff --git a/net-print/cups-filters/files/cups-filters-1.28.17-c++17.patch b/net-print/cups-filters/files/cups-filters-1.28.17-c++17.patch |
35 |
new file mode 100644 |
36 |
index 000000000000..f8f63ccd4724 |
37 |
--- /dev/null |
38 |
+++ b/net-print/cups-filters/files/cups-filters-1.28.17-c++17.patch |
39 |
@@ -0,0 +1,31 @@ |
40 |
+https://bugs.gentoo.org/901243 |
41 |
+(and https://bugs.gentoo.org/898076) |
42 |
+https://github.com/OpenPrinting/cups-filters/pull/505 |
43 |
+ |
44 |
+From 104fba23b1c0c67c92777b3165c6dca99558a656 Mon Sep 17 00:00:00 2001 |
45 |
+From: Khem Raj <raj.khem@×××××.com> |
46 |
+Date: Mon, 6 Feb 2023 18:13:52 -0800 |
47 |
+Subject: [PATCH] use noexcept(false) instead of throw() from c++17 onwards |
48 |
+ |
49 |
+C++17 removed dynamic exception specifications [1] |
50 |
+they had been deprecated since C++11, replace |
51 |
+throw(whatever) with noexcept(false). |
52 |
+ |
53 |
+[1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0003r5.html |
54 |
+ |
55 |
+Signed-off-by: Khem Raj <raj.khem@×××××.com> |
56 |
+--- a/filter/pdftoraster.cxx |
57 |
++++ b/filter/pdftoraster.cxx |
58 |
+@@ -2148,7 +2148,11 @@ int main(int argc, char *argv[]) { |
59 |
+ /* For compatibility with g++ >= 4.7 compilers _GLIBCXX_THROW |
60 |
+ * should be used as a guard, otherwise use traditional definition */ |
61 |
+ #ifndef _GLIBCXX_THROW |
62 |
++#if __cplusplus < 201703L |
63 |
+ #define _GLIBCXX_THROW throw |
64 |
++#else |
65 |
++#define _GLIBCXX_THROW(x) noexcept(false) |
66 |
++#endif |
67 |
+ #endif |
68 |
+ |
69 |
+ void * operator new(size_t size) _GLIBCXX_THROW (std::bad_alloc) |
70 |
+ |