diff mbox series

[bug#73439,v5] gnu: libreoffice: Update to 24.8.3.2.

Message ID 20241119073200.13650-1-ngraves@ngraves.fr
State New
Headers show
Series [bug#73439,v5] gnu: libreoffice: Update to 24.8.3.2. | expand

Commit Message

Nicolas Graves Nov. 19, 2024, 7:31 a.m. UTC
* gnu/packages/libreoffice.scm (libreoffice): Update to 24.8.3.2.
[source]<uri>: Add secondary uri.
[arguments]<#:phases>: Fix build issue related to issue 43579 in phase
'prepare-src.
[configure-flags]: Add optimising flags --disable-cve-tests,
--enable-readonly-installset, --disable-dependency-tracking.
[native-inputs]: Add gcc-toolchain-12.
[inputs]: Add argon2, zxcvbn-c.

Change-Id: I72e0ebb4d075c47ea168b181f969a97f9249150a
---
 gnu/packages/libreoffice.scm | 57 ++++++++++++++++++++++++++++++------
 1 file changed, 48 insertions(+), 9 deletions(-)

Comments

Ludovic Courtès Nov. 20, 2024, 12:13 p.m. UTC | #1
Hi,

Nicolas Graves <ngraves@ngraves.fr> skribis:

> * gnu/packages/libreoffice.scm (libreoffice): Update to 24.8.3.2.
> [source]<uri>: Add secondary uri.
> [arguments]<#:phases>: Fix build issue related to issue 43579 in phase
> 'prepare-src.
> [configure-flags]: Add optimising flags --disable-cve-tests,
> --enable-readonly-installset, --disable-dependency-tracking.
> [native-inputs]: Add gcc-toolchain-12.
> [inputs]: Add argon2, zxcvbn-c.
>
> Change-Id: I72e0ebb4d075c47ea168b181f969a97f9249150a
> +              ;; https://issues.guix.gnu.org/43579
> +              (substitute* '("sal/rtl/math.cxx"
> +                               "sc/source/core/tool/math.cxx")
> +                  (("std::(fe[gs]etround|feclearexcept|fetestexcept)" all suffix)
> +                   suffix))

I doubt removing “std:” is necessary, is it?

> +              (let ((gcc-11-dir (dirname
> +                                 (dirname
> +                                  (dirname
> +                                   (search-input-directory
> +                                    inputs "share/doc/gcc-11.4.0"))))))

Or just (search-input-directory inputs "/include/c++") ?

That would be more consistent (and concise :-)) since this is about
setting CPLUS_INCLUDE_PATH.

Otherwise LGTM, thanks!

Ludo’.
Nicolas Graves Nov. 20, 2024, 2:05 p.m. UTC | #2
On 2024-11-20 13:13, Ludovic Courtès wrote:

> Hi,
>
> Nicolas Graves <ngraves@ngraves.fr> skribis:
>
>> * gnu/packages/libreoffice.scm (libreoffice): Update to 24.8.3.2.
>> [source]<uri>: Add secondary uri.
>> [arguments]<#:phases>: Fix build issue related to issue 43579 in phase
>> 'prepare-src.
>> [configure-flags]: Add optimising flags --disable-cve-tests,
>> --enable-readonly-installset, --disable-dependency-tracking.
>> [native-inputs]: Add gcc-toolchain-12.
>> [inputs]: Add argon2, zxcvbn-c.
>>
>> Change-Id: I72e0ebb4d075c47ea168b181f969a97f9249150a
>> +              ;; https://issues.guix.gnu.org/43579
>> +              (substitute* '("sal/rtl/math.cxx"
>> +                               "sc/source/core/tool/math.cxx")
>> +                  (("std::(fe[gs]etround|feclearexcept|fetestexcept)" all suffix)
>> +                   suffix))
>
> I doubt removing “std:” is necessary, is it?

I can retry without, but I think the error still happens. The
CPLUS_INCLUDE_PATH fix is only fixing the error you were experiencing,
not the one I had at first.  I can still fiddle with that and remove
more in the CPLUS_INCLUDE_PATH, but I've tried a lot of variations
(including not removing std::) and this configuration is the only I
manage to build the whole thing with.

>> +              (let ((gcc-11-dir (dirname
>> +                                 (dirname
>> +                                  (dirname
>> +                                   (search-input-directory
>> +                                    inputs "share/doc/gcc-11.4.0"))))))
>
> Or just (search-input-directory inputs "/include/c++") ?
>
> That would be more consistent (and concise :-)) since this is about
> setting CPLUS_INCLUDE_PATH.

When trying that, it will remove the gcc-12 one, not the gcc-11 one,
which I think is the one causing the bug.  I know it's not pretty, but
since we explicitely put gcc-12 in inputs, I'm fine with explicitely
citing gcc-11. I can use package-version if better for gcc-11,
but we can't just search-directory-inputs here. 

> Otherwise LGTM, thanks!
>
> Ludo’.
>
>
>
Nicolas Graves Nov. 20, 2024, 5:25 p.m. UTC | #3
On 2024-11-20 15:05, Nicolas Graves via Guix-patches via wrote:

> On 2024-11-20 13:13, Ludovic Courtès wrote:
>> I doubt removing “std:” is necessary, is it?
>
> I can retry without, but I think the error still happens. The
> CPLUS_INCLUDE_PATH fix is only fixing the error you were experiencing,
> not the one I had at first.  I can still fiddle with that and remove
> more in the CPLUS_INCLUDE_PATH, but I've tried a lot of variations
> (including not removing std::) and this configuration is the only I
> manage to build the whole thing with.

I can confirm that it's not trivial to do better, and that the std::
removal is necessary.
diff mbox series

Patch

diff --git a/gnu/packages/libreoffice.scm b/gnu/packages/libreoffice.scm
index ed8dfd432b..22112ccee7 100644
--- a/gnu/packages/libreoffice.scm
+++ b/gnu/packages/libreoffice.scm
@@ -13,7 +13,7 @@ 
 ;;; Copyright © 2018, 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de>
 ;;; Copyright © 2019 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2020 Marcin Karpezo <sirmacik@wioo.waw.pl>
-;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
+;;; Copyright © 2023, 2024 Nicolas Graves <ngraves@ngraves.fr>
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -63,6 +63,7 @@  (define-module (gnu packages libreoffice)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages game-development)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -80,6 +81,7 @@  (define-module (gnu packages libreoffice)
   #:use-module (gnu packages maths)
   #:use-module (gnu packages nss)
   #:use-module (gnu packages openldap)
+  #:use-module (gnu packages password-utils)
   #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages perl-compression)
@@ -891,16 +893,20 @@  (define dtoa
 (define-public libreoffice
   (package
     (name "libreoffice")
-    (version "7.6.7.2")               ;keep in sync with hunspell dictionaries
+    (version "24.8.3.2")               ;keep in sync with hunspell dictionaries
     (source
      (origin
        (method url-fetch)
        (uri
-        (string-append
-         "https://download.documentfoundation.org/libreoffice/src/"
-         (version-prefix version 3) "/libreoffice-" version ".tar.xz"))
+        (list
+         (string-append
+          "https://download.documentfoundation.org/libreoffice/src/"
+          (version-prefix version 3) "/libreoffice-" version ".tar.xz")
+         (string-append
+          "https://downloadarchive.documentfoundation.org/libreoffice/old/"
+          version "/src/libreoffice-" version ".tar.xz")))
        (sha256
-        (base32 "159vbv4zhibfd4xjdamcqs4h0p3h5y79kcjwrmshvjhs23p55l3m"))))
+        (base32 "1sa7bxxh7v26p77vj1mspynhn2l2b1vnz1mpyczhnmcxcan9nw2x"))))
     (build-system glib-or-gtk-build-system)
     (arguments
      (list
@@ -908,6 +914,8 @@  (define-public libreoffice
                            ,@%glib-or-gtk-build-system-modules)
       #:modules `(((guix build python-build-system) #:select (python-version))
                   (ice-9 textual-ports)
+                  (srfi srfi-1)
+                  (srfi srfi-26)
                   ,@%glib-or-gtk-build-system-modules)
       #:tests? #f                       ; Building the tests already fails.
       #:phases
@@ -961,7 +969,29 @@  (define-public libreoffice
                              "shell/source/unix/misc/senddoc.sh")
                 (("/usr/bin/xdg-open")
                  (search-input-file inputs "/bin/xdg-open")))
-              (setenv "CPPFLAGS" "-std=c++17")))
+
+              ;; https://issues.guix.gnu.org/43579
+              (substitute* '("sal/rtl/math.cxx"
+                               "sc/source/core/tool/math.cxx")
+                  (("std::(fe[gs]etround|feclearexcept|fetestexcept)" all suffix)
+                   suffix))
+              (let ((gcc-11-dir (dirname
+                                 (dirname
+                                  (dirname
+                                   (search-input-directory
+                                    inputs "share/doc/gcc-11.4.0"))))))
+                (setenv
+                 "CPLUS_INCLUDE_PATH"
+                 (string-join
+                  (remove
+                   (cut member <>
+                        (list
+                         (string-append gcc-11-dir "/include/c++")
+                         (string-append gcc-11-dir "/include")))
+                   (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
+                  ":")))
+
+              (setenv "CPPFLAGS" "-std=c++20")))
           (add-after 'install 'reset-zip-timestamps
             (lambda _
               (for-each (lambda (file)
@@ -1077,18 +1107,26 @@  (define (install-python-script name)
          "--enable-lto"
          ;; Avoid errors rebuilding the Gtk icon cache, at least on i686-linux.
          "--without-galleries"
-         "--enable-build-opensymbol")))
+         "--enable-build-opensymbol"
+         ;; Avoid CVE tests.
+         "--disable-cve-tests"
+         ;; Do not try to write to the store.
+         "--enable-readonly-installset"
+         ;; XXX: This flag should speed-up builds.
+         "--disable-dependency-tracking")))
     (native-inputs
      (list bison
            cppunit
            flex
            frozen                       ;header-only library
+           gcc-12
            pkg-config
            python-wrapper
            which
            ziptime))
     (inputs
-     (list bluez
+     (list argon2
+           bluez
            boost
            box2d
            clucene
@@ -1168,6 +1206,7 @@  (define (install-python-script name)
            xdg-utils
            xmlsec-nss
            zip
+           zxcvbn-c
            zxing-cpp))
     (home-page "https://www.libreoffice.org/")
     (synopsis "Office suite")