Subject: Re: [bug#39146] [PATCH v3] gnu: icecat: Remove about:buildconfig store references.

From: Kyle Meyer <[email-masked]>
Date: Wed, 12 Feb 2020 20:08:54 +0000

Jakub Kądziołka <[email-masked]> writes:

> BTW, do you happen to know a good way to send a patch as a reply? I
> ended up using `neomutt -H' and then specifying all the CC's manually...

One option is to reply to the message as you normally would and then
insert the patch under scissors.  Here's an example using your patch.
I've kept the "From:" line, but that's not necessary if the sender of
the email matches the patch author.

On the other end, that can be applied with `git am --scissors'.

-- >8 --
From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= <[email-masked]>
Subject: [PATCH v3] gnu: icecat: Remove about:buildconfig store references.

* gnu/packages/gnuzilla.scm (icecat)[arguments]:
  New ‘neutralise-store-references’ phase.

Co-authored-by: Tobias Geerinckx-Rice <[email-masked]>
---
 gnu/packages/gnuzilla.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 863edb3b4e..7d5020f7c2 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -7,10 +7,11 @@
 ;;; Copyright © 2016 Alex Griffin <[email-masked]>
 ;;; Copyright © 2017 Clément Lassieur <[email-masked]>
 ;;; Copyright © 2017 ng0 <[email-masked]>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <[email-masked]>
+;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2018 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2019 Ivan Petkov <[email-masked]>
 ;;; Copyright © 2020 Oleg Pykhalov <[email-masked]>
+;;; Copyright © 2020 Jakub Kądziołka <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1067,6 +1068,17 @@ (define-public icecat
                                 (force-output)
                                 (retry (- remaining-attempts 1))))
                        (apply build args)))))))
+         (add-after 'build 'neutralise-store-references
+           (lambda _
+             ;; Mangle the store references to compilers & other build tools in
+             ;; about:buildconfig, reducing IceCat's closure by 1 GiB on x86-64.
+             (substitute*
+                 "dist/bin/chrome/toolkit/content/global/buildconfig.html"
+               (((format #f "(~a/)([0-9a-z]{32})" (%store-directory)) _ store hash)
+                (string-append store (string-take hash 8)
+                               "<!-- Guix: not a runtime dependency -->"
+                               (string-drop hash 8))))
+             #t))
          (add-before 'configure 'install-desktop-entry
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Install the '.desktop' file.
-- 
2.25.0