lfam pushed a commit to branch core-updates
in repository guix.

commit 1ab3e3b26fdc43d48826119d4f51379571dd89b6
Author: Leo Famulari <l...@famulari.name>
AuthorDate: Thu Jul 11 15:18:51 2024 -0400

    gnu: Boost: Fix a bug that breaks libetonyek.
    
    This fixes <https://issues.guix.gnu.org/72040>.
    
    * gnu/packages/patches/boost-fix-duplicate-definitions-bug.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Add it.
    * gnu/packages/boost.scm (boost)[source]: Use it.
    (boost-for-source-highlight): New variable, not using the patch.
    * gnu/packages/pretty-print.scm (source-highlight)[inputs]: Replace BOOST 
with
    BOOST-FOR-SOURCE-HIGHLIGHT.
    
    Change-Id: I5fbc9eb5000aefd7d3a14cc7a0482741032b5400
---
 gnu/local.mk                                       |  1 +
 gnu/packages/boost.scm                             | 26 +++++++++++++--
 .../boost-fix-duplicate-definitions-bug.patch      | 38 ++++++++++++++++++++++
 gnu/packages/pretty-print.scm                      |  2 +-
 4 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 8a9c89225b..f722acfb8a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1016,6 +1016,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/bloomberg-bde-cmake-module-path.patch   \
   %D%/packages/patches/bloomberg-bde-tools-fix-install-path.patch      \
   %D%/packages/patches/boolector-find-googletest.patch \
+  %D%/packages/patches/boost-fix-duplicate-definitions-bug.patch       \
   %D%/packages/patches/breezy-fix-gio.patch                    \
   %D%/packages/patches/byobu-writable-status.patch             \
   %D%/packages/patches/bubblewrap-fix-locale-in-tests.patch    \
diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm
index 70774617f0..2fdea80896 100644
--- a/gnu/packages/boost.scm
+++ b/gnu/packages/boost.scm
@@ -74,9 +74,11 @@
                                   version "/source/boost_"
                                   (version-with-underscores version) 
".tar.bz2"))
               (patches
-               (list (boost-patch
-                      "0001-unordered-fix-copy-assign.patch" version
-                      "09j61m5xh7099k5na9i43x5rra51znf7vm2nyh89yqpizcll9q66")))
+                (append
+                 (search-patches "boost-fix-duplicate-definitions-bug.patch")
+                 (list (boost-patch
+                        "0001-unordered-fix-copy-assign.patch" version
+                        
"09j61m5xh7099k5na9i43x5rra51znf7vm2nyh89yqpizcll9q66"))))
               (patch-flags '("-p2"))
               (sha256
                (base32
@@ -204,6 +206,24 @@ across a broad spectrum of applications.")
     (license (license:x11-style "https://www.boost.org/LICENSE_1_0.txt";
                                 "Some components have other similar 
licences."))))
 
+(define-public boost-for-source-highlight
+  (hidden-package (package (inherit boost)
+    (name "boost")
+    (version "1.83.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append 
"https://boostorg.jfrog.io/artifactory/main/release/";
+                                  version "/source/boost_"
+                                  (version-with-underscores version) 
".tar.bz2"))
+              (patches
+                 (list (boost-patch
+                        "0001-unordered-fix-copy-assign.patch" version
+                        
"09j61m5xh7099k5na9i43x5rra51znf7vm2nyh89yqpizcll9q66")))
+              (patch-flags '("-p2"))
+              (sha256
+               (base32
+                "13iviiwk1srpw9dmiwabkxv56v0pl0zggjp8zxy1419k5zzfsy34")))))))
+
 ;; Sadly, this is needed for irods.  It won't link with 1.69 or later.
 (define-public boost-for-irods
   (package
diff --git a/gnu/packages/patches/boost-fix-duplicate-definitions-bug.patch 
b/gnu/packages/patches/boost-fix-duplicate-definitions-bug.patch
new file mode 100644
index 0000000000..f2e3decedb
--- /dev/null
+++ b/gnu/packages/patches/boost-fix-duplicate-definitions-bug.patch
@@ -0,0 +1,38 @@
+Fix the build of libetonyek / libreoffice:
+
+https://issues.guix.gnu.org/72040
+
+Patch copied from upstream source repository:
+
+https://github.com/boostorg/phoenix/commit/8913607a3788cb82d48ed461ea59c919b7bad3df
+
+From 8913607a3788cb82d48ed461ea59c919b7bad3df Mon Sep 17 00:00:00 2001
+From: djowel <djo...@gmail.com>
+Date: Tue, 29 Aug 2023 14:32:41 +0800
+Subject: [PATCH] Disabled this for now, due to ODR violations $$$ Fix Me $$$
+
+---
+ include/boost/phoenix/stl/tuple.hpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/boost/phoenix/stl/tuple.hpp 
b/include/boost/phoenix/stl/tuple.hpp
+index fb9440d2..a2e42bec 100644
+--- a/include/boost/phoenix/stl/tuple.hpp
++++ b/include/boost/phoenix/stl/tuple.hpp
+@@ -106,6 +106,7 @@ namespace boost { namespace phoenix {
+         tuple_detail::idx_wrap<N>(), t);
+     }
+ 
++#if 0 // Disabled this for now due to ODR viaolations $$$ Fix Me $$$
+     // Make unpacked argument placeholders
+     namespace placeholders {
+         #define BOOST_PP_LOCAL_LIMITS (1, BOOST_PHOENIX_ARG_LIMIT)
+@@ -114,6 +115,8 @@ namespace boost { namespace phoenix {
+             boost::phoenix::get_<(N)-1>(boost::phoenix::placeholders::arg1);
+         #include BOOST_PP_LOCAL_ITERATE()
+     }
++#endif
++
+ }} // namespace boost::phoenix
+ 
+ #endif // C++ 14
diff --git a/gnu/packages/pretty-print.scm b/gnu/packages/pretty-print.scm
index 220761fc07..d8ff1664b4 100644
--- a/gnu/packages/pretty-print.scm
+++ b/gnu/packages/pretty-print.scm
@@ -305,7 +305,7 @@ a fast alternative to @code{IOStreams}.")
     ;; The ctags that comes with emacs does not support the --excmd options,
     ;; so can't be used
     (inputs
-     (list boost))
+     (list boost-for-source-highlight))
     (native-inputs
      (list bison flex))
     (arguments

Reply via email to