From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:53979) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2MZe-0005i2-0F for guix-patches@gnu.org; Thu, 13 Feb 2020 17:03:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2MZb-0005yz-6Z for guix-patches@gnu.org; Thu, 13 Feb 2020 17:03:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54585) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2MZa-0005wx-BU for guix-patches@gnu.org; Thu, 13 Feb 2020 17:03:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j2MZa-0004kx-2a for guix-patches@gnu.org; Thu, 13 Feb 2020 17:03:02 -0500 Subject: [bug#39146] [PATCH v4] gnu: icecat: Remove about:buildconfig store references. Resent-Message-ID: From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Date: Thu, 13 Feb 2020 23:03:07 +0100 Message-Id: <20200213220307.24701-1-kuba@kadziolka.net> In-Reply-To: <20200212194525.joyg66cikh5xfnuu@gravity> References: <20200212194525.joyg66cikh5xfnuu@gravity> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 39146@debbugs.gnu.org Cc: Mark H Weaver , Marius Bakke , Tobias Geerinckx-Rice , Danny Milosavljevic * gnu/packages/gnuzilla.scm (icecat)[arguments]: New ‘neutralise-store-references’ phase. Co-authored-by: Tobias Geerinckx-Rice --- Changes from the previous version: - use regexp-quote around %store-directory, since today's IRC discussion has made me aware that this exists as a built-in - reflow some lines gnu/packages/gnuzilla.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index ae0c58eedb..fe6664e909 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 @@ from forcing GEXP-PROMISE." #:modules ((ice-9 ftw) (ice-9 rdelim) + (ice-9 regex) (ice-9 match) (srfi srfi-34) (srfi srfi-35) @@ -1067,6 +1069,20 @@ from forcing GEXP-PROMISE." (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. -- 2.25.0