janneke pushed a commit to branch core-packages-team
in repository guix.

commit 08b155bb3fa173339d22cfb31dc01dca6063a9a1
Author: Janneke Nieuwenhuizen <jann...@gnu.org>
AuthorDate: Thu Jan 2 19:46:42 2025 +0100

    gnu: doc++: Fix build with gcc-14.
    
    * gnu/packages/patches/doc++-gcc-14.patch: New fdile.
    * gnu/local.mk (dist_patch_DATA): Register it.
    * gnu/packages/documentation.scm (doc++)[source]: Use it.
    
    Change-Id: Ifb388a5e45c1a4a5031b327e06de97774dc761a1
---
 gnu/local.mk                            |   1 +
 gnu/packages/documentation.scm          |   5 +-
 gnu/packages/patches/doc++-gcc-14.patch | 187 ++++++++++++++++++++++++++++++++
 3 files changed, 191 insertions(+), 2 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 1d84fa966d..01054ce031 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1177,6 +1177,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/dhclient-script-resolvconf-support.patch \
   %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \
   %D%/packages/patches/dkimproxy-add-ipv6-support.patch                \
+  %D%/packages/patches/doc++-gcc-14.patch                      \
   %D%/packages/patches/docbook-utils-documentation-edits.patch \
   %D%/packages/patches/docbook-utils-escape-characters.patch   \
   %D%/packages/patches/docbook-utils-remove-jade-sp.patch      \
diff --git a/gnu/packages/documentation.scm b/gnu/packages/documentation.scm
index 21f6df2dcc..686c51f3a2 100644
--- a/gnu/packages/documentation.scm
+++ b/gnu/packages/documentation.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2020, 2021 Michael Rohleder <m...@rohleder.de>
 ;;; Copyright © 2021, 2022 Marius Bakke <mar...@gnu.org>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.couno...@gmail.com>
-;;; Copyright © 2023 Janneke Nieuwenhuizen <jann...@gnu.org>
+;;; Copyright © 2023, 2025 Janneke Nieuwenhuizen <jann...@gnu.org>
 ;;; Copyright © 2024 Felix Gruber <fel...@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -276,7 +276,8 @@ an alternative representation if Unicode output is not 
available.")
                (base32
                 "0i37zlxl8g352s4hzpdx0657k5x3czh3xcsfr27irc708gb277pn"))
               (patches (search-patches "doc++-include-directives.patch"
-                                       "doc++-segfault-fix.patch"))))
+                                       "doc++-segfault-fix.patch"
+                                       "doc++-gcc-14.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      (list flex gettext-minimal))
diff --git a/gnu/packages/patches/doc++-gcc-14.patch 
b/gnu/packages/patches/doc++-gcc-14.patch
new file mode 100644
index 0000000000..64c2dace04
--- /dev/null
+++ b/gnu/packages/patches/doc++-gcc-14.patch
@@ -0,0 +1,187 @@
+Upstream-status: Not presented upstream.
+
+--- doc++-3.4.10/src/doc2dbxml.ll.orig 2025-01-02 19:35:28.284584323 +0100
++++ doc++-3.4.10/src/doc2dbxml.ll      2025-01-02 19:36:30.316732013 +0100
+@@ -57,8 +57,8 @@
+ static int    skip          = 0;
+ static int    tab           = 0;
+ static int    yyLineNr      = 0;
+-static Entry* ref           = 0;
+-static Entry* noref         = ref + 1;
++static Entry* g_ref    = 0;
++static Entry* noref         = g_ref + 1;
+ static char   yyFileName[264];
+ static bool           mathmode      = false;
+ static int    tabFlag       = 0;
+@@ -147,28 +147,28 @@
+                       }
+ 
+ <Ref>[^}]*            {
+-                      if(ref == 0)
++                      if(g_ref == 0)
+                           {
+                           McString tmp = yytext;
+-                          ref = getRefEntry(tmp, current);
++                          g_ref = getRefEntry(tmp, current);
+                           }
+                       REJECT;
+                       }
+ 
+ <Ref>"}"              {
+-                      if(ref && ref != noref)
++                      if(g_ref && g_ref != noref)
+                           {
+                           fprintf(out, " ($\\rightarrow$ ");
+-                          if(MAKE_DOC(ref))
++                          if(MAKE_DOC(g_ref))
+                               {
+-                              ref->dumpNumber(out);
++                              g_ref->dumpNumber(out);
+                               fprintf(out, ",");
+                               }
+                           fprintf(out, " {\\em page }\\pageref{cxx.");
+-                          ref->dumpNumber(out);
++                          g_ref->dumpNumber(out);
+                           fprintf(out, "})");
+                           }
+-                      ref = 0;
++                      g_ref = 0;
+                       BEGIN(0);
+                       }
+ 
+--- doc++-3.4.10/src/doc2dbsgml.ll.orig        2025-01-02 19:39:08.061103757 
+0100
++++ doc++-3.4.10/src/doc2dbsgml.ll     2025-01-02 19:39:52.201206812 +0100
+@@ -54,8 +54,8 @@
+ static int    skip          = 0;
+ static int    tab           = 0;
+ static int    yyLineNr      = 0;
+-static Entry* ref           = 0;
+-static Entry* noref         = ref + 1;
++static Entry* g_ref           = 0;
++static Entry* noref         = g_ref + 1;
+ static char   yyFileName[264];
+ static bool           mathmode      = false;
+ static int    tabFlag       = 0;
+@@ -144,28 +144,28 @@
+                       }
+ 
+ <Ref>[^}]*            {
+-                      if(ref == 0)
++                      if(g_ref == 0)
+                           {
+                           McString tmp = yytext;
+-                          ref = getRefEntry(tmp, current);
++                          g_ref = getRefEntry(tmp, current);
+                           }
+                       REJECT;
+                       }
+ 
+ <Ref>"}"              {
+-                      if(ref && ref != noref)
++                      if(g_ref && g_ref != noref)
+                           {
+                           fprintf(out, " ($\\rightarrow$ ");
+-                          if(MAKE_DOC(ref))
++                          if(MAKE_DOC(g_ref))
+                               {
+-                              ref->dumpNumber(out);
++                              g_ref->dumpNumber(out);
+                               fprintf(out, ",");
+                               }
+                           fprintf(out, " {\\em page }\\pageref{cxx.");
+-                          ref->dumpNumber(out);
++                          g_ref->dumpNumber(out);
+                           fprintf(out, "})");
+                           }
+-                      ref = 0;
++                      g_ref = 0;
+                       BEGIN(0);
+                       }
+ 
+--- doc++-3.4.10/src/doc2tex.ll.orig   2025-01-02 19:40:11.785252404 +0100
++++ doc++-3.4.10/src/doc2tex.ll        2025-01-02 19:40:39.181316047 +0100
+@@ -59,8 +59,8 @@
+ static int    yyLineNr        = 0;
+ static int    texBracketCount = 0;
+ static McString       refStr          = "";
+-static Entry* ref             = 0;
+-static Entry* noref           = ref + 1;
++static Entry* g_ref           = 0;
++static Entry* noref           = g_ref + 1;
+ static char   yyFileName[264];
+ bool          mathmode        = false;
+ static int    tabFlag         = 0;
+@@ -186,30 +186,30 @@
+                       }
+ 
+ <Ref>[^}]*            {
+-                      if(ref == 0)
++                      if(g_ref == 0)
+                           {
+                           refStr = McString(yytext, 0, yyleng - 2);
+-                          ref = getRefEntry(refStr, current);
++                          g_ref = getRefEntry(refStr, current);
+                           }
+                       REJECT;
+                       }
+ 
+ <Ref>"}"              {
+-                      if(ref && ref != noref)
++                      if(g_ref && g_ref != noref)
+                           {
+                           fprintf(out, " ($\\rightarrow$ ");
+-                          if(MAKE_DOC(ref))
++                          if(MAKE_DOC(g_ref))
+                               {
+-                              ref->dumpNumber(out);
++                              g_ref->dumpNumber(out);
+                               fprintf(out, ",");
+                               }
+                           fprintf(out, " {\\em page }\\pageref{cxx.");
+-                          ref->dumpNumber(out);
++                          g_ref->dumpNumber(out);
+                           fprintf(out, "})");
+                           }
+                       else
+                           fprintf(out, refStr.c_str());
+-                      ref = 0;
++                      g_ref = 0;
+                       refStr.clear();
+                       BEGIN(0);
+                       }
+@@ -246,28 +246,28 @@
+                       }
+ 
+ <Link>[^ ]*           {
+-                      if(ref == 0)
++                      if(g_ref == 0)
+                           {
+                           McString tmp = yytext;
+-                          ref = getRefEntry(tmp, current);
++                          g_ref = getRefEntry(tmp, current);
+                           }
+                       REJECT;
+                       }
+ 
+ <Link>"}"             {
+-                      if(ref && ref != noref)
++                      if(g_ref && g_ref != noref)
+                           {
+                           fprintf(out, " ($\\rightarrow$ ");
+-                          if(MAKE_DOC(ref))
++                          if(MAKE_DOC(g_ref))
+                               {
+-                              ref->dumpNumber(out);
++                              g_ref->dumpNumber(out);
+                               fprintf(out, ",");
+                               }
+                           fprintf(out, " {\\em page }\\pageref{cxx.");
+-                          ref->dumpNumber(out);
++                          g_ref->dumpNumber(out);
+                           fprintf(out, "})");
+                           }
+-                      ref = 0;
++                      g_ref = 0;
+                       BEGIN(0);
+                       }
+ 

Reply via email to