GNU bug report logs - #76922
[PATCH] gnu: cairo: Add patch to fix regression when writing PDFs with fonts

Previous Next

Package: guix-patches;

Reported by: Remco van 't Veer <remco <at> remworks.net>

Date: Mon, 10 Mar 2025 16:18:01 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 76922 in the body.
You can then email your comments to 76922 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Mon, 10 Mar 2025 16:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Remco van 't Veer <remco <at> remworks.net>:
New bug report received and forwarded. Copy sent to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org. (Mon, 10 Mar 2025 16:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Remco van 't Veer <remco <at> remworks.net>
To: guix-patches <at> gnu.org
Cc: Remco van 't Veer <remco <at> remworks.net>
Subject: [PATCH] gnu: cairo: Add patch to fix regression when writing PDFs
 with fonts
Date: Mon, 10 Mar 2025 17:15:46 +0100
Applied patch fixes out of memory errors when writing PDFs with fonts
in xournalpp and others.  See also:

  https://gitlab.freedesktop.org/cairo/cairo/-/issues/870

* gnu/local.mk: Register patch.
* gnu/packages/gtk.scm (cairo): Add patch.
* gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs: Add patch.

Change-Id: Id6475d0ddb27208486bf41e18de72d116da110fb
---
 gnu/local.mk                                  |  3 +-
 gnu/packages/gtk.scm                          |  2 ++
 ...cairo-cff-dont-fail-if-no-local-subs.patch | 34 +++++++++++++++++++
 3 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 880af09168..f26c79b3e1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -48,7 +48,7 @@
 # Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 # Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 # Copyright © 2022 Daniel Meißner <daniel.meissner-i4k <at> ruhr-uni-bochum.de>
-# Copyright © 2022, 2024 Remco van 't Veer <remco <at> remworks.net>
+# Copyright © 2022, 2024, 2025 Remco van 't Veer <remco <at> remworks.net>
 # Copyright © 2022, 2024 Artyom V. Poptsov <poptsov.artyom <at> gmail.com>
 # Copyright © 2022, 2023 John Kehayias <john.kehayias <at> protonmail.com>
 # Copyright © 2022 muradm <mail <at> muradm.net>
@@ -1069,6 +1069,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/busybox-add-missing-sha-NI-guard.patch	\
   %D%/packages/patches/c2rust-ast-exporter-local-search.patch	\
   %D%/packages/patches/cadical-add-shared-library.patch		\
+  %D%/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch		\
   %D%/packages/patches/calibre-no-updates-dialog.patch		\
   %D%/packages/patches/calibre-remove-test-sqlite.patch		\
   %D%/packages/patches/calibre-remove-test-unrar.patch		\
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 846103ff9e..f2b3f19897 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -38,6 +38,7 @@
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2024 John Kehayias <john.kehayias <at> protonmail.com>
 ;;; Copyright © 2025 Florian Pelz <pelzflorian <at> pelzflorian.de>
+;;; Copyright © 2025 Remco van 't Veer <remco <at> remworks.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -178,6 +179,7 @@ (define cairo
        (uri
         (string-append "https://cairographics.org/releases/cairo-"
                        version ".tar.xz"))
+       (patches (search-patches "cairo-cff-dont-fail-if-no-local-subs.patch"))
        (sha256
         (base32 "0nnli5cghygbl9bvlbjls7nspnrrzx1y1pbd7p649s154js9nax6"))))
     (build-system meson-build-system)
diff --git a/gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch b/gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch
new file mode 100644
index 0000000000..ed1056a0c8
--- /dev/null
+++ b/gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch
@@ -0,0 +1,34 @@
+From f19e2fe080ddcfce93c8234a919fd882f3d63362 Mon Sep 17 00:00:00 2001
+From: Adrian Johnson <ajohnson <at> redneon.com>
+Date: Fri, 13 Sep 2024 06:28:39 +0930
+Subject: [PATCH] cff: Don't fail if no local subs
+
+Fixes: #870
+---
+ src/cairo-cff-subset.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
+index 076cb2b0a..8a7de0065 100644
+--- a/src/cairo-cff-subset.c
++++ b/src/cairo-cff-subset.c
+@@ -952,9 +952,13 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t   *font,
+ 	 decode_number (operand, nominal_width);
+ 
+     num_subs = _cairo_array_num_elements (local_sub_index);
+-    *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
+-    if (unlikely (*local_subs_used == NULL))
+-	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++    if (num_subs > 0) {
++	*local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
++	if (unlikely (*local_subs_used == NULL))
++	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++    } else {
++	*local_subs_used = NULL;
++    }
+ 
+     if (num_subs < 1240)
+ 	*local_sub_bias = 107;
+-- 
+GitLab
+

base-commit: d0510dcd824e1b3fda62a8841e792581d7b8de8d
-- 
2.48.1





Information forwarded to guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Mon, 10 Mar 2025 19:00:02 GMT) Full text and rfc822 format available.

Message #8 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Remco van 't Veer <remco <at> remworks.net>, 76922 <at> debbugs.gnu.org
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#76922] [PATCH] gnu: cairo: Add patch to fix regression
 when writing PDFs with fonts
Date: Mon, 10 Mar 2025 20:00:15 +0100
Am Montag, dem 10.03.2025 um 17:15 +0100 schrieb Remco van 't Veer:
> Applied patch fixes out of memory errors when writing PDFs with fonts
> in xournalpp and others.  See also:
> 
>   https://gitlab.freedesktop.org/cairo/cairo/-/issues/870
> 
> * gnu/local.mk: Register patch.
> * gnu/packages/gtk.scm (cairo): Add patch.
> * gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs: Add
> patch.
> 
> Change-Id: Id6475d0ddb27208486bf41e18de72d116da110fb
> ---
Out of curiosity, how many packages do you need to rebuild with this
patch?  It could well be that you'd need to use a graft.

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Mon, 10 Mar 2025 20:09:02 GMT) Full text and rfc822 format available.

Message #11 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Remco van 't Veer <remco <at> remworks.net>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 76922 <at> debbugs.gnu.org, Vivien Kraus <vivien <at> planete-kraus.eu>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#76922] [PATCH] gnu: cairo: Add patch to fix regression
 when writing PDFs with fonts
Date: Mon, 10 Mar 2025 21:07:56 +0100
Hi,

2025/03/10, Liliana Marie Prikler:

> Am Montag, dem 10.03.2025 um 17:15 +0100 schrieb Remco van 't Veer:
>> Applied patch fixes out of memory errors when writing PDFs with fonts
>> in xournalpp and others.  See also:
>> 
>>   https://gitlab.freedesktop.org/cairo/cairo/-/issues/870
>> 
>> * gnu/local.mk: Register patch.
>> * gnu/packages/gtk.scm (cairo): Add patch.
>> * gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs: Add
>> patch.
>> 
>> Change-Id: Id6475d0ddb27208486bf41e18de72d116da110fb
>> ---
> Out of curiosity, how many packages do you need to rebuild with this
> patch?  It could well be that you'd need to use a graft.

Yes you a probably right because I sent this patch after Ludo shooed me
away when I made a PR on codeberg
(https://codeberg.org/civodul/guix/pulls/17#issuecomment-2995653).

  $ ./pre-inst-env guix refresh -l -e '(@@ (gnu packages gtk) cairo)' | wc -w
  4279

Would you like me to make a v2 and use a graft?

Cheers,
Remco




Information forwarded to guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Mon, 10 Mar 2025 20:25:01 GMT) Full text and rfc822 format available.

Message #14 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Remco van 't Veer <remco <at> remworks.net>
Cc: 76922 <at> debbugs.gnu.org, Vivien Kraus <vivien <at> planete-kraus.eu>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: Re: [bug#76922] [PATCH] gnu: cairo: Add patch to fix regression
 when writing PDFs with fonts
Date: Mon, 10 Mar 2025 21:25:45 +0100
Am Montag, dem 10.03.2025 um 21:07 +0100 schrieb Remco van 't Veer:
>   $ ./pre-inst-env guix refresh -l -e '(@@ (gnu packages gtk) cairo)'
> | wc -w
>   4279
> 
> Would you like me to make a v2 and use a graft?
Yes, please do.  We can ungraft it later on core-packages-team, gnome-
team, or a dedicated ungrafting branch.

Cheers




Information forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Mon, 10 Mar 2025 20:31:01 GMT) Full text and rfc822 format available.

Message #17 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Remco van 't Veer <remco <at> remworks.net>
To: 76922 <at> debbugs.gnu.org
Cc: Remco van 't Veer <remco <at> remworks.net>
Subject: [PATCH v2] gnu: cairo: Add patch to fix regression when writing PDFs
 with fonts
Date: Mon, 10 Mar 2025 21:29:17 +0100
Applied patch fixes out of memory errors when writing PDFs with fonts
in xournalpp and others.  See also:

  https://gitlab.freedesktop.org/cairo/cairo/-/issues/870

* gnu/local.mk: Register patch.
* gnu/packages/gtk.scm (cairo): Add patch.
* gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs: Add patch.
---
 gnu/local.mk                                  |  3 +-
 gnu/packages/gtk.scm                          |  9 +++++
 ...cairo-cff-dont-fail-if-no-local-subs.patch | 34 +++++++++++++++++++
 3 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 880af09168..f26c79b3e1 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -48,7 +48,7 @@
 # Copyright © 2021 Andrew Tropin <andrew <at> trop.in>
 # Copyright © 2021 Simon Tournier <zimon.toutoune <at> gmail.com>
 # Copyright © 2022 Daniel Meißner <daniel.meissner-i4k <at> ruhr-uni-bochum.de>
-# Copyright © 2022, 2024 Remco van 't Veer <remco <at> remworks.net>
+# Copyright © 2022, 2024, 2025 Remco van 't Veer <remco <at> remworks.net>
 # Copyright © 2022, 2024 Artyom V. Poptsov <poptsov.artyom <at> gmail.com>
 # Copyright © 2022, 2023 John Kehayias <john.kehayias <at> protonmail.com>
 # Copyright © 2022 muradm <mail <at> muradm.net>
@@ -1069,6 +1069,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/busybox-add-missing-sha-NI-guard.patch	\
   %D%/packages/patches/c2rust-ast-exporter-local-search.patch	\
   %D%/packages/patches/cadical-add-shared-library.patch		\
+  %D%/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch		\
   %D%/packages/patches/calibre-no-updates-dialog.patch		\
   %D%/packages/patches/calibre-remove-test-sqlite.patch		\
   %D%/packages/patches/calibre-remove-test-unrar.patch		\
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 846103ff9e..09b1566e95 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -38,6 +38,7 @@
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2024 John Kehayias <john.kehayias <at> protonmail.com>
 ;;; Copyright © 2025 Florian Pelz <pelzflorian <at> pelzflorian.de>
+;;; Copyright © 2025 Remco van 't Veer <remco <at> remworks.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -172,6 +173,7 @@ (define cairo
   (package
     (name "cairo")
     (version "1.18.2")
+    (replacement cairo-fixed)
     (source
      (origin
        (method url-fetch)
@@ -238,6 +240,13 @@ (define cairo
     ;; Hide and have cairo-with-documentation public.
     (properties '((hidden? . #t)))))
 
+(define cairo-fixed
+  (package
+    (inherit cairo)
+    (source (origin
+              (inherit (package-source cairo))
+              (patches (search-patches "cairo-cff-dont-fail-if-no-local-subs.patch"))))))
+
 (define-public cairo-with-documentation
   ;; cairo's docs must be built in a separate package since it requires
   ;; gtk-doc, which in turn depends on cairo.
diff --git a/gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch b/gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch
new file mode 100644
index 0000000000..ed1056a0c8
--- /dev/null
+++ b/gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs.patch
@@ -0,0 +1,34 @@
+From f19e2fe080ddcfce93c8234a919fd882f3d63362 Mon Sep 17 00:00:00 2001
+From: Adrian Johnson <ajohnson <at> redneon.com>
+Date: Fri, 13 Sep 2024 06:28:39 +0930
+Subject: [PATCH] cff: Don't fail if no local subs
+
+Fixes: #870
+---
+ src/cairo-cff-subset.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
+index 076cb2b0a..8a7de0065 100644
+--- a/src/cairo-cff-subset.c
++++ b/src/cairo-cff-subset.c
+@@ -952,9 +952,13 @@ cairo_cff_font_read_private_dict (cairo_cff_font_t   *font,
+ 	 decode_number (operand, nominal_width);
+ 
+     num_subs = _cairo_array_num_elements (local_sub_index);
+-    *local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
+-    if (unlikely (*local_subs_used == NULL))
+-	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++    if (num_subs > 0) {
++	*local_subs_used = _cairo_calloc_ab (num_subs, sizeof (cairo_bool_t));
++	if (unlikely (*local_subs_used == NULL))
++	    return _cairo_error (CAIRO_STATUS_NO_MEMORY);
++    } else {
++	*local_subs_used = NULL;
++    }
+ 
+     if (num_subs < 1240)
+ 	*local_sub_bias = 107;
+-- 
+GitLab
+

base-commit: d0510dcd824e1b3fda62a8841e792581d7b8de8d
-- 
2.48.1





Information forwarded to guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Wed, 12 Mar 2025 00:27:02 GMT) Full text and rfc822 format available.

Message #20 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 76922 <at> debbugs.gnu.org, Vivien Kraus <vivien <at> planete-kraus.eu>,
 Remco van 't Veer <remco <at> remworks.net>
Subject: Re: [bug#76922] [PATCH] gnu: cairo: Add patch to fix regression
 when writing PDFs with fonts
Date: Wed, 12 Mar 2025 09:25:46 +0900
Hi,

Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:

> Am Montag, dem 10.03.2025 um 17:15 +0100 schrieb Remco van 't Veer:
>> Applied patch fixes out of memory errors when writing PDFs with fonts
>> in xournalpp and others.  See also:
>> 
>>   https://gitlab.freedesktop.org/cairo/cairo/-/issues/870
>> 
>> * gnu/local.mk: Register patch.
>> * gnu/packages/gtk.scm (cairo): Add patch.
>> * gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs: Add
>> patch.
>> 
>> Change-Id: Id6475d0ddb27208486bf41e18de72d116da110fb
>> ---
> Out of curiosity, how many packages do you need to rebuild with this
> patch?  It could well be that you'd need to use a graft.

Too many (15k).  I've hit that problem too.  I'd suggest grafting to
1.18.4 directly instead of carrying patches.

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Wed, 12 Mar 2025 00:30:02 GMT) Full text and rfc822 format available.

Message #23 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Remco van 't Veer <remco <at> remworks.net>
Cc: 76922 <at> debbugs.gnu.org, Vivien Kraus <vivien <at> planete-kraus.eu>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#76922] [PATCH v2] gnu: cairo: Add patch to fix regression
 when writing PDFs with fonts
Date: Wed, 12 Mar 2025 09:28:56 +0900
Hi,

Remco van 't Veer <remco <at> remworks.net> writes:

> Applied patch fixes out of memory errors when writing PDFs with fonts
> in xournalpp and others.  See also:
>
>   https://gitlab.freedesktop.org/cairo/cairo/-/issues/870
>
> * gnu/local.mk: Register patch.
> * gnu/packages/gtk.scm (cairo): Add patch.
> * gnu/packages/patches/cairo-cff-dont-fail-if-no-local-subs: Add patch.

I've hit that bug too, it's an annoying one!  Thanks for looking into
it.  Your patch is fine, but I think we could also graft directly to
1.18.4 since it's a patch version bump and should be compatible with the
1.18.2 we have, per semver.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

--
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Wed, 12 Mar 2025 09:40:01 GMT) Full text and rfc822 format available.

Message #26 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Remco van 't Veer <remco <at> remworks.net>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 76922 <at> debbugs.gnu.org, Vivien Kraus <vivien <at> planete-kraus.eu>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: [bug#76922] [PATCH v2] gnu: cairo: Add patch to fix regression
 when writing PDFs with fonts
Date: Wed, 12 Mar 2025 10:39:32 +0100
Hi,

2025/03/12, Maxim Cournoyer:

> I've hit that bug too, it's an annoying one!  Thanks for looking into
> it.  Your patch is fine, but I think we could also graft directly to
> 1.18.4 since it's a patch version bump and should be compatible with the
> 1.18.2 we have, per semver.

Oh yes, that can work too.  Just tried grafting with 1.18.4 and it does
fix this problem in xournalpp.  I'm not sure if it introduces others but
it seems okay..  I'll make a v3.

Cheers,
Remco




Information forwarded to liliana.prikler <at> gmail.com, maxim.cournoyer <at> gmail.com, vivien <at> planete-kraus.eu, guix-patches <at> gnu.org:
bug#76922; Package guix-patches. (Wed, 12 Mar 2025 09:43:01 GMT) Full text and rfc822 format available.

Message #29 received at 76922 <at> debbugs.gnu.org (full text, mbox):

From: Remco van 't Veer <remco <at> remworks.net>
To: 76922 <at> debbugs.gnu.org
Cc: Remco van 't Veer <remco <at> remworks.net>
Subject: [PATCH v3] gnu: cairo: Fix regression writing PDFs with fonts via
 graft.
Date: Wed, 12 Mar 2025 10:41:37 +0100
Fix out of memory errors when writing PDFs with fonts embedded in
xournalpp and others.  See also:

  https://gitlab.freedesktop.org/cairo/cairo/-/issues/870

* gnu/packages/gtk.scm (cairo)[replacement]: New field pointing to cairo-1.18.4.
* gnu/packages/gtk.scm (cairo-1.18.4): Add package.

Change-Id: I6efa5a3acdf39fe78e558173f896f3a6abbc5c27
---
 gnu/packages/gtk.scm | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 846103ff9e..4d49246206 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -38,6 +38,7 @@
 ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2024 John Kehayias <john.kehayias <at> protonmail.com>
 ;;; Copyright © 2025 Florian Pelz <pelzflorian <at> pelzflorian.de>
+;;; Copyright © 2025 Remco van 't Veer <remco <at> remworks.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -172,6 +173,7 @@ (define cairo
   (package
     (name "cairo")
     (version "1.18.2")
+    (replacement cairo-1.18.4)
     (source
      (origin
        (method url-fetch)
@@ -238,6 +240,19 @@ (define cairo
     ;; Hide and have cairo-with-documentation public.
     (properties '((hidden? . #t)))))
 
+(define cairo-1.18.4
+  (package
+    (inherit cairo)
+    (version "1.18.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append "https://cairographics.org/releases/cairo-"
+                       version ".tar.xz"))
+       (sha256
+        (base32 "1jrcqfcna0358aqrk7rnys1hwq6k36ilr9r62bg26j3fi8hdhpj4"))))))
+
 (define-public cairo-with-documentation
   ;; cairo's docs must be built in a separate package since it requires
   ;; gtk-doc, which in turn depends on cairo.

base-commit: d0510dcd824e1b3fda62a8841e792581d7b8de8d
-- 
2.48.1





Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Thu, 13 Mar 2025 01:19:02 GMT) Full text and rfc822 format available.

Notification sent to Remco van 't Veer <remco <at> remworks.net>:
bug acknowledged by developer. (Thu, 13 Mar 2025 01:19:02 GMT) Full text and rfc822 format available.

Message #34 received at 76922-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Remco van 't Veer <remco <at> remworks.net>
Cc: Vivien Kraus <vivien <at> planete-kraus.eu>, 76922-done <at> debbugs.gnu.org,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: Re: bug#76922: [PATCH] gnu: cairo: Add patch to fix regression when
 writing PDFs with fonts
Date: Thu, 13 Mar 2025 10:18:08 +0900
Hi,

Remco van 't Veer <remco <at> remworks.net> writes:

> Fix out of memory errors when writing PDFs with fonts embedded in
> xournalpp and others.  See also:
>
>   https://gitlab.freedesktop.org/cairo/cairo/-/issues/870
>
> * gnu/packages/gtk.scm (cairo)[replacement]: New field pointing to cairo-1.18.4.
> * gnu/packages/gtk.scm (cairo-1.18.4): Add package.
>
> Change-Id: I6efa5a3acdf39fe78e558173f896f3a6abbc5c27
> ---
>  gnu/packages/gtk.scm | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
> index 846103ff9e..4d49246206 100644
> --- a/gnu/packages/gtk.scm
> +++ b/gnu/packages/gtk.scm
> @@ -38,6 +38,7 @@
>  ;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke <at> gnu.org>
>  ;;; Copyright © 2024 John Kehayias <john.kehayias <at> protonmail.com>
>  ;;; Copyright © 2025 Florian Pelz <pelzflorian <at> pelzflorian.de>
> +;;; Copyright © 2025 Remco van 't Veer <remco <at> remworks.net>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -172,6 +173,7 @@ (define cairo
>    (package
>      (name "cairo")
>      (version "1.18.2")
> +    (replacement cairo-1.18.4)
>      (source
>       (origin
>         (method url-fetch)
> @@ -238,6 +240,19 @@ (define cairo
>      ;; Hide and have cairo-with-documentation public.
>      (properties '((hidden? . #t)))))
>  
> +(define cairo-1.18.4
> +  (package
> +    (inherit cairo)
> +    (version "1.18.4")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri
> +        (string-append "https://cairographics.org/releases/cairo-"
> +                       version ".tar.xz"))
> +       (sha256
> +        (base32 "1jrcqfcna0358aqrk7rnys1hwq6k36ilr9r62bg26j3fi8hdhpj4"))))))

I've added a comment to remember this can be removed after ungrafting,
tested it worked with xournalpp to export an annotated PDF, and pushed
to the master branch.

Thank you :-)

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Apr 2025 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 71 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.