diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 863edb3b4e..bb2a4d60dc 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -7,10 +7,11 @@ ;;; Copyright © 2016 Alex Griffin ;;; Copyright © 2017 Clément Lassieur ;;; Copyright © 2017 ng0 -;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice +;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018 Ricardo Wurmus ;;; Copyright © 2019 Ivan Petkov ;;; Copyright © 2020 Oleg Pykhalov +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -882,6 +883,7 @@ (define-public icecat #:modules ((ice-9 ftw) (ice-9 rdelim) + (ice-9 regex) (ice-9 match) (srfi srfi-34) (srfi srfi-35) @@ -1067,6 +1069,20 @@ (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-df-np-sv-z]{32})" + (regexp-quote (%store-directory))) + _ store hash) + (string-append store + (string-take hash 8) + "" + (string-drop hash 8)))) + #t)) (add-before 'configure 'install-desktop-entry (lambda* (#:key outputs #:allow-other-keys) ;; Install the '.desktop' file.