commit:     9c005c1fbae4fbea1f1b537579213a632ca357d1
Author:     Christopher Fore <csfore <AT> posteo <DOT> net>
AuthorDate: Thu Aug  8 12:26:00 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug  8 12:43:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c005c1f

app-text/qpdf: Fix compilation on GCC 15

- Patch is from upstream
- Tests pass

Error:
/var/tmp/portage/app-text/qpdf-11.9.1/work/qpdf-11.9.1/libtests/cxx11.cc:75:16:
error: `uint8_t' was not declared in this scope
   75 |     check_size<uint8_t>(1, false);
      |                ^~~~~~~

/var/tmp/portage/app-text/qpdf-11.9.1/work/qpdf-11.9.1/libtests/cxx11.cc:10:1:
note: `uint8_t' is defined in header `<cstdint>';
this is probably fixable by adding `#include <cstdint>'
    9 | #include <regex>
  +++ |+#include <cstdint>
   10 | #include <type_traits>

Closes: https://bugs.gentoo.org/937571
Signed-off-by: Christopher Fore <csfore <AT> posteo.net>
Closes: https://github.com/gentoo/gentoo/pull/38017
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../qpdf/files/qpdf-11.9.1-include-cstdint.patch   | 37 ++++++++++++++++++++++
 app-text/qpdf/qpdf-11.9.1.ebuild                   |  4 +++
 2 files changed, 41 insertions(+)

diff --git a/app-text/qpdf/files/qpdf-11.9.1-include-cstdint.patch 
b/app-text/qpdf/files/qpdf-11.9.1-include-cstdint.patch
new file mode 100644
index 000000000000..0c292e3e9626
--- /dev/null
+++ b/app-text/qpdf/files/qpdf-11.9.1-include-cstdint.patch
@@ -0,0 +1,37 @@
+https://github.com/qpdf/qpdf/commit/6918f0b7eb0160059d712ee19ba0ce2d65b9f89c
+
+From: Christopher Fore <csf...@posteo.net>
+Date: Mon, 5 Aug 2024 09:41:50 -0400
+Subject: [PATCH] libtests: include cstdint for GCC 15
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+GCC 15 starts to no longer include this by default, requiring it to be
+explicitly included.
+
+Error message:
+libtests/cxx11.cc:75:16: error: ‘uint8_t’ was not declared in this scope
+   75 |     check_size<uint8_t>(1, false);
+      |                ^~~~~~~
+libtests/cxx11.cc:10:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; this 
is probably fixable by adding ‘#include <cstdint>’
+    9 | #include <regex>
+  +++ |+#include <cstdint>
+   10 | #include <type_traits>
+
+Signed-off-by: Christopher Fore <csf...@posteo.net>
+---
+ libtests/cxx11.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libtests/cxx11.cc b/libtests/cxx11.cc
+index 59c74fa86..953ad00f9 100644
+--- a/libtests/cxx11.cc
++++ b/libtests/cxx11.cc
+@@ -1,5 +1,6 @@
+ #include <qpdf/assert_test.h>
+ 
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <functional>

diff --git a/app-text/qpdf/qpdf-11.9.1.ebuild b/app-text/qpdf/qpdf-11.9.1.ebuild
index 055841cf1036..a329de298b37 100644
--- a/app-text/qpdf/qpdf-11.9.1.ebuild
+++ b/app-text/qpdf/qpdf-11.9.1.ebuild
@@ -54,6 +54,10 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 
 VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/jberkenbilt.asc
 
+PATCHES=(
+       "${FILESDIR}/${PN}-11.9.1-include-cstdint.patch" #937571
+)
+
 src_unpack() {
        if use verify-sig ; then
                verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}

Reply via email to