From unknown Sun Jun 22 03:52:47 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#66408 <66408@debbugs.gnu.org> To: bug#66408 <66408@debbugs.gnu.org> Subject: Status: [PATCH] gnu: icecat: Add support for Guix packaged extensions. Reply-To: bug#66408 <66408@debbugs.gnu.org> Date: Sun, 22 Jun 2025 10:52:47 +0000 retitle 66408 [PATCH] gnu: icecat: Add support for Guix packaged extensions. reassign 66408 guix-patches submitter 66408 Cl=C3=A9ment Lassieur severity 66408 normal tag 66408 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 08 12:28:12 2023 Received: (at submit) by debbugs.gnu.org; 8 Oct 2023 16:28:12 +0000 Received: from localhost ([127.0.0.1]:58329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpWdV-0006MR-9S for submit@debbugs.gnu.org; Sun, 08 Oct 2023 12:28:12 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpWdQ-0006Lq-Bo for submit@debbugs.gnu.org; Sun, 08 Oct 2023 12:28:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpWd0-0000m4-Op for guix-patches@gnu.org; Sun, 08 Oct 2023 12:27:38 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpWcy-000547-5o; Sun, 08 Oct 2023 12:27:38 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id B3FAF5C025E; Sun, 8 Oct 2023 12:27:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 08 Oct 2023 12:27:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm1; t=1696782451; x= 1696868851; bh=Fgv3yjGD2ZYHyNuJdz1eSHD4TSpr4Tkhk+w5H/UZlNQ=; b=r krTJKc1182uxChM/KENS9V7ZkgR2tB+2HlZpOo/eFbd+BRIXIjUbcGyBHgGQ+t+y qpKFAut362NAHFic1G3Ym8JuM2YFwLwIiXcAeY9iryyh8xk338ROEh11JRP27cmQ Zw/8JuNkulNMvIIxdjZOxhO0VCkKbx7lS425NMQXEsSADhpWE5H3EXQSwAPho3Up 0J1WzDAXSnJTRtoshmbqGlIln5EAQtNOl5iPnYm3SKV01IS9/xV9VmF69hnOCdhj 67/oQaWVWCv0s/FKZ925moY8lyeoTSlRZ4+D2rTBoTIHG+zcUMWm8wupcpexIu6n USAf/P7KI52SNc1Y3CtNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1696782451; x=1696868851; bh=F gv3yjGD2ZYHyNuJdz1eSHD4TSpr4Tkhk+w5H/UZlNQ=; b=HhKwx3z/WHET9iidf WGoeFQKXyQy3LQ1AkosgBOezhoFsYmZYELFuZZ1bJaCXWFYNbKI8ulEX1h2waRXE /AnkD23UTAws4BRSAO7/JUhKcFp/mb79Y4AzJkV8Dn7HszgsfFVuGnRsETn/13FW HLwPd5N6kS8Ojqlxhd4zzB25MLhQJO+fKRKXsobO7VHEINcbvw16x0X0W6YLN473 9l0ez4T6TDkxpSe4WwTqZCEtLyua/pizZUtPt6K46Yil/2+EsbvM+VP6XOEObpkZ 3kHd2u0tVzNKM3e30Q53P38ubw1vldt4a4FiIiPw+yNF4rUd2ljCeG81PERK+UB0 MqhUw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrhedugddutddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre dtredtjeenucfhrhhomhepvehlrohmvghnthcunfgrshhsihgvuhhruceotghlvghmvghn theslhgrshhsihgvuhhrrdhorhhgqeenucggtffrrghtthgvrhhnpeffudeftefhheevve eitdejvdetveeugeekvefggfffheetvdejieeggeehvdffleenucffohhmrghinhepghhn uhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegtlhgvmhgvnhhtsehlrghsshhivghurhdrohhrgh X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 8 Oct 2023 12:27:30 -0400 (EDT) From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= To: guix-patches@gnu.org Subject: [PATCH] gnu: icecat: Add support for Guix packaged extensions. Date: Sun, 8 Oct 2023 18:26:57 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Jonathan Brielmaier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.28; envelope-from=clement@lassieur.org; helo=out4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit Cc: mhw@netris.org, =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= , marius@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) * gnu/build/icecat-extension.scm: New file. * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. * gnu/packages/browser-extensions.scm (ublock-origin): [properties]: Store the addon id so that it is accessible in MAKE-ICECAT-EXTENSION. [arguments]: Use the addon id as first directory level. (ublock-origin/icecat): New procedure. * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unused 'apply-guix-specific-patches' phase so that it applies the following two patches. * gnu/packages/patches/icecat-compare-canonicalized-paths.patch: New patch that canonicalizes the addon path and use it to detect package changes. * gnu/packages/patches/icecat-use-guix-extension.patch: New patch that replaces /usr/share/mozilla/extensions with ~/.guix-profile/share/extensions. --- gnu/build/icecat-extension.scm | 62 +++++++++++++++++++ gnu/local.mk | 5 +- gnu/packages/browser-extensions.scm | 13 +++- gnu/packages/gnuzilla.scm | 19 +++--- .../icecat-compare-canonicalized-paths.patch | 33 ++++++++++ .../patches/icecat-use-guix-extensions.patch | 30 +++++++++ 6 files changed, 147 insertions(+), 15 deletions(-) create mode 100644 gnu/build/icecat-extension.scm create mode 100644 gnu/packages/patches/icecat-compare-canonicalized-paths.patch create mode 100644 gnu/packages/patches/icecat-use-guix-extensions.patch diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm new file mode 100644 index 000000000000..ccc6a1ece7fb --- /dev/null +++ b/gnu/build/icecat-extension.scm @@ -0,0 +1,62 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2023 Clément Lassieur +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build icecat-extension) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:export (make-icecat-extension)) + +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) + "Create an Icecat extension from package PKG and return a package that, +when installed, will make the extension contained in PKG available as an +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use." + (package + (inherit pkg) + (name (string-append (package-name pkg) "-icecat")) + (native-inputs '()) + (inputs '()) + (propagated-inputs '()) + (outputs '("out")) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((id #$(assq-ref (package-properties pkg) 'id)) + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") + (search-dir (string-append #$output + "/share/icecat/extensions/" + moz-app-id))) + ;; Icecat's XPIProvider.jsm looks within `search-dir` for a + ;; directory named after the add-on id. + + ;; This directory has to be a symlink, because Icecat's + ;; GetNativeTarget checks S_ISLNK before canonicalizing it like + ;; `readlink -f` would do. + + ;; Canonicalizing is required because Icecat compares the path + ;; against its local database to know if there is an extension + ;; update. A path that contains the store path will change every + ;; time the package is updated. + (mkdir-p search-dir) + (symlink (in-vicinity (ungexp pkg pkg-output) id) + (in-vicinity search-dir id)))))))) diff --git a/gnu/local.mk b/gnu/local.mk index a53701c673b7..17916a106dfb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -13,7 +13,7 @@ # Copyright © 2016-2023 Efraim Flashner # Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan (janneke) Nieuwenhuizen # Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice -# Copyright © 2017, 2018 Clément Lassieur +# Copyright © 2017, 2018, 2023 Clément Lassieur # Copyright © 2017, 2020 Mathieu Othacehe # Copyright © 2017, 2018, 2019 Gábor Boskovits # Copyright © 2018 Amirouche Boubekki @@ -759,6 +759,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/chromium-extension.scm \ %D%/build/cross-toolchain.scm \ %D%/build/dbus-service.scm \ + %D%/build/icecat-extension.scm \ %D%/build/image.scm \ %D%/build/jami-service.scm \ %D%/build/file-systems.scm \ @@ -1406,6 +1407,8 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-102-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ + %D%/packages/patches/icecat-compare-canonicalized-paths.patch \ + %D%/packages/patches/icecat-use-guix-extensions.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ %D%/packages/patches/icecat-use-system-media-libs.patch \ %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 3f6da8d77a3f..8a76f3a3e042 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) + #:use-module (gnu build icecat-extension) #:use-module (gnu packages compression) #:use-module (gnu packages python)) @@ -98,6 +100,7 @@ (define ublock-origin "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1")))) (build-system gnu-build-system) (outputs '("xpi" "firefox" "chromium")) + (properties '((id . "uBlock0@raymondhill.net"))) (arguments (list #:tests? #f ;no tests @@ -125,9 +128,10 @@ (define ublock-origin (invoke "./tools/make-chromium.sh"))) (add-after 'build-chromium 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((firefox (assoc-ref outputs "firefox")) - (xpi (assoc-ref outputs "xpi")) - (chromium (assoc-ref outputs "chromium"))) + (let* ((id #$(assq-ref (package-properties this-package) 'id)) + (firefox (in-vicinity (assoc-ref outputs "firefox") id)) + (xpi (assoc-ref outputs "xpi")) + (chromium (assoc-ref outputs "chromium"))) (install-file "dist/build/uBlock0.firefox.xpi" (string-append xpi "/lib/mozilla/extensions")) (copy-recursively "dist/build/uBlock0.firefox" firefox) @@ -142,3 +146,6 @@ (define ublock-origin (define-public ublock-origin/chromium (make-chromium-extension ublock-origin "chromium")) + +(define-public ublock-origin/icecat + (make-icecat-extension ublock-origin "firefox")) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index ab629afd3d20..1ef30498e49c 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2016, 2017, 2018, 2019, 2021 Efraim Flashner ;;; Copyright © 2016 Alex Griffin -;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2017, 2023 Clément Lassieur ;;; Copyright © 2017, 2018 Nikita ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2020 Ricardo Wurmus @@ -880,16 +880,13 @@ (define-public icecat-minimal #:phases #~(modify-phases %standard-phases (add-after 'unpack 'apply-guix-specific-patches - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((patch (search-input-file inputs "bin/patch"))) - (for-each (match-lambda - ((label . file) - (when (and (string-prefix? "icecat-" label) - (string-suffix? ".patch" label)) - (format #t "applying '~a'...~%" file) - (invoke patch "--force" "--no-backup-if-mismatch" - "-p1" "--input" file)))) - (or native-inputs inputs))))) + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-canonicalized-paths.patch")) + #$(local-file + (search-patch "icecat-use-guix-extensions.patch")))))) (add-after 'apply-guix-specific-patches 'remove-bundled-libraries (lambda _ ;; Remove bundled libraries that we don't use, since they may diff --git a/gnu/packages/patches/icecat-compare-canonicalized-paths.patch b/gnu/packages/patches/icecat-compare-canonicalized-paths.patch new file mode 100644 index 000000000000..f0130062624b --- /dev/null +++ b/gnu/packages/patches/icecat-compare-canonicalized-paths.patch @@ -0,0 +1,33 @@ +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile = { + if ( + newAddon || + oldAddon.updateDate != xpiState.mtime || ++ oldAddon.path != xpiState.path || + (aUpdateCompatibility && this.isAppBundledLocation(installLocation)) + ) { + newAddon = this.updateMetadata( +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile = { + xpiState, + newAddon + ); +- } else if (oldAddon.path != xpiState.path) { +- newAddon = this.updatePath(installLocation, oldAddon, xpiState); + } else if (aUpdateCompatibility || aSchemaChange) { + newAddon = this.updateCompatibility( + installLocation, +--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm +@@ -1167,8 +1167,9 @@ class SystemAddonDefaults extends DirectoryLocation { + + // Only attempt to load unpacked directory if unofficial build. + if (!AppConstants.MOZILLA_OFFICIAL && !file.exists()) { +- file = this.dir.clone(); +- file.append(`${id}`); ++ let symlink = this.dir.clone(); ++ symlink.append(`${id}`); ++ file = symlink.isSymlink() ? new nsIFile(symlink.target) : symlink; + } + + addons.set(id, file); diff --git a/gnu/packages/patches/icecat-use-guix-extensions.patch b/gnu/packages/patches/icecat-use-guix-extensions.patch new file mode 100644 index 000000000000..0d90ea98b685 --- /dev/null +++ b/gnu/packages/patches/icecat-use-guix-extensions.patch @@ -0,0 +1,30 @@ +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -415,13 +415,20 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, + #if defined(XP_UNIX) && !defined(XP_MACOSX) + else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) { + # ifdef ENABLE_SYSTEM_EXTENSION_DIRS +-# if defined(__OpenBSD__) || defined(__FreeBSD__) +- static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions"; +-# else +- static const char* const sysLExtDir = "/usr/share/mozilla/extensions"; +-# endif +- rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, +- getter_AddRefs(file)); ++ rv = GetUserDataDirectoryHome(getter_AddRefs(file), false); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative(".guix-profile"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative("share"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative("icecat"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative("extensions"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); + # endif + } + #endif // defined(XP_UNIX) && !defined(XP_MACOSX) base-commit: 47d0346553fdad9795c9390a60944ccaad7e5255 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 08 19:08:05 2023 Received: (at 66408) by debbugs.gnu.org; 8 Oct 2023 23:08:05 +0000 Received: from localhost ([127.0.0.1]:58872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpcsT-0002W5-Rl for submit@debbugs.gnu.org; Sun, 08 Oct 2023 19:08:05 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:48123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpcsP-0002VX-2D for 66408@debbugs.gnu.org; Sun, 08 Oct 2023 19:08:00 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9976C32009BB; Sun, 8 Oct 2023 19:07:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 08 Oct 2023 19:07:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm1; t=1696806450; x= 1696892850; bh=gDAN215v3HIgF4P4Shoa9zvEcWM5nsNkQvHEyAIlVmY=; b=u ElmJZKqfp7Pufqk4VAjIitWYr5hDqAzHDYLdla3IFpibYm2Z3uikv0XtVDVCtPbz r5mXZcT9IwMfnwhKb+rYdLVLN5UGqTgSPxVN7G0lmQ/KZ336LSa62EwYW8u9GWsy CdBYjuhF9CnO5d/vttrkf6XL7P3IzL8mbzENXsUPTt1oWU8W0HdMr7oEyC7ezzqK /WHBPFQ+k9rd+8nG+X6HJ59SheMi3F+0erecr6xTgVOzQvKY1G+wyEqMJ95clmIZ 68gz+1xvnIOcMVd8eMXoOVPELikZ2/x0bIhGRXVHpG0eUfd+JDU/ymam0pGiYvac 9ohsm6jIwkK1WkmyPo2FA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1696806450; x=1696892850; bh=g DAN215v3HIgF4P4Shoa9zvEcWM5nsNkQvHEyAIlVmY=; b=YCyJ1r5h2n8jXGjaO hWNDHUTViG6i0RnRR2PLsw8jaNlmU6mHQ0u/uIcJiFLgCxXbTk0DW1Vu3ghn8Jp4 X1mpUOO0rhUnRpw4GSGNOh5d7TaSNjsRr1KVz6JcNcYpt1GDu5YbAsx+SysJueVq dgPC8a34EaDsiaCO2nnV1AtqXw4ZMl0n+lXYOGoN1TAuJ2OndlWL8Pi7srLvW3z1 MfXDjbsYxTYVkJfytufhPsS9xgNF4L6um7WBlLJph2FChfguranjs3V5Cb+VHx7Q ZWclctBU1r9KTon35Y2imOp92/anrqjAqoGWwG/630Jf7gZEgDrJ6ibpFL9V7eAV ckxVA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrhedvgddulecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeevlhormhgvnhhtucfnrghsshhivghurhcuoegtlhgvmhgvnhht sehlrghsshhivghurhdrohhrgheqnecuggftrfgrthhtvghrnhepffdufeethfehveevie dtjedvteevueegkeevgffgffehtedvjeeigeeghedvffelnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 8 Oct 2023 19:07:29 -0400 (EDT) From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= To: 66408@debbugs.gnu.org Subject: [PATCH v2] gnu: icecat: Add support for Guix packaged extensions. Date: Mon, 9 Oct 2023 01:07:17 +0200 Message-ID: <097bac7dab0336257dca5e9456810f883961e084.1696806437.git.clement@lassieur.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Jonathan Brielmaier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION procedure that makes sure the add-on directory is a symlink, so that Icecat can normalize it into a store path. * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store the add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. [arguments]: Use the add-on ID as root directory. (ublock-origin/icecat): New procedure. * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unused 'apply-guix-specific-patches' phase so that it applies the following two patches. * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares add-on store paths to detect package changes. * gnu/packages/patches/icecat-use-guix-extensions.patch: New patch replacing /usr/share/mozilla/extensions with ~/.guix-profile/share/icecat/extensions. --- gnu/build/icecat-extension.scm | 64 +++++++++++++++++++ gnu/local.mk | 5 +- gnu/packages/browser-extensions.scm | 13 +++- gnu/packages/gnuzilla.scm | 19 +++--- .../patches/icecat-compare-paths.patch | 19 ++++++ .../patches/icecat-use-guix-extensions.patch | 30 +++++++++ 6 files changed, 135 insertions(+), 15 deletions(-) create mode 100644 gnu/build/icecat-extension.scm create mode 100644 gnu/packages/patches/icecat-compare-paths.patch create mode 100644 gnu/packages/patches/icecat-use-guix-extensions.patch diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm new file mode 100644 index 000000000000..c1e528bc35fa --- /dev/null +++ b/gnu/build/icecat-extension.scm @@ -0,0 +1,64 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2023 Clément Lassieur +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build icecat-extension) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:export (make-icecat-extension)) + +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) + "Create an Icecat extension from package PKG and return a package that, +when installed, will make the extension contained in PKG available as an +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use." + (package + (inherit pkg) + (name (string-append (package-name pkg) "-icecat")) + (native-inputs '()) + (inputs '()) + (propagated-inputs '()) + (outputs '("out")) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((id #$(assq-ref (package-properties pkg) 'id)) + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") + (search-dir (string-append #$output + "/share/icecat/extensions/" + moz-app-id))) + ;; Icecat's iterates over `search-dir` for directories. If a + ;; directory's name is not a valid add-on ID, it is ignored. See + ;; DirectoryLocation::readAddons() in XPIProvider.jsm. + + ;; This directory has to be a symlink, because Icecat's + ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile` is a + ;; symlink. + + ;; Normalizing is required because Icecat compares the add-on path + ;; against its local database to know if there is an extension + ;; update. A store path will change every time the package is + ;; updated. See updateExistingAddon() in XPIDatabase.jsm, with + ;; our patch `icecat-compare-paths.patch`. + (mkdir-p search-dir) + (symlink (in-vicinity (ungexp pkg pkg-output) id) + (in-vicinity search-dir id)))))))) diff --git a/gnu/local.mk b/gnu/local.mk index 631b901b8a77..702bda3e4638 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -13,7 +13,7 @@ # Copyright © 2016-2023 Efraim Flashner # Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Jan (janneke) Nieuwenhuizen # Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice -# Copyright © 2017, 2018 Clément Lassieur +# Copyright © 2017, 2018, 2023 Clément Lassieur # Copyright © 2017, 2020 Mathieu Othacehe # Copyright © 2017, 2018, 2019 Gábor Boskovits # Copyright © 2018 Amirouche Boubekki @@ -761,6 +761,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/chromium-extension.scm \ %D%/build/cross-toolchain.scm \ %D%/build/dbus-service.scm \ + %D%/build/icecat-extension.scm \ %D%/build/image.scm \ %D%/build/jami-service.scm \ %D%/build/file-systems.scm \ @@ -1413,6 +1414,8 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-102-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ + %D%/packages/patches/icecat-compare-paths.patch \ + %D%/packages/patches/icecat-use-guix-extensions.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ %D%/packages/patches/icecat-use-system-media-libs.patch \ %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 3f6da8d77a3f..8a76f3a3e042 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) + #:use-module (gnu build icecat-extension) #:use-module (gnu packages compression) #:use-module (gnu packages python)) @@ -98,6 +100,7 @@ (define ublock-origin "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1")))) (build-system gnu-build-system) (outputs '("xpi" "firefox" "chromium")) + (properties '((id . "uBlock0@raymondhill.net"))) (arguments (list #:tests? #f ;no tests @@ -125,9 +128,10 @@ (define ublock-origin (invoke "./tools/make-chromium.sh"))) (add-after 'build-chromium 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((firefox (assoc-ref outputs "firefox")) - (xpi (assoc-ref outputs "xpi")) - (chromium (assoc-ref outputs "chromium"))) + (let* ((id #$(assq-ref (package-properties this-package) 'id)) + (firefox (in-vicinity (assoc-ref outputs "firefox") id)) + (xpi (assoc-ref outputs "xpi")) + (chromium (assoc-ref outputs "chromium"))) (install-file "dist/build/uBlock0.firefox.xpi" (string-append xpi "/lib/mozilla/extensions")) (copy-recursively "dist/build/uBlock0.firefox" firefox) @@ -142,3 +146,6 @@ (define ublock-origin (define-public ublock-origin/chromium (make-chromium-extension ublock-origin "chromium")) + +(define-public ublock-origin/icecat + (make-icecat-extension ublock-origin "firefox")) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index ac96d7fb1fb6..a6a92cd8a53b 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2016, 2017, 2018, 2019, 2021 Efraim Flashner ;;; Copyright © 2016 Alex Griffin -;;; Copyright © 2017 Clément Lassieur +;;; Copyright © 2017, 2023 Clément Lassieur ;;; Copyright © 2017, 2018 Nikita ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018, 2020 Ricardo Wurmus @@ -880,16 +880,13 @@ (define-public icecat-minimal #:phases #~(modify-phases %standard-phases (add-after 'unpack 'apply-guix-specific-patches - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((patch (search-input-file inputs "bin/patch"))) - (for-each (match-lambda - ((label . file) - (when (and (string-prefix? "icecat-" label) - (string-suffix? ".patch" label)) - (format #t "applying '~a'...~%" file) - (invoke patch "--force" "--no-backup-if-mismatch" - "-p1" "--input" file)))) - (or native-inputs inputs))))) + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-paths.patch")) + #$(local-file + (search-patch "icecat-use-guix-extensions.patch")))))) (add-after 'apply-guix-specific-patches 'remove-bundled-libraries (lambda _ ;; Remove bundled libraries that we don't use, since they may diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packages/patches/icecat-compare-paths.patch new file mode 100644 index 000000000000..9205899dc0c4 --- /dev/null +++ b/gnu/packages/patches/icecat-compare-paths.patch @@ -0,0 +1,19 @@ +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile = { + if ( + newAddon || + oldAddon.updateDate != xpiState.mtime || ++ oldAddon.path != xpiState.path || + (aUpdateCompatibility && this.isAppBundledLocation(installLocation)) + ) { + newAddon = this.updateMetadata( +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile = { + xpiState, + newAddon + ); +- } else if (oldAddon.path != xpiState.path) { +- newAddon = this.updatePath(installLocation, oldAddon, xpiState); + } else if (aUpdateCompatibility || aSchemaChange) { + newAddon = this.updateCompatibility( + installLocation, diff --git a/gnu/packages/patches/icecat-use-guix-extensions.patch b/gnu/packages/patches/icecat-use-guix-extensions.patch new file mode 100644 index 000000000000..0d90ea98b685 --- /dev/null +++ b/gnu/packages/patches/icecat-use-guix-extensions.patch @@ -0,0 +1,30 @@ +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -415,13 +415,20 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, + #if defined(XP_UNIX) && !defined(XP_MACOSX) + else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) { + # ifdef ENABLE_SYSTEM_EXTENSION_DIRS +-# if defined(__OpenBSD__) || defined(__FreeBSD__) +- static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions"; +-# else +- static const char* const sysLExtDir = "/usr/share/mozilla/extensions"; +-# endif +- rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, +- getter_AddRefs(file)); ++ rv = GetUserDataDirectoryHome(getter_AddRefs(file), false); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative(".guix-profile"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative("share"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative("icecat"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); ++ ++ rv = file->AppendNative("extensions"_ns); ++ NS_ENSURE_SUCCESS(rv, rv); + # endif + } + #endif // defined(XP_UNIX) && !defined(XP_MACOSX) base-commit: 40a1254b05612759e919507c9201d7cd291d5975 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 08:27:49 2023 Received: (at 66408) by debbugs.gnu.org; 11 Oct 2023 12:27:49 +0000 Received: from localhost ([127.0.0.1]:37729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqYJR-0003dT-UX for submit@debbugs.gnu.org; Wed, 11 Oct 2023 08:27:49 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqYJM-0003dA-Eo for 66408@debbugs.gnu.org; Wed, 11 Oct 2023 08:27:40 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B6B3F5C033E; Wed, 11 Oct 2023 08:27:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 11 Oct 2023 08:27:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm1; t=1697027228; x= 1697113628; bh=Wr7rSOEmyvmzxNUaC/kuA8rHqQoMy46F8nHqmSr/NmM=; b=p 22FJNBGG/TPCPtwQJtiY3r3Eswwq9+7VmHPrWveSpfMyVsze4jrGtB4TePWcHAFD hnA9g8E/5dwzFkTjOpYOOfBChLpxg/PaefdUdftHle2I2Kmb20ur158YdSHPip2e PwHsawckkAxq7xVS4s+Jh8o5KdfterNKxa2f77tEPqiuTPDTbx4NALXu7sRtvnTE 3sRA61Tcn/E7XoL3XwEb9vp8wfbckxPrRkxkNx9Sj6cxIYA/ZXnWISJzq3X6iUMW 4ITqHeIVH4OmkwID8epsnTd/0A/lekAkH17buYz8aRaUdwC3vz7tYN1MCr78FgjX qkDGmqpV3Nrp3mcJ248ew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; t=1697027228; x=1697113628; bh=W r7rSOEmyvmzxNUaC/kuA8rHqQoMy46F8nHqmSr/NmM=; b=aov4FNEnWvAh/dtLG TcHWqZ11LBRIkb7NhYI5weP0DmdItLtNNwhQzwNPVduUDjA3v9NOFZWHPK9lOnjZ gK2FndJ1LQIxkrOg3i0/Omqm9n7W47z3idegG0Tnx2ro5R7VMkaXfmU/t/2lQocX 55xldamTEgYPQx80m6xRbvuujvR9i1wbF5Z35tochNNmsiuHfKJUhQgSgImN6aJR uvpVPT7QF0ysR1cUci92S+wlE/BcClD9pl2JkSU/M7WRwjszhPr2Fd6WNEzl0qo8 bEVmVL9ojVsyKDnbRzMbuigyCFfS1qHZZeWkpZtNorVWI36Ubzst/ld2NOh25fNn TGJ9w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrheekgdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeevlhormhgvnhhtucfnrghsshhivghurhcuoegtlhgvmhgvnhht sehlrghsshhivghurhdrohhrgheqnecuggftrfgrthhtvghrnhepffdufeethfehveevie dtjedvteevueegkeevgffgffehtedvjeeigeeghedvffelnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Oct 2023 08:27:07 -0400 (EDT) From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= To: 66408@debbugs.gnu.org Subject: [PATCH v3] gnu: icecat: Add support for Guix packaged extensions. Date: Wed, 11 Oct 2023 14:26:38 +0200 Message-ID: <43b86867b651d877c805d7e5963b42319606e0d1.1697027198.git.clement@lassieur.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Jonathan Brielmaier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION procedure that makes sure the add-on directory is a symlink, so that Icecat can normalize it into a package store path. * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store the add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. [arguments]: Use the add-on ID as root directory. (ublock-origin/icecat): New procedure. * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unused 'apply-guix-specific-patches' phase so that it applies the following two patches. [native-search-paths]: New field. * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares add-on paths (which are package store paths) to detect package changes. * gnu/packages/patches/icecat-use-guix-extensions.patch: New patch that replaces "/usr/share/mozilla/extensions" with "$ICECAT_EXTENSION_DIR". --- gnu/build/icecat-extension.scm | 71 +++++++++++++++++++ gnu/local.mk | 3 + gnu/packages/browser-extensions.scm | 13 +++- gnu/packages/gnuzilla.scm | 22 +++--- .../patches/icecat-compare-paths.patch | 19 +++++ .../patches/icecat-use-guix-extensions.patch | 52 ++++++++++++++ 6 files changed, 167 insertions(+), 13 deletions(-) create mode 100644 gnu/build/icecat-extension.scm create mode 100644 gnu/packages/patches/icecat-compare-paths.patch create mode 100644 gnu/packages/patches/icecat-use-guix-extensions.patch diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm new file mode 100644 index 000000000000..8ecd8a505f72 --- /dev/null +++ b/gnu/build/icecat-extension.scm @@ -0,0 +1,71 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2023 Clément Lassieur +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build icecat-extension) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:export (make-icecat-extension)) + +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) + "Create an Icecat extension from package PKG and return a package that, +when installed, will make the extension contained in PKG available as an +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use." + (package + (inherit pkg) + (name (string-append (package-name pkg) "-icecat")) + (native-inputs '()) + (inputs '()) + (propagated-inputs '()) + (outputs '("out")) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((id #$(assq-ref (package-properties pkg) 'id)) + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") + (search-dir (string-append #$output + "/share/icecat/extensions/" + moz-app-id))) + ;; Icecat's iterates over `search-dir` for directories. If a + ;; directory's name is not a valid add-on ID, it is ignored. See + ;; `DirectoryLocation::readAddons()` in XPIProvider.jsm. + + ;; This directory has to be a symlink, because Icecat's + ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile` is a + ;; symlink. + + ;; Normalizing is required because Icecat compares the add-on path + ;; against its local database to know if there is an extension + ;; update. We want the add-on path to be the package store path, + ;; so that a path change is detected every time the package is + ;; updated. See `updateExistingAddon()` in XPIDatabase.jsm, with + ;; our patch `icecat-compare-paths.patch`. + + ;; We don't want the add-on path to be the profile store path, + ;; which would change too often. We don't want the add-on path to + ;; be hard-coded ("/usr/share/mozilla/extensions") either because + ;; it would never change. + + (mkdir-p search-dir) + (symlink (in-vicinity (ungexp pkg pkg-output) id) + (in-vicinity search-dir id)))))))) diff --git a/gnu/local.mk b/gnu/local.mk index 9fa52833cbc5..1bf925a57d9e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -761,6 +761,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/chromium-extension.scm \ %D%/build/cross-toolchain.scm \ %D%/build/dbus-service.scm \ + %D%/build/icecat-extension.scm \ %D%/build/image.scm \ %D%/build/jami-service.scm \ %D%/build/file-systems.scm \ @@ -1415,6 +1416,8 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-102-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ + %D%/packages/patches/icecat-compare-paths.patch \ + %D%/packages/patches/icecat-use-guix-extensions.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ %D%/packages/patches/icecat-use-system-media-libs.patch \ %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 3f6da8d77a3f..8a76f3a3e042 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) + #:use-module (gnu build icecat-extension) #:use-module (gnu packages compression) #:use-module (gnu packages python)) @@ -98,6 +100,7 @@ (define ublock-origin "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1")))) (build-system gnu-build-system) (outputs '("xpi" "firefox" "chromium")) + (properties '((id . "uBlock0@raymondhill.net"))) (arguments (list #:tests? #f ;no tests @@ -125,9 +128,10 @@ (define ublock-origin (invoke "./tools/make-chromium.sh"))) (add-after 'build-chromium 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((firefox (assoc-ref outputs "firefox")) - (xpi (assoc-ref outputs "xpi")) - (chromium (assoc-ref outputs "chromium"))) + (let* ((id #$(assq-ref (package-properties this-package) 'id)) + (firefox (in-vicinity (assoc-ref outputs "firefox") id)) + (xpi (assoc-ref outputs "xpi")) + (chromium (assoc-ref outputs "chromium"))) (install-file "dist/build/uBlock0.firefox.xpi" (string-append xpi "/lib/mozilla/extensions")) (copy-recursively "dist/build/uBlock0.firefox" firefox) @@ -142,3 +146,6 @@ (define ublock-origin (define-public ublock-origin/chromium (make-chromium-extension ublock-origin "chromium")) + +(define-public ublock-origin/icecat + (make-icecat-extension ublock-origin "firefox")) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index a367d7a00ff6..608219c97303 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -885,16 +885,13 @@ (define-public icecat-minimal #:phases #~(modify-phases %standard-phases (add-after 'unpack 'apply-guix-specific-patches - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((patch (search-input-file inputs "bin/patch"))) - (for-each (match-lambda - ((label . file) - (when (and (string-prefix? "icecat-" label) - (string-suffix? ".patch" label)) - (format #t "applying '~a'...~%" file) - (invoke patch "--force" "--no-backup-if-mismatch" - "-p1" "--input" file)))) - (or native-inputs inputs))))) + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-paths.patch")) + #$(local-file + (search-patch "icecat-use-guix-extensions.patch")))))) (add-after 'apply-guix-specific-patches 'remove-bundled-libraries (lambda _ ;; Remove bundled libraries that we don't use, since they may @@ -1138,6 +1135,11 @@ (define-public icecat-minimal '("default16.png" "default22.png" "default24.png" "default32.png" "default48.png" "content/icon64.png" "mozicon128.png" "default256.png")))))))) + (native-search-paths + (list (search-path-specification + (variable "ICECAT_EXTENSION_DIR") + (separator #f) ;single entry + (files '("share/icecat/extensions"))))) (home-page "https://www.gnu.org/software/gnuzilla/") (synopsis "Entirely free browser derived from Mozilla Firefox") (description diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packages/patches/icecat-compare-paths.patch new file mode 100644 index 000000000000..9205899dc0c4 --- /dev/null +++ b/gnu/packages/patches/icecat-compare-paths.patch @@ -0,0 +1,19 @@ +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile = { + if ( + newAddon || + oldAddon.updateDate != xpiState.mtime || ++ oldAddon.path != xpiState.path || + (aUpdateCompatibility && this.isAppBundledLocation(installLocation)) + ) { + newAddon = this.updateMetadata( +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile = { + xpiState, + newAddon + ); +- } else if (oldAddon.path != xpiState.path) { +- newAddon = this.updatePath(installLocation, oldAddon, xpiState); + } else if (aUpdateCompatibility || aSchemaChange) { + newAddon = this.updateCompatibility( + installLocation, diff --git a/gnu/packages/patches/icecat-use-guix-extensions.patch b/gnu/packages/patches/icecat-use-guix-extensions.patch new file mode 100644 index 000000000000..f2fe4260c2cd --- /dev/null +++ b/gnu/packages/patches/icecat-use-guix-extensions.patch @@ -0,0 +1,52 @@ +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -415,13 +415,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, + #if defined(XP_UNIX) && !defined(XP_MACOSX) + else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) { + # ifdef ENABLE_SYSTEM_EXTENSION_DIRS +-# if defined(__OpenBSD__) || defined(__FreeBSD__) +- static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions"; +-# else +- static const char* const sysLExtDir = "/usr/share/mozilla/extensions"; +-# endif +- rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, +- getter_AddRefs(file)); ++ rv = GetGuixExtensionDir(getter_AddRefs(file)); + # endif + } + #endif // defined(XP_UNIX) && !defined(XP_MACOSX) +@@ -1198,6 +1192,24 @@ nsresult nsXREDirProvider::SetUserDataProfileDirectory(nsCOMPtr& aFile, + return NS_OK; + } + ++nsresult nsXREDirProvider::GetGuixExtensionDir(nsIFile** aFile) { ++ nsresult rv; ++ nsCOMPtr localDir; ++ ++#if defined(XP_UNIX) ++ const char* extensionDir = getenv("ICECAT_EXTENSION_DIR"); ++ if (!extensionDir || !*extensionDir) return NS_ERROR_FAILURE; ++ ++ rv = NS_NewNativeLocalFile(nsDependentCString(extensionDir), true, ++ getter_AddRefs(localDir)); ++#else ++# error "Don't know how to get product dir on your platform" ++#endif ++ ++ NS_IF_ADDREF(*aFile = localDir); ++ return rv; ++} ++ + nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, + bool aLocal) { + // Copied from nsAppFileLocationProvider (more or less) +--- a/toolkit/xre/nsXREDirProvider.h ++++ b/toolkit/xre/nsXREDirProvider.h +@@ -112,6 +112,7 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2, + private: + nsresult GetFilesInternal(const char* aProperty, + nsISimpleEnumerator** aResult); ++ static nsresult GetGuixExtensionDir(nsIFile** aFile); + static nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal); + static nsresult GetSysUserExtensionsDirectory(nsIFile** aFile); + #if defined(XP_UNIX) || defined(XP_MACOSX) base-commit: 9ad9113fc238ee8de5191a5e15b5153fd149e9fa -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 11 10:53:04 2023 Received: (at 66408) by debbugs.gnu.org; 11 Oct 2023 14:53:04 +0000 Received: from localhost ([127.0.0.1]:39840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqaa8-00015G-9N for submit@debbugs.gnu.org; Wed, 11 Oct 2023 10:53:04 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:41881) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqaa5-00014g-Lx for 66408@debbugs.gnu.org; Wed, 11 Oct 2023 10:53:02 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 64BB85C0480; Wed, 11 Oct 2023 10:52:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 11 Oct 2023 10:52:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1697035954; x=1697122354; bh=spKh+xneigrlCVL7I/SyZY5k2+KWKtgyexV DVQTQs/I=; b=fantLXhX+knhlX7nlDLr48cCcGFzWgfDZ9+Y+T5prmtlp/r2C1Q nzcaZUJHBWgJN2u/VkkKwfYlyt/wqy+2QxWvTxxM7/MGSVanZP7W20c3vkvEfDSY wBqXI4V6p1uuZXZG4dCytwtGqR6e85GLZYYpkidIHmMgKPI5erP6Qp4AAuKVSijO UpnbLlbqbnN8ErRdpaUrautOjxhtJf8MmI6uclt4dLYBG9mMOGKAo17TPZwcKGTi u/ED3N3A00FXZ/oMBZadQoU30obFpHNjm6HvPEp9Vhbf1h3JsRvRjEPxem0fMX3R PBxfHj+tFZf4ViKZQh/bJebQYePoZqgsitQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1697035954; x=1697122354; bh=spKh+xneigrlCVL7I/SyZY5k2+KWKtgyexV DVQTQs/I=; b=mlvcxcPNuLJGKn/Q9OBfa+rm7ffTsdUucVUITMnUkWDu43oYT3t u8fZSjdWzlT+dWv/qV+D4fNczxBTUydwTWUpLTRnSOcbl4ZpGP3tWQvBtkxqfE7W PWzBPlmDD+Px2cOUoaVKbAM1HOKXD0K1tyBz/5g61zdiiw/jVxZHnRUPLFl4/m9P dXqh+8MltCu7TONwKS30rRQVARmJy6XQpMTXLoCc+5tZExaJQSs8qKqx9Otkg3LN 5D2le5fTOuEucTl3Y7Xac6/bJpNaG1FxOcmPOqi0vQE/hbXnEO251H/AL7tWmGBp as/lO7sIHLeOQOSFdpID2LHXFx0sl4xFZOA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrheekgdejlecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhgffffkgggtgfesthhqredttderjeenucfhrhhomhepvehlrohm vghnthcunfgrshhsihgvuhhruceotghlvghmvghntheslhgrshhsihgvuhhrrdhorhhgqe enucggtffrrghtthgvrhhnpeffhfdukeehkeeukedvkeeutdeihfelvedtieeggfelveff udfhgfefueffgedtffenucffohhmrghinhepmhhoiihilhhlrgdrohhrghdpshgtmhdrsh hopdhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Oct 2023 10:52:32 -0400 (EDT) From: =?utf-8?Q?Cl=C3=A9ment_Lassieur?= To: 66408@debbugs.gnu.org Subject: Re: [PATCH v3] gnu: icecat: Add support for Guix packaged extensions. In-Reply-To: <43b86867b651d877c805d7e5963b42319606e0d1.1697027198.git.clement@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Wed, 11 Oct 2023 14:26:38 +0200") References: <43b86867b651d877c805d7e5963b42319606e0d1.1697027198.git.clement@lassieur.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Wed, 11 Oct 2023 16:52:29 +0200 Message-ID: <87h6mxnrde.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: Mark H Weaver , Marius Bakke X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello, Now that this patch looks stable to me, please let me introduce it shortly. I believe that a lot of people use Icecat extensions downloaded from Mozilla store[2]. Mozzarella[1] is really just a "plugin finder", so the extension is really downloaded from https://addons.mozilla.org/, which means we have no control over the software we are running, except for the bundled extensions. An upgrade could very well import non-free software when the initial version was free. I think it would be great to do like we do with Emacs and a lot of other softwares: package our own plugins. That would give users the assurance that the software is free and can be trusted as they trust any Guix packaged software. That would also allow to do Guix-specific changes, like removing the non-free bits, or adapting the package for technical reasons. And that would allow for a declarative deployment of the browser, because the extensions could be added, say, to the Guix home config.scm. So this is what this patch is about. And it works with the only add-on that is currently packaged: uBlock Origin. To test it one needs to install both "icecat" and "ublock-origin-icecat". This is related to the work Marius did on ungoogled-chromium, and of course to the work Mark did on Icecat, so both of you are CCed. As for the technical details, there is a long comment in "icecat-extensions.scm" explaining what I did. Thank you, Cl=C3=A9ment Lassieur [1]: https://gnuzilla.gnu.org/mozzarella/ [2]: https://addons.mozilla.org/ > * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION > procedure that makes sure the add-on directory is a symlink, so that Icec= at > can normalize it into a package store path. > * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. > * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store = the > add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. > [arguments]: Use the add-on ID as root directory. > (ublock-origin/icecat): New procedure. > * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unus= ed > 'apply-guix-specific-patches' phase so that it applies the following two > patches. > [native-search-paths]: New field. > * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares > add-on paths (which are package store paths) to detect package changes. > * gnu/packages/patches/icecat-use-guix-extensions.patch: New patch that > replaces "/usr/share/mozilla/extensions" with "$ICECAT_EXTENSION_DIR". From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 08:49:56 2023 Received: (at 66408) by debbugs.gnu.org; 17 Oct 2023 12:49:56 +0000 Received: from localhost ([127.0.0.1]:58832 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsjWF-0007QE-Pc for submit@debbugs.gnu.org; Tue, 17 Oct 2023 08:49:56 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:56023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsjWA-0007Px-VG for 66408@debbugs.gnu.org; Tue, 17 Oct 2023 08:49:54 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 1638C32009A2; Tue, 17 Oct 2023 08:49:19 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 17 Oct 2023 08:49:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm2; t=1697546958; x= 1697633358; bh=3AS6rPLUSThAoxf1M0zhl7RDzcBl+VoXB2MVOumHuNQ=; b=U m2eICrzeSmBzAenFozP5BO1ZDySZHfkrjLdOPu/G+B8q8PaxMLCZh4dh7GRLxyqL ZlsXmbQ8b9VEkswLhSg7FnfUcDxgSFR0kGRGUFaZLMweXbGfl7zS9fe8wCv3yyam u4FwCF70L4J4WO9RIA93HMl2SLgTHlO4te27ZCwMEpbmHMPzyOj6HG45G48C9tqz Y8JoP55P9yFD2zZ6zhfxNbXpC1xdgPgDJftN5LSJd/WMmqEcsuaMNKSKs3PykdhP KpIgbRxfpM4Yyzr1hVbO47rUmkLwD4qzRIArvmpRkw7v8D5NBUEZPE51y0kCsI2p z8ydMie7v3Bkw0VMA7Jkg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1697546958; x=1697633358; bh=3 AS6rPLUSThAoxf1M0zhl7RDzcBl+VoXB2MVOumHuNQ=; b=oUbHzgxifD6imeqTm ubD9+8fe+Qhat57hFW2G6W7mvpneNjxVqpnWqVtdF9m7qmIa5mYNAwJlkZtWZYAi pWQ4hr7thN82d765Fph7vvxQveS6a9uvtEFFX7/EA+KKb4sT/W1NrT0XS1CLwbdc Px2BJw8gbHK8Z97EQelqdlTjrgUdz30bgmD40TH9xSblukHvNJhxhUTB7RxnyI1x NfzaXrpkZVOwv5xF+uPWn5wKcp6lEIhelyFYcxYDykX8v4Mwnpz1jXBa9nA2AuIy kyKghjr2fbgPaKPKxkgBtW1LW3l3KPgaUc08+MNvBb8Q8TPKpUS1LJ9YioiwOBlR rHj/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedvgdehiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeevlhormhgvnhhtucfnrghsshhivghurhcuoegtlhgvmhgvnhht sehlrghsshhivghurhdrohhrgheqnecuggftrfgrthhtvghrnhepffdufeethfehveevie dtjedvteevueegkeevgffgffehtedvjeeigeeghedvffelnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Oct 2023 08:49:17 -0400 (EDT) From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= To: 66408@debbugs.gnu.org Subject: [PATCH v4] gnu: icecat: Add support for Guix packaged extensions. Date: Tue, 17 Oct 2023 14:48:55 +0200 Message-ID: <4df560c46b4d4512cabcce18b8d3a38d2f2730bc.1697546935.git.clement@lassieur.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Jonathan Brielmaier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION procedure that makes sure the add-on directory is a symlink, so that Icecat can normalize it into a package store path. * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store the add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. [arguments]: Use the add-on ID as root directory. (ublock-origin/icecat): New procedure. * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unused 'apply-guix-specific-patches' phase so that it applies the following two patches. [native-search-paths]: New field. * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares add-on paths (which are package store paths) to detect package changes. * gnu/packages/patches/icecat-use-guix-extensions.patch: New patch that replaces "/usr/share/mozilla/extensions" with "$ICECAT_EXTENSION_DIR". --- gnu/build/icecat-extension.scm | 71 +++++++++++++++++++ gnu/local.mk | 3 + gnu/packages/browser-extensions.scm | 13 +++- gnu/packages/gnuzilla.scm | 22 +++--- .../patches/icecat-compare-paths.patch | 19 +++++ .../patches/icecat-use-guix-extensions.patch | 40 +++++++++++ 6 files changed, 155 insertions(+), 13 deletions(-) create mode 100644 gnu/build/icecat-extension.scm create mode 100644 gnu/packages/patches/icecat-compare-paths.patch create mode 100644 gnu/packages/patches/icecat-use-guix-extensions.patch diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm new file mode 100644 index 000000000000..8ecd8a505f72 --- /dev/null +++ b/gnu/build/icecat-extension.scm @@ -0,0 +1,71 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2023 Clément Lassieur +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build icecat-extension) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:export (make-icecat-extension)) + +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) + "Create an Icecat extension from package PKG and return a package that, +when installed, will make the extension contained in PKG available as an +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use." + (package + (inherit pkg) + (name (string-append (package-name pkg) "-icecat")) + (native-inputs '()) + (inputs '()) + (propagated-inputs '()) + (outputs '("out")) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((id #$(assq-ref (package-properties pkg) 'id)) + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") + (search-dir (string-append #$output + "/share/icecat/extensions/" + moz-app-id))) + ;; Icecat's iterates over `search-dir` for directories. If a + ;; directory's name is not a valid add-on ID, it is ignored. See + ;; `DirectoryLocation::readAddons()` in XPIProvider.jsm. + + ;; This directory has to be a symlink, because Icecat's + ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile` is a + ;; symlink. + + ;; Normalizing is required because Icecat compares the add-on path + ;; against its local database to know if there is an extension + ;; update. We want the add-on path to be the package store path, + ;; so that a path change is detected every time the package is + ;; updated. See `updateExistingAddon()` in XPIDatabase.jsm, with + ;; our patch `icecat-compare-paths.patch`. + + ;; We don't want the add-on path to be the profile store path, + ;; which would change too often. We don't want the add-on path to + ;; be hard-coded ("/usr/share/mozilla/extensions") either because + ;; it would never change. + + (mkdir-p search-dir) + (symlink (in-vicinity (ungexp pkg pkg-output) id) + (in-vicinity search-dir id)))))))) diff --git a/gnu/local.mk b/gnu/local.mk index 13c2b949449d..5e8aaea9ff99 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -761,6 +761,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/chromium-extension.scm \ %D%/build/cross-toolchain.scm \ %D%/build/dbus-service.scm \ + %D%/build/icecat-extension.scm \ %D%/build/image.scm \ %D%/build/jami-service.scm \ %D%/build/file-systems.scm \ @@ -1416,6 +1417,8 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-102-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ + %D%/packages/patches/icecat-compare-paths.patch \ + %D%/packages/patches/icecat-use-guix-extensions.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ %D%/packages/patches/icecat-use-system-media-libs.patch \ %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 3f6da8d77a3f..68c38a76d8ac 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) + #:use-module (gnu build icecat-extension) #:use-module (gnu packages compression) #:use-module (gnu packages python)) @@ -98,6 +100,7 @@ (define ublock-origin "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1")))) (build-system gnu-build-system) (outputs '("xpi" "firefox" "chromium")) + (properties '((id . "uBlock0@raymondhill.net"))) (arguments (list #:tests? #f ;no tests @@ -125,9 +128,10 @@ (define ublock-origin (invoke "./tools/make-chromium.sh"))) (add-after 'build-chromium 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((firefox (assoc-ref outputs "firefox")) - (xpi (assoc-ref outputs "xpi")) - (chromium (assoc-ref outputs "chromium"))) + (let* ((id #$(assq-ref properties 'id)) + (firefox (in-vicinity (assoc-ref outputs "firefox") id)) + (xpi (assoc-ref outputs "xpi")) + (chromium (assoc-ref outputs "chromium"))) (install-file "dist/build/uBlock0.firefox.xpi" (string-append xpi "/lib/mozilla/extensions")) (copy-recursively "dist/build/uBlock0.firefox" firefox) @@ -142,3 +146,6 @@ (define ublock-origin (define-public ublock-origin/chromium (make-chromium-extension ublock-origin "chromium")) + +(define-public ublock-origin/icecat + (make-icecat-extension ublock-origin "firefox")) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index a367d7a00ff6..608219c97303 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -885,16 +885,13 @@ (define-public icecat-minimal #:phases #~(modify-phases %standard-phases (add-after 'unpack 'apply-guix-specific-patches - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((patch (search-input-file inputs "bin/patch"))) - (for-each (match-lambda - ((label . file) - (when (and (string-prefix? "icecat-" label) - (string-suffix? ".patch" label)) - (format #t "applying '~a'...~%" file) - (invoke patch "--force" "--no-backup-if-mismatch" - "-p1" "--input" file)))) - (or native-inputs inputs))))) + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-paths.patch")) + #$(local-file + (search-patch "icecat-use-guix-extensions.patch")))))) (add-after 'apply-guix-specific-patches 'remove-bundled-libraries (lambda _ ;; Remove bundled libraries that we don't use, since they may @@ -1138,6 +1135,11 @@ (define-public icecat-minimal '("default16.png" "default22.png" "default24.png" "default32.png" "default48.png" "content/icon64.png" "mozicon128.png" "default256.png")))))))) + (native-search-paths + (list (search-path-specification + (variable "ICECAT_EXTENSION_DIR") + (separator #f) ;single entry + (files '("share/icecat/extensions"))))) (home-page "https://www.gnu.org/software/gnuzilla/") (synopsis "Entirely free browser derived from Mozilla Firefox") (description diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packages/patches/icecat-compare-paths.patch new file mode 100644 index 000000000000..9205899dc0c4 --- /dev/null +++ b/gnu/packages/patches/icecat-compare-paths.patch @@ -0,0 +1,19 @@ +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile = { + if ( + newAddon || + oldAddon.updateDate != xpiState.mtime || ++ oldAddon.path != xpiState.path || + (aUpdateCompatibility && this.isAppBundledLocation(installLocation)) + ) { + newAddon = this.updateMetadata( +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile = { + xpiState, + newAddon + ); +- } else if (oldAddon.path != xpiState.path) { +- newAddon = this.updatePath(installLocation, oldAddon, xpiState); + } else if (aUpdateCompatibility || aSchemaChange) { + newAddon = this.updateCompatibility( + installLocation, diff --git a/gnu/packages/patches/icecat-use-guix-extensions.patch b/gnu/packages/patches/icecat-use-guix-extensions.patch new file mode 100644 index 000000000000..ed1ce922d55b --- /dev/null +++ b/gnu/packages/patches/icecat-use-guix-extensions.patch @@ -0,0 +1,40 @@ +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -281,6 +281,22 @@ nsresult nsXREDirProvider::GetBackgroundTasksProfilesRootDir( + } + #endif + ++static nsresult GetGuixExtensionDir(nsIFile** aFile) { ++ nsresult rv; ++ nsCOMPtr localDir; ++ ++ const char* extensionDir = getenv("ICECAT_EXTENSION_DIR"); ++ if (!extensionDir || !*extensionDir) return NS_ERROR_FAILURE; ++ ++ rv = NS_NewNativeLocalFile(nsDependentCString(extensionDir), true, ++ getter_AddRefs(localDir)); ++ ++ if (NS_SUCCEEDED(rv)) { ++ localDir.forget(aFile); ++ } ++ return rv; ++} ++ + #if defined(XP_UNIX) || defined(XP_MACOSX) + /** + * Get the directory that is the parent of the system-wide directories +@@ -415,13 +431,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, + #if defined(XP_UNIX) && !defined(XP_MACOSX) + else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) { + # ifdef ENABLE_SYSTEM_EXTENSION_DIRS +-# if defined(__OpenBSD__) || defined(__FreeBSD__) +- static const char* const sysLExtDir = "/usr/local/share/mozilla/extensions"; +-# else +- static const char* const sysLExtDir = "/usr/share/mozilla/extensions"; +-# endif +- rv = NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, +- getter_AddRefs(file)); ++ rv = ::GetGuixExtensionDir(getter_AddRefs(file)); + # endif + } + #endif // defined(XP_UNIX) && !defined(XP_MACOSX) base-commit: 5498835bb38c0de57f284f0fa6b1178ecdcaf678 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 17 12:47:01 2023 Received: (at 66408) by debbugs.gnu.org; 17 Oct 2023 16:47:01 +0000 Received: from localhost ([127.0.0.1]:60937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnDg-0007ES-GO for submit@debbugs.gnu.org; Tue, 17 Oct 2023 12:47:01 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:35525) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qsnDb-0007Dr-DO for 66408@debbugs.gnu.org; Tue, 17 Oct 2023 12:46:59 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 750E43200909; Tue, 17 Oct 2023 12:46:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 17 Oct 2023 12:46:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm2; t=1697561181; x= 1697647581; bh=WCRviOpQfmx9kVXEaFcDldv1POjAPG7Rdf8i95HaJcM=; b=k o8lHEOKb/RX2vD6lw28Ni9ktYtVHtpAuKHBZSn6wBzntLjy+bGNoQS5zlKTLZPYX apPelhTShY6mnhKRF/z7b5ObVcJtDOPp9d+yABv503BLDdEy5rY6ggdNDCGvPpmn OxkngDXc9hh7gqDapQp0NmqmftPY+y8/V8SV8PhS8I0sGjU17a4xrN7+F9DiBsph 7AxF/208QUCQ9WjYmrclYe3X2jWt7Vit0piFq6FsJy+zkEul35mFLkqP1d0X9n1o 7QAneTVG5NYlZJ2PmQNHdITuq8a1np4/NDXLYksyX3oKm5UxPU89Hfj2KX/TgAOu j61lvp58gd3U99oqIhw9A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1697561181; x=1697647581; bh=W CRviOpQfmx9kVXEaFcDldv1POjAPG7Rdf8i95HaJcM=; b=KSRLQcH07JwOfCbq2 SF1Lo6y3lNRznaDaxSo7RswcCy4rpMvpX9DAtXfa/RLrDdlq5nNBGC8do9+wlL24 fnAZC1wgLTFMUN858aBvpJSzPOQvBeoSdW2HtW3zZEJ2hGFq6cBeqrdrNOlZ5hQl /h6EiLwZ/JZkDA4ly9NThUbMLe4L893RLukCJFwbmgCUA+L3AabkWVE9VY2jIxUe K9XxPF1GWTjmNMZf173FOpukqLK6KSDij1ZQd7WMe6OY866VLxsjbG1LKHIgIley AyqX8KFYIe3c6X1IeQriWogteQYTnmFEbMGFnYPMejB0vVItqGR2RqVnDKUd3nDu RyXlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedvgddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre dtredtjeenucfhrhhomhepvehlrohmvghnthcunfgrshhsihgvuhhruceotghlvghmvghn theslhgrshhsihgvuhhrrdhorhhgqeenucggtffrrghtthgvrhhnpeffudeftefhheevve eitdejvdetveeugeekvefggfffheetvdejieeggeehvdffleenucffohhmrghinhepghhn uhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegtlhgvmhgvnhhtsehlrghsshhivghurhdrohhrgh X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Oct 2023 12:46:21 -0400 (EDT) From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= To: 66408@debbugs.gnu.org Subject: [PATCH v5] gnu: icecat: Support Guix packaged extensions and native manifests. Date: Tue, 17 Oct 2023 18:45:46 +0200 Message-ID: <2ae9c5496838c6644de4c1199e188e44c7171f0f.1697561146.git.clement@lassieur.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Jonathan Brielmaier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION procedure that makes sure the add-on directory is a symlink, so that Icecat can normalize it into a package store path. * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store the add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. [arguments]: Use the add-on ID as root directory. (ublock-origin/icecat): New procedure. * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unused 'apply-guix-specific-patches' phase so that it applies the following two patches. [native-search-paths]: New field. * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares add-on paths (which are package store paths) to detect package changes. * gnu/packages/patches/icecat-use-system-wide-dir.patch: New patch that replaces "/usr/lib/mozilla" (the system-wide directory for extensions and native manifests) with "$ICECAT_SYSTEM_DIR". --- gnu/build/icecat-extension.scm | 70 +++++++++++++++++++ gnu/local.mk | 3 + gnu/packages/browser-extensions.scm | 13 +++- gnu/packages/gnuzilla.scm | 22 +++--- .../patches/icecat-compare-paths.patch | 19 +++++ .../patches/icecat-use-system-wide-dir.patch | 33 +++++++++ 6 files changed, 147 insertions(+), 13 deletions(-) create mode 100644 gnu/build/icecat-extension.scm create mode 100644 gnu/packages/patches/icecat-compare-paths.patch create mode 100644 gnu/packages/patches/icecat-use-system-wide-dir.patch diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm new file mode 100644 index 000000000000..ebdf30f2af06 --- /dev/null +++ b/gnu/build/icecat-extension.scm @@ -0,0 +1,70 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2023 Clément Lassieur +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build icecat-extension) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:export (make-icecat-extension)) + +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) + "Create an Icecat extension from package PKG and return a package that, +when installed, will make the extension contained in PKG available as an +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use." + (package + (inherit pkg) + (name (string-append (package-name pkg) "-icecat")) + (native-inputs '()) + (inputs '()) + (propagated-inputs (package-propagated-inputs pkg)) + (outputs '("out")) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((id #$(assq-ref (package-properties pkg) 'id)) + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") + (search-dir (string-append #$output "/lib/icecat/extensions/" + moz-app-id))) + ;; Icecat's iterates over `search-dir` for directories. If a + ;; directory's name is not a valid add-on ID, it is ignored. See + ;; `DirectoryLocation::readAddons()` in XPIProvider.jsm. + + ;; This directory has to be a symlink, because Icecat's + ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile` is a + ;; symlink. + + ;; Normalizing is required because Icecat compares the add-on path + ;; against its local database to know if there is an extension + ;; update. We want the add-on path to be the package store path, + ;; so that a path change is detected every time the package is + ;; updated. See `updateExistingAddon()` in XPIDatabase.jsm, with + ;; our patch `icecat-compare-paths.patch`. + + ;; We don't want the add-on path to be the profile store path, + ;; which would change too often. We don't want the add-on path to + ;; be hard-coded either because it would never change (but it + ;; wouldn't make sense anyway). + + (mkdir-p search-dir) + (symlink (in-vicinity (ungexp pkg pkg-output) id) + (in-vicinity search-dir id)))))))) diff --git a/gnu/local.mk b/gnu/local.mk index 13c2b949449d..3bf0ad0cf08b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -761,6 +761,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/chromium-extension.scm \ %D%/build/cross-toolchain.scm \ %D%/build/dbus-service.scm \ + %D%/build/icecat-extension.scm \ %D%/build/image.scm \ %D%/build/jami-service.scm \ %D%/build/file-systems.scm \ @@ -1416,8 +1417,10 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-102-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ + %D%/packages/patches/icecat-compare-paths.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ %D%/packages/patches/icecat-use-system-media-libs.patch \ + %D%/packages/patches/icecat-use-system-wide-dir.patch \ %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ %D%/packages/patches/icedtea-7-hotspot-pointer-comparison.patch \ %D%/packages/patches/icu4c-fix-TestHebrewCalendarInTemporalLeapYear.patch \ diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 3f6da8d77a3f..68c38a76d8ac 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) + #:use-module (gnu build icecat-extension) #:use-module (gnu packages compression) #:use-module (gnu packages python)) @@ -98,6 +100,7 @@ (define ublock-origin "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1")))) (build-system gnu-build-system) (outputs '("xpi" "firefox" "chromium")) + (properties '((id . "uBlock0@raymondhill.net"))) (arguments (list #:tests? #f ;no tests @@ -125,9 +128,10 @@ (define ublock-origin (invoke "./tools/make-chromium.sh"))) (add-after 'build-chromium 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((firefox (assoc-ref outputs "firefox")) - (xpi (assoc-ref outputs "xpi")) - (chromium (assoc-ref outputs "chromium"))) + (let* ((id #$(assq-ref properties 'id)) + (firefox (in-vicinity (assoc-ref outputs "firefox") id)) + (xpi (assoc-ref outputs "xpi")) + (chromium (assoc-ref outputs "chromium"))) (install-file "dist/build/uBlock0.firefox.xpi" (string-append xpi "/lib/mozilla/extensions")) (copy-recursively "dist/build/uBlock0.firefox" firefox) @@ -142,3 +146,6 @@ (define ublock-origin (define-public ublock-origin/chromium (make-chromium-extension ublock-origin "chromium")) + +(define-public ublock-origin/icecat + (make-icecat-extension ublock-origin "firefox")) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index a367d7a00ff6..1817dd44d1e3 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -885,16 +885,13 @@ (define-public icecat-minimal #:phases #~(modify-phases %standard-phases (add-after 'unpack 'apply-guix-specific-patches - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((patch (search-input-file inputs "bin/patch"))) - (for-each (match-lambda - ((label . file) - (when (and (string-prefix? "icecat-" label) - (string-suffix? ".patch" label)) - (format #t "applying '~a'...~%" file) - (invoke patch "--force" "--no-backup-if-mismatch" - "-p1" "--input" file)))) - (or native-inputs inputs))))) + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-paths.patch")) + #$(local-file + (search-patch "icecat-use-system-wide-dir.patch")))))) (add-after 'apply-guix-specific-patches 'remove-bundled-libraries (lambda _ ;; Remove bundled libraries that we don't use, since they may @@ -1138,6 +1135,11 @@ (define-public icecat-minimal '("default16.png" "default22.png" "default24.png" "default32.png" "default48.png" "content/icon64.png" "mozicon128.png" "default256.png")))))))) + (native-search-paths + (list (search-path-specification + (variable "ICECAT_SYSTEM_DIR") + (separator #f) ;single entry + (files '("lib/icecat"))))) (home-page "https://www.gnu.org/software/gnuzilla/") (synopsis "Entirely free browser derived from Mozilla Firefox") (description diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packages/patches/icecat-compare-paths.patch new file mode 100644 index 000000000000..9205899dc0c4 --- /dev/null +++ b/gnu/packages/patches/icecat-compare-paths.patch @@ -0,0 +1,19 @@ +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile = { + if ( + newAddon || + oldAddon.updateDate != xpiState.mtime || ++ oldAddon.path != xpiState.path || + (aUpdateCompatibility && this.isAppBundledLocation(installLocation)) + ) { + newAddon = this.updateMetadata( +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile = { + xpiState, + newAddon + ); +- } else if (oldAddon.path != xpiState.path) { +- newAddon = this.updatePath(installLocation, oldAddon, xpiState); + } else if (aUpdateCompatibility || aSchemaChange) { + newAddon = this.updateCompatibility( + installLocation, diff --git a/gnu/packages/patches/icecat-use-system-wide-dir.patch b/gnu/packages/patches/icecat-use-system-wide-dir.patch new file mode 100644 index 000000000000..db9cf12e5435 --- /dev/null +++ b/gnu/packages/patches/icecat-use-system-wide-dir.patch @@ -0,0 +1,33 @@ +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -293,24 +293,12 @@ nsresult nsXREDirProvider::GetBackgroundTasksProfilesRootDir( + static nsresult GetSystemParentDirectory(nsIFile** aFile) { + nsresult rv; + nsCOMPtr localDir; +-# if defined(XP_MACOSX) +- rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType, +- getter_AddRefs(localDir)); +- if (NS_SUCCEEDED(rv)) { +- rv = localDir->AppendNative("Mozilla"_ns); +- } +-# else +- constexpr auto dirname = +-# ifdef HAVE_USR_LIB64_DIR +- "/usr/lib64/mozilla"_ns +-# elif defined(__OpenBSD__) || defined(__FreeBSD__) +- "/usr/local/lib/mozilla"_ns +-# else +- "/usr/lib/mozilla"_ns +-# endif +- ; +- rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir)); +-# endif ++ ++ const char* systemParentDir = getenv("ICECAT_SYSTEM_DIR"); ++ if (!systemParentDir || !*systemParentDir) return NS_ERROR_FAILURE; ++ ++ rv = NS_NewNativeLocalFile(nsDependentCString(systemParentDir), false, ++ getter_AddRefs(localDir)); + + if (NS_SUCCEEDED(rv)) { + localDir.forget(aFile); base-commit: 5498835bb38c0de57f284f0fa6b1178ecdcaf678 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 06:02:03 2023 Received: (at 66408) by debbugs.gnu.org; 20 Oct 2023 10:02:03 +0000 Received: from localhost ([127.0.0.1]:38733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtmKQ-0001KL-RV for submit@debbugs.gnu.org; Fri, 20 Oct 2023 06:02:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtmKO-0001Jp-1q for 66408@debbugs.gnu.org; Fri, 20 Oct 2023 06:02:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qtmJq-0005gh-MJ; Fri, 20 Oct 2023 06:01:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=21/cuc3xiMnVVWGfjFKdNB4jE7iEjfTZfh7G5VQ4aAs=; b=p7Hlz8J2SRiLfdamzAr+ w4xWkd+1Rxd3e92cd0pDTLJ2z6BIMwijS20F4TBwQKNnWNV5qwDacyON71EEihdt5N7OkwxeTRvJ0 OpYr4UqBYHUu0sVUxz49m8PpM16++oJ7jnJu6jDyK8y9Cj7Jp8jeXWMfsyraNTXD9mhxy8r22iL4X RbnCijh8aP2K1U33X9H+iI5kdSRxe7o6MsFz2C46+crhSUOO8Ze99FwC/8fkboIEU1xCzWEh4PUgK cIDzN/LE0qgf1Kik8KOrRrZHGMZ7EOlEYeh4ht3Z2rzIYRLZw+BLJiHj5jZGsGd8hm3lEF6U984B9 fJuguu2YXmvJEA==; From: Mathieu Othacehe To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#66408] [PATCH v5] gnu: icecat: Support Guix packaged extensions and native manifests. In-Reply-To: <2ae9c5496838c6644de4c1199e188e44c7171f0f.1697561146.git.clement@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Tue, 17 Oct 2023 18:45:46 +0200") References: <2ae9c5496838c6644de4c1199e188e44c7171f0f.1697561146.git.clement@lassieur.org> Date: Fri, 20 Oct 2023 12:01:11 +0200 Message-ID: <87h6mllijc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66408 Cc: Jonathan Brielmaier , 66408@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey Cl=C3=A9ment, > + (let* ((id #$(assq-ref properties 'id)) id is maybe a bit generic? > + (firefox (in-vicinity (assoc-ref outputs "firefox")= id)) > + (xpi (assoc-ref outputs "xpi")) > + (chromium (assoc-ref outputs "chromium"))) > (install-file "dist/build/uBlock0.firefox.xpi" > (string-append xpi "/lib/mozilla/extension= s")) > (copy-recursively "dist/build/uBlock0.firefox" firefox) > @@ -142,3 +146,6 @@ (define ublock-origin >=20=20 > (define-public ublock-origin/chromium > (make-chromium-extension ublock-origin "chromium")) > + > +(define-public ublock-origin/icecat > + (make-icecat-extension ublock-origin "firefox")) It does not appear clearly that one has to install ublock-origin-icecat here. We have the same issue for ublock-origin-chromium though. > diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packag= es/patches/icecat-compare-paths.patch > new file mode 100644 > index 000000000000..9205899dc0c4 > --- /dev/null > +++ b/gnu/packages/patches/icecat-compare-paths.patch You could add a small header explaining the content of that patch, ... > --- /dev/null > +++ b/gnu/packages/patches/icecat-use-system-wide-dir.patch ..., as well as that one. I tried a guix shell icecat ublock-origin-icecat and it worked perfectly :) It is also very appreciated to have a pre-built icecat by the QA :). Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 08:27:20 2023 Received: (at 66408) by debbugs.gnu.org; 20 Oct 2023 12:27:20 +0000 Received: from localhost ([127.0.0.1]:38934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtob1-0002zS-CK for submit@debbugs.gnu.org; Fri, 20 Oct 2023 08:27:20 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:40989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtoaw-0002zC-3I for 66408@debbugs.gnu.org; Fri, 20 Oct 2023 08:27:18 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.west.internal (Postfix) with ESMTP id 4F99532009D7; Fri, 20 Oct 2023 08:26:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 20 Oct 2023 08:26:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm2; t=1697804799; x= 1697891199; bh=xmwfYWYDGlskcQEOcXLZZj7L8BtrlqtM1QwzY9e7roY=; b=Q VnclYavWqv9UpdLRzfLQWJ8hl8B+af98VUXLK+AaxN/NGIktb3L8W6PvPcxzyx73 nkzeSjQJtdmOOU8u2LDduFmnaDOWaOk3XPes34VczBd+YxzttebTV+DUwGYU3Asx cNhtLKzHvrbDId+Rzt6X4wiNmawpDp9/8KW1wr+B5MocFE4Rxl6IVZRAxjG2Lyl9 MEuDZndLqO01z2Sjb8bBxa2DtfX+WGiD3ExnxRsnqeveIB/u447Nl4tju8avYwYG sD1vwPWWCeJIvZgvkwzzphb7rUhGzNeoJtibKjl44LOPnr70C/j2V7YUa9lIrG7h LuukXEEgvrpeMbQt5D31g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1697804799; x=1697891199; bh=x mwfYWYDGlskcQEOcXLZZj7L8BtrlqtM1QwzY9e7roY=; b=ms0Bt3nNxlWs7INEY 8dLUwvBiHi88ZHwZscc3K0gXcCiE8oICoVgPXvXSRDHisJONHsCi0YiIU/ozGA0c V4Te/PNgqRxz9Pde/oId4p1hpsE3HJcmtSJP/qBT1ExsqmB6zIC5nI6ugrn4eBoh ADxAdPyZ3TeB87BOqeI4UED+pD4PAa1o7Z8uEMhMeE1U+sh/zRkQijtoQ/SC0q1q mSQ9Yl/VA6VLXxtTF65eX2KfbjFqQ9VOnV5cbi5VHURl88BALaDr67zk8iiMhaHh /W1agUXv9nHa4JLGffvWMQL5EsrfEefjqQgKTHhZFJbHrK7Hx9+oUeAtzeuUlfAd O5Hlw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeekgdehtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertd ertdejnecuhfhrohhmpeevlhormhgvnhhtucfnrghsshhivghurhcuoegtlhgvmhgvnhht sehlrghsshhivghurhdrohhrgheqnecuggftrfgrthhtvghrnhepffdufeethfehveevie dtjedvteevueegkeevgffgffehtedvjeeigeeghedvffelnecuffhomhgrihhnpehgnhhu rdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Oct 2023 08:26:38 -0400 (EDT) From: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= To: 66408@debbugs.gnu.org Subject: [PATCH v6] gnu: icecat: Support Guix packaged extensions and native manifests. Date: Fri, 20 Oct 2023 14:26:01 +0200 Message-ID: <0743d8b8c53385522af0c5dc07ca8572f5d0d2b7.1697804761.git.clement@lassieur.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Jonathan Brielmaier Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: =?UTF-8?q?Cl=C3=A9ment=20Lassieur?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION procedure that makes sure the add-on directory is a symlink, so that Icecat can normalize it into a package store path. * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store the add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. [arguments]: Use the add-on ID as root directory. (ublock-origin/icecat): New procedure. * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unused 'apply-guix-specific-patches' phase so that it applies the following two patches. [native-search-paths]: New field. * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares add-on paths (which are package store paths) to detect package changes. * gnu/packages/patches/icecat-use-system-wide-dir.patch: New patch that replaces "/usr/lib/mozilla" (the system-wide directory for extensions and native manifests) with "$ICECAT_SYSTEM_DIR". --- gnu/build/icecat-extension.scm | 70 +++++++++++++++++++ gnu/local.mk | 3 + gnu/packages/browser-extensions.scm | 14 +++- gnu/packages/gnuzilla.scm | 22 +++--- .../patches/icecat-compare-paths.patch | 21 ++++++ .../patches/icecat-use-system-wide-dir.patch | 36 ++++++++++ 6 files changed, 153 insertions(+), 13 deletions(-) create mode 100644 gnu/build/icecat-extension.scm create mode 100644 gnu/packages/patches/icecat-compare-paths.patch create mode 100644 gnu/packages/patches/icecat-use-system-wide-dir.patch diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm new file mode 100644 index 000000000000..1e6a9a54e4bb --- /dev/null +++ b/gnu/build/icecat-extension.scm @@ -0,0 +1,70 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020, 2021 Marius Bakke +;;; Copyright © 2023 Clément Lassieur +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu build icecat-extension) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system trivial) + #:export (make-icecat-extension)) + +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) + "Create an Icecat extension from package PKG and return a package that, +when installed, will make the extension contained in PKG available as an +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to use." + (package + (inherit pkg) + (name (string-append (package-name pkg) "-icecat")) + (native-inputs '()) + (inputs '()) + (propagated-inputs (package-propagated-inputs pkg)) + (outputs '("out")) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((addon-id #$(assq-ref (package-properties pkg) 'addon-id)) + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") + (search-dir (string-append #$output "/lib/icecat/extensions/" + moz-app-id))) + ;; Icecat's iterates over `search-dir` for directories. If a + ;; directory's name is not a valid add-on ID, it is ignored. See + ;; `DirectoryLocation::readAddons()` in XPIProvider.jsm. + + ;; This directory has to be a symlink, because Icecat's + ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile` is a + ;; symlink. + + ;; Normalizing is required because Icecat compares the add-on path + ;; against its local database to know if there is an extension + ;; update. We want the add-on path to be the package store path, + ;; so that a path change is detected every time the package is + ;; updated. See `updateExistingAddon()` in XPIDatabase.jsm, with + ;; our patch `icecat-compare-paths.patch`. + + ;; We don't want the add-on path to be the profile store path, + ;; which would change too often. We don't want the add-on path to + ;; be hard-coded either because it would never change (but it + ;; wouldn't make sense anyway). + + (mkdir-p search-dir) + (symlink (in-vicinity (ungexp pkg pkg-output) addon-id) + (in-vicinity search-dir addon-id)))))))) diff --git a/gnu/local.mk b/gnu/local.mk index daacd786a7d3..be3ec73cb1e9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -761,6 +761,7 @@ GNU_SYSTEM_MODULES = \ %D%/build/chromium-extension.scm \ %D%/build/cross-toolchain.scm \ %D%/build/dbus-service.scm \ + %D%/build/icecat-extension.scm \ %D%/build/image.scm \ %D%/build/jami-service.scm \ %D%/build/file-systems.scm \ @@ -1416,8 +1417,10 @@ dist_patch_DATA = \ %D%/packages/patches/icecat-makeicecat.patch \ %D%/packages/patches/icecat-102-makeicecat.patch \ %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ + %D%/packages/patches/icecat-compare-paths.patch \ %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ %D%/packages/patches/icecat-use-system-media-libs.patch \ + %D%/packages/patches/icecat-use-system-wide-dir.patch \ %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ %D%/packages/patches/icedtea-7-hotspot-pointer-comparison.patch \ %D%/packages/patches/icu4c-fix-TestHebrewCalendarInTemporalLeapYear.patch \ diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm index 3f6da8d77a3f..252c95729dad 100644 --- a/gnu/packages/browser-extensions.scm +++ b/gnu/packages/browser-extensions.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2021 Marius Bakke ;;; Copyright © 2023 Nicolas Graves +;;; Copyright © 2023 Clément Lassieur ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) #:use-module (gnu build chromium-extension) + #:use-module (gnu build icecat-extension) #:use-module (gnu packages compression) #:use-module (gnu packages python)) @@ -98,6 +100,7 @@ (define ublock-origin "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1")))) (build-system gnu-build-system) (outputs '("xpi" "firefox" "chromium")) + (properties '((addon-id . "uBlock0@raymondhill.net"))) (arguments (list #:tests? #f ;no tests @@ -125,9 +128,11 @@ (define ublock-origin (invoke "./tools/make-chromium.sh"))) (add-after 'build-chromium 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((firefox (assoc-ref outputs "firefox")) - (xpi (assoc-ref outputs "xpi")) - (chromium (assoc-ref outputs "chromium"))) + (let* ((addon-id #$(assq-ref properties 'addon-id)) + (firefox (in-vicinity + (assoc-ref outputs "firefox") addon-id)) + (xpi (assoc-ref outputs "xpi")) + (chromium (assoc-ref outputs "chromium"))) (install-file "dist/build/uBlock0.firefox.xpi" (string-append xpi "/lib/mozilla/extensions")) (copy-recursively "dist/build/uBlock0.firefox" firefox) @@ -142,3 +147,6 @@ (define ublock-origin (define-public ublock-origin/chromium (make-chromium-extension ublock-origin "chromium")) + +(define-public ublock-origin/icecat + (make-icecat-extension ublock-origin "firefox")) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index a367d7a00ff6..1817dd44d1e3 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -885,16 +885,13 @@ (define-public icecat-minimal #:phases #~(modify-phases %standard-phases (add-after 'unpack 'apply-guix-specific-patches - (lambda* (#:key inputs native-inputs #:allow-other-keys) - (let ((patch (search-input-file inputs "bin/patch"))) - (for-each (match-lambda - ((label . file) - (when (and (string-prefix? "icecat-" label) - (string-suffix? ".patch" label)) - (format #t "applying '~a'...~%" file) - (invoke patch "--force" "--no-backup-if-mismatch" - "-p1" "--input" file)))) - (or native-inputs inputs))))) + (lambda _ + (for-each + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) + '(#$(local-file + (search-patch "icecat-compare-paths.patch")) + #$(local-file + (search-patch "icecat-use-system-wide-dir.patch")))))) (add-after 'apply-guix-specific-patches 'remove-bundled-libraries (lambda _ ;; Remove bundled libraries that we don't use, since they may @@ -1138,6 +1135,11 @@ (define-public icecat-minimal '("default16.png" "default22.png" "default24.png" "default32.png" "default48.png" "content/icon64.png" "mozicon128.png" "default256.png")))))))) + (native-search-paths + (list (search-path-specification + (variable "ICECAT_SYSTEM_DIR") + (separator #f) ;single entry + (files '("lib/icecat"))))) (home-page "https://www.gnu.org/software/gnuzilla/") (synopsis "Entirely free browser derived from Mozilla Firefox") (description diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packages/patches/icecat-compare-paths.patch new file mode 100644 index 000000000000..69c03e05eebc --- /dev/null +++ b/gnu/packages/patches/icecat-compare-paths.patch @@ -0,0 +1,21 @@ +See comment in gnu/build/icecat-extension.scm. + +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile = { + if ( + newAddon || + oldAddon.updateDate != xpiState.mtime || ++ oldAddon.path != xpiState.path || + (aUpdateCompatibility && this.isAppBundledLocation(installLocation)) + ) { + newAddon = this.updateMetadata( +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile = { + xpiState, + newAddon + ); +- } else if (oldAddon.path != xpiState.path) { +- newAddon = this.updatePath(installLocation, oldAddon, xpiState); + } else if (aUpdateCompatibility || aSchemaChange) { + newAddon = this.updateCompatibility( + installLocation, diff --git a/gnu/packages/patches/icecat-use-system-wide-dir.patch b/gnu/packages/patches/icecat-use-system-wide-dir.patch new file mode 100644 index 000000000000..a635a4d18ee6 --- /dev/null +++ b/gnu/packages/patches/icecat-use-system-wide-dir.patch @@ -0,0 +1,36 @@ +Replace "/usr/lib/mozilla" (the system-wide directory for extensions and +native manifests) with "$ICECAT_SYSTEM_DIR". + +--- a/toolkit/xre/nsXREDirProvider.cpp ++++ b/toolkit/xre/nsXREDirProvider.cpp +@@ -293,24 +293,12 @@ nsresult nsXREDirProvider::GetBackgroundTasksProfilesRootDir( + static nsresult GetSystemParentDirectory(nsIFile** aFile) { + nsresult rv; + nsCOMPtr localDir; +-# if defined(XP_MACOSX) +- rv = GetOSXFolderType(kOnSystemDisk, kApplicationSupportFolderType, +- getter_AddRefs(localDir)); +- if (NS_SUCCEEDED(rv)) { +- rv = localDir->AppendNative("Mozilla"_ns); +- } +-# else +- constexpr auto dirname = +-# ifdef HAVE_USR_LIB64_DIR +- "/usr/lib64/mozilla"_ns +-# elif defined(__OpenBSD__) || defined(__FreeBSD__) +- "/usr/local/lib/mozilla"_ns +-# else +- "/usr/lib/mozilla"_ns +-# endif +- ; +- rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir)); +-# endif ++ ++ const char* systemParentDir = getenv("ICECAT_SYSTEM_DIR"); ++ if (!systemParentDir || !*systemParentDir) return NS_ERROR_FAILURE; ++ ++ rv = NS_NewNativeLocalFile(nsDependentCString(systemParentDir), false, ++ getter_AddRefs(localDir)); + + if (NS_SUCCEEDED(rv)) { + localDir.forget(aFile); base-commit: c065da01ff956d3c2bdfc45a33d910e509a211d9 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 20 08:40:52 2023 Received: (at 66408) by debbugs.gnu.org; 20 Oct 2023 12:40:52 +0000 Received: from localhost ([127.0.0.1]:38941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtoo8-0003JX-C5 for submit@debbugs.gnu.org; Fri, 20 Oct 2023 08:40:52 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:46443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qtoo2-0003JF-QI for 66408@debbugs.gnu.org; Fri, 20 Oct 2023 08:40:50 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C9FB132009D8; Fri, 20 Oct 2023 08:40:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 20 Oct 2023 08:40:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1697805613; x=1697892013; bh=SDZyj5kaO+W34jWN1YiBEhm6U/8Re7fkPDq MiFXCAfI=; b=ouQpEcbRLnMyqQ0jec7nzD2Qs+gBhjUCQDl+1+RlTY3a0LcOaIh OoYgGIZ+ZKvBXtxo8I8cN+mmIKfTI74u69H9VyNANqXzACmJNHLNKNB4rlwEabvN B8Eztm0/Xz0CPg+GUb6SO25BqDQSLbg7YmjjbloEosfGNhY9vdf8mlPk/7EbEWTW 10gBkKG0jZOlqRrW2fZBbWXHgWh9bghQhB9VgGcWhpxrlxBoQP6rJAlh4MdsgNXS l6RIapN1r43trsU+4oyC24euFa57oRh4OL9uYRQxCLFaw2jTjyHGu/GLy5tBpn3q RQhst6Fx0SvJOzeRwui+Y8q0F4M1hkqzLsw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1697805613; x=1697892013; bh=SDZyj5kaO+W34jWN1YiBEhm6U/8Re7fkPDq MiFXCAfI=; b=LCpG7Q/VHHh5eFcRAANkM3P3B/c5kspPgt5/tRQJJyb+2x/+eXc 9v5VUOpA7OVKx9k+dnOf32wpPSgBK9lGAJWBt+O4sfs3h0ufci0lsw4YzqPKRZof 7d8lYIZrAs2agTmKd78wDnyjg6Okuk8elp0iuxMr00V8erbPPeGhiJoOPIi2ZsEt jnrDtxasxS42afRUHGA8oSa8nEgY9ht4x5WetJXwadzFl3jRHXf9toMhSgY1Lyqh V1KX6lOr3wB5GG39+TR6OWRxnwnBxMN/GY6N+V221siZ+Tst1V+CTvl5bJ/+ODTr K7pQmax9tlmx4t0qfAmiQWHs+D74SHznpYA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeekgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhffkfgfgggtgfesthhqredttderjeenucfhrhhomhepvehlrohm vghnthcunfgrshhsihgvuhhruceotghlvghmvghntheslhgrshhsihgvuhhrrdhorhhgqe enucggtffrrghtthgvrhhnpeegkeehfefftdefffeuveekgfffhfdtudfgudegueegvefg udetffdugfefhfejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegtlhgvmhgvnhhtsehlrghsshhivghurhdrohhrgh X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 20 Oct 2023 08:40:12 -0400 (EDT) From: =?utf-8?Q?Cl=C3=A9ment_Lassieur?= To: Mathieu Othacehe Subject: Re: [bug#66408] [PATCH v5] gnu: icecat: Support Guix packaged extensions and native manifests. In-Reply-To: <87h6mllijc.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 20 Oct 2023 12:01:11 +0200") References: <2ae9c5496838c6644de4c1199e188e44c7171f0f.1697561146.git.clement@lassieur.org> <87h6mllijc.fsf@gnu.org> Date: Fri, 20 Oct 2023 14:40:10 +0200 Message-ID: <87r0lpsc0l.fsf@lassieur.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: Jonathan Brielmaier , 66408@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hey Mathieu, >> + (let* ((id #$(assq-ref properties 'id)) > > id is maybe a bit generic? Done. >> + (firefox (in-vicinity (assoc-ref outputs "firefox"= ) id)) >> + (xpi (assoc-ref outputs "xpi")) >> + (chromium (assoc-ref outputs "chromium"))) >> (install-file "dist/build/uBlock0.firefox.xpi" >> (string-append xpi "/lib/mozilla/extensio= ns")) >> (copy-recursively "dist/build/uBlock0.firefox" firefox) >> @@ -142,3 +146,6 @@ (define ublock-origin >>=20=20 >> (define-public ublock-origin/chromium >> (make-chromium-extension ublock-origin "chromium")) >> + >> +(define-public ublock-origin/icecat >> + (make-icecat-extension ublock-origin "firefox")) > > It does not appear clearly that one has to install ublock-origin-icecat > here. We have the same issue for ublock-origin-chromium though. Indeed! That's a small change that should be in another patch I believe. >> diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packa= ges/patches/icecat-compare-paths.patch >> new file mode 100644 >> index 000000000000..9205899dc0c4 >> --- /dev/null >> +++ b/gnu/packages/patches/icecat-compare-paths.patch > > You could add a small header explaining the content of that patch, ... Done. >> --- /dev/null >> +++ b/gnu/packages/patches/icecat-use-system-wide-dir.patch > > ..., as well as that one. Done. > I tried a guix shell icecat ublock-origin-icecat and it worked perfectly > :) It is also very appreciated to have a pre-built icecat by the QA :). Thanks for the review! Cl=C3=A9ment From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 03:15:08 2023 Received: (at 66408) by debbugs.gnu.org; 23 Oct 2023 07:15:08 +0000 Received: from localhost ([127.0.0.1]:48932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qup9Y-00004s-5L for submit@debbugs.gnu.org; Mon, 23 Oct 2023 03:15:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qup9T-0008Vl-O8 for 66408@debbugs.gnu.org; Mon, 23 Oct 2023 03:15:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qup8t-0006Bq-HN; Mon, 23 Oct 2023 03:14:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=fhS0nUtMFep0BVoUOycfoS5J89zBhb4vh4ybKUSNK4E=; b=e9bgvCimHUcJYdyZ1iko 9ONCeaFNUtE3i7Q8qj6nQCY5Dp4PtU5dxZg7kP/BU8XM0T7E3c9RJjKQniiEwgZ4FQSm4E27bKM/h iqzdMc7hz9PMS9sKEoFWe96UEjBYEjwCOisH3rjTh8xId6OzomZ5TbhhKFed7UrSUc9AZ/RkPq7wQ 5b0d9URTqejdotHX5RZd25b4l6sp2gD2NC2YSJefwquYSrY+4w4fJ3n4vK6u4z5dgV6e2CiRBZkG3 8ydegjc4M05wCcFM59fur2fRdHKaRNzaEyUZqPqeXmmTfs+0iJYb2Ri4CnBKHRjVSNEn0+1Xj4L/3 qp7dGUDv9isJLg==; From: Mathieu Othacehe To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: [bug#66408] [PATCH v5] gnu: icecat: Support Guix packaged extensions and native manifests. In-Reply-To: <87r0lpsc0l.fsf@lassieur.org> (=?utf-8?Q?=22Cl=C3=A9ment?= Lassieur"'s message of "Fri, 20 Oct 2023 14:40:10 +0200") References: <2ae9c5496838c6644de4c1199e188e44c7171f0f.1697561146.git.clement@lassieur.org> <87h6mllijc.fsf@gnu.org> <87r0lpsc0l.fsf@lassieur.org> Date: Mon, 23 Oct 2023 09:14:13 +0200 Message-ID: <87cyx5g69m.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66408 Cc: Jonathan Brielmaier , 66408@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, > Indeed! That's a small change that should be in another patch I > believe. Agreed. I think you can go ahead! Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 03:39:06 2023 Received: (at 66408) by debbugs.gnu.org; 23 Oct 2023 07:39:06 +0000 Received: from localhost ([127.0.0.1]:48942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qupWj-0000sp-Jj for submit@debbugs.gnu.org; Mon, 23 Oct 2023 03:39:06 -0400 Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]:50203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qupWf-0000sG-90 for 66408@debbugs.gnu.org; Mon, 23 Oct 2023 03:39:03 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 007AFC0005; Mon, 23 Oct 2023 07:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1698046705; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RiA/gX1o1hoHqMYXHz8uyKrayddJ/RTHNlAitBIcRr4=; b=APAvMhuYa65jU6fosmCQKaHAO4DN5kMJ/HXNY27bJ16HrinpKM9H/VPx/KMYjKeeGTYWgN GDpAaOxI3kPLZOKBx4AmsF/zzhm/Ifv9/fc4sSAzeTmmjsRoHtaZbL4XKd7/RTCNgO+4Yo rfE7aiON+/e46bgbI7Ja9Qj/Lp7j3S5lNr4mhmu6raLOAlL+9czZw+ZuqV2JlXm+eTez+C 8hAzmTrzVcWsuGsozwTcPcT7ADLHAtVJJhZEEBNkxXjQA7QKU2guzD2QwPsx197PO67AFt FMdOh/HX7wS1k5M1v4auN3pGJbAsN0YX5yh5ftQuh6CQkoZ8v/i/v4j9UiWCRQ== From: Andrew Tropin To: =?utf-8?Q?Cl=C3=A9ment?= Lassieur , 66408@debbugs.gnu.org Subject: Re: [bug#66408] [PATCH v3] gnu: icecat: Add support for Guix packaged extensions. In-Reply-To: <43b86867b651d877c805d7e5963b42319606e0d1.1697027198.git.clement@lassieur.org> References: <43b86867b651d877c805d7e5963b42319606e0d1.1697027198.git.clement@lassieur.org> Date: Mon, 23 Oct 2023 11:37:44 +0400 Message-ID: <87cyx5u6uv.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-GND-Sasl: andrew@trop.in X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408 Cc: Jonathan Brielmaier , =?utf-8?Q?Cl=C3=A9ment?= Lassieur X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-10-11 14:26, Cl=C3=A9ment Lassieur wrote: > * gnu/build/icecat-extension.scm: New file with a MAKE-ICECAT-EXTENSION > procedure that makes sure the add-on directory is a symlink, so that Icec= at > can normalize it into a package store path. > * gnu/local.mk (dist_patch_DATA): Register it, as well as new patches. > * gnu/packages/browser-extensions.scm (ublock-origin)[properties]: Store = the > add-on ID so that it is accessible in MAKE-ICECAT-EXTENSION. > [arguments]: Use the add-on ID as root directory. > (ublock-origin/icecat): New procedure. > * gnu/packages/gnuzilla.scm (icecat-minimal)[arguments]: Rewrite the unus= ed > 'apply-guix-specific-patches' phase so that it applies the following two > patches. > [native-search-paths]: New field. > * gnu/packages/patches/icecat-compare-paths.patch: New patch that compares > add-on paths (which are package store paths) to detect package changes. > * gnu/packages/patches/icecat-use-guix-extensions.patch: New patch that > replaces "/usr/share/mozilla/extensions" with "$ICECAT_EXTENSION_DIR". > --- > gnu/build/icecat-extension.scm | 71 +++++++++++++++++++ > gnu/local.mk | 3 + > gnu/packages/browser-extensions.scm | 13 +++- > gnu/packages/gnuzilla.scm | 22 +++--- > .../patches/icecat-compare-paths.patch | 19 +++++ > .../patches/icecat-use-guix-extensions.patch | 52 ++++++++++++++ > 6 files changed, 167 insertions(+), 13 deletions(-) > create mode 100644 gnu/build/icecat-extension.scm > create mode 100644 gnu/packages/patches/icecat-compare-paths.patch > create mode 100644 gnu/packages/patches/icecat-use-guix-extensions.patch > > diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.= scm > new file mode 100644 > index 000000000000..8ecd8a505f72 > --- /dev/null > +++ b/gnu/build/icecat-extension.scm > @@ -0,0 +1,71 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2020, 2021 Marius Bakke > +;;; Copyright =C2=A9 2023 Cl=C3=A9ment Lassieur > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see . > + > +(define-module (gnu build icecat-extension) > + #:use-module (guix gexp) > + #:use-module (guix packages) > + #:use-module (guix build-system trivial) > + #:export (make-icecat-extension)) > + > +(define* (make-icecat-extension pkg #:optional (pkg-output "out")) > + "Create an Icecat extension from package PKG and return a package that, > +when installed, will make the extension contained in PKG available as an > +Icecat browser extension. PKG-OUTPUT specifies which output of PKG to u= se." > + (package > + (inherit pkg) > + (name (string-append (package-name pkg) "-icecat")) > + (native-inputs '()) > + (inputs '()) > + (propagated-inputs '()) > + (outputs '("out")) > + (build-system trivial-build-system) > + (arguments > + (list > + #:modules '((guix build utils)) > + #:builder > + #~(begin > + (use-modules (guix build utils)) > + (let* ((id #$(assq-ref (package-properties pkg) 'id)) > + (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}") > + (search-dir (string-append #$output > + "/share/icecat/extensions/" > + moz-app-id))) > + ;; Icecat's iterates over `search-dir` for directories. If a > + ;; directory's name is not a valid add-on ID, it is ignored.= See > + ;; `DirectoryLocation::readAddons()` in XPIProvider.jsm. > + > + ;; This directory has to be a symlink, because Icecat's > + ;; `_readLinkFile(aFile)` calls `normalize()` only if `aFile= ` is a > + ;; symlink. > + > + ;; Normalizing is required because Icecat compares the add-o= n path > + ;; against its local database to know if there is an extensi= on > + ;; update. We want the add-on path to be the package store = path, > + ;; so that a path change is detected every time the package = is > + ;; updated. See `updateExistingAddon()` in XPIDatabase.jsm,= with > + ;; our patch `icecat-compare-paths.patch`. > + > + ;; We don't want the add-on path to be the profile store pat= h, > + ;; which would change too often. We don't want the add-on p= ath to > + ;; be hard-coded ("/usr/share/mozilla/extensions") either be= cause > + ;; it would never change. > + > + (mkdir-p search-dir) > + (symlink (in-vicinity (ungexp pkg pkg-output) id) > + (in-vicinity search-dir id)))))))) > diff --git a/gnu/local.mk b/gnu/local.mk > index 9fa52833cbc5..1bf925a57d9e 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -761,6 +761,7 @@ GNU_SYSTEM_MODULES =3D \ > %D%/build/chromium-extension.scm \ > %D%/build/cross-toolchain.scm \ > %D%/build/dbus-service.scm \ > + %D%/build/icecat-extension.scm \ > %D%/build/image.scm \ > %D%/build/jami-service.scm \ > %D%/build/file-systems.scm \ > @@ -1415,6 +1416,8 @@ dist_patch_DATA =3D \ > %D%/packages/patches/icecat-makeicecat.patch \ > %D%/packages/patches/icecat-102-makeicecat.patch \ > %D%/packages/patches/icecat-avoid-bundled-libraries.patch \ > + %D%/packages/patches/icecat-compare-paths.patch \ > + %D%/packages/patches/icecat-use-guix-extensions.patch \ > %D%/packages/patches/icecat-use-system-graphite2+harfbuzz.patch \ > %D%/packages/patches/icecat-use-system-media-libs.patch \ > %D%/packages/patches/icedtea-7-hotspot-aarch64-use-c++98.patch \ > diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-e= xtensions.scm > index 3f6da8d77a3f..8a76f3a3e042 100644 > --- a/gnu/packages/browser-extensions.scm > +++ b/gnu/packages/browser-extensions.scm > @@ -1,6 +1,7 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2020, 2021 Marius Bakke > ;;; Copyright =C2=A9 2023 Nicolas Graves > +;;; Copyright =C2=A9 2023 Cl=C3=A9ment Lassieur > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -25,6 +26,7 @@ (define-module (gnu packages browser-extensions) > #:use-module (guix build-system gnu) > #:use-module ((guix licenses) #:prefix license:) > #:use-module (gnu build chromium-extension) > + #:use-module (gnu build icecat-extension) > #:use-module (gnu packages compression) > #:use-module (gnu packages python)) >=20=20 > @@ -98,6 +100,7 @@ (define ublock-origin > "1i8rnij3sbwg6vj6znprrsca0n5xjzhmhppaa8v6jyxg6wrrfch1"))= )) > (build-system gnu-build-system) > (outputs '("xpi" "firefox" "chromium")) > + (properties '((id . "uBlock0@raymondhill.net"))) > (arguments > (list > #:tests? #f ;no tests > @@ -125,9 +128,10 @@ (define ublock-origin > (invoke "./tools/make-chromium.sh"))) > (add-after 'build-chromium 'install > (lambda* (#:key outputs #:allow-other-keys) > - (let ((firefox (assoc-ref outputs "firefox")) > - (xpi (assoc-ref outputs "xpi")) > - (chromium (assoc-ref outputs "chromium"))) > + (let* ((id #$(assq-ref (package-properties this-package) '= id)) > + (firefox (in-vicinity (assoc-ref outputs "firefox")= id)) > + (xpi (assoc-ref outputs "xpi")) > + (chromium (assoc-ref outputs "chromium"))) > (install-file "dist/build/uBlock0.firefox.xpi" > (string-append xpi "/lib/mozilla/extension= s")) > (copy-recursively "dist/build/uBlock0.firefox" firefox) > @@ -142,3 +146,6 @@ (define ublock-origin >=20=20 > (define-public ublock-origin/chromium > (make-chromium-extension ublock-origin "chromium")) > + > +(define-public ublock-origin/icecat > + (make-icecat-extension ublock-origin "firefox")) > diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm > index a367d7a00ff6..608219c97303 100644 > --- a/gnu/packages/gnuzilla.scm > +++ b/gnu/packages/gnuzilla.scm > @@ -885,16 +885,13 @@ (define-public icecat-minimal > #:phases > #~(modify-phases %standard-phases > (add-after 'unpack 'apply-guix-specific-patches > - (lambda* (#:key inputs native-inputs #:allow-other-keys) > - (let ((patch (search-input-file inputs "bin/patch"))) > - (for-each (match-lambda > - ((label . file) > - (when (and (string-prefix? "icecat-" label) > - (string-suffix? ".patch" label)) > - (format #t "applying '~a'...~%" file) > - (invoke patch "--force" "--no-backup-if-m= ismatch" > - "-p1" "--input" file)))) > - (or native-inputs inputs))))) > + (lambda _ > + (for-each > + (lambda (file) (invoke "patch" "--force" "-p1" "-i" file)) > + '(#$(local-file > + (search-patch "icecat-compare-paths.patch")) > + #$(local-file > + (search-patch "icecat-use-guix-extensions.patch"))))= )) > (add-after 'apply-guix-specific-patches 'remove-bundled-librar= ies > (lambda _ > ;; Remove bundled libraries that we don't use, since they = may > @@ -1138,6 +1135,11 @@ (define-public icecat-minimal > '("default16.png" "default22.png" "default24.png" > "default32.png" "default48.png" "content/icon64.png" > "mozicon128.png" "default256.png")))))))) > + (native-search-paths > + (list (search-path-specification > + (variable "ICECAT_EXTENSION_DIR") > + (separator #f) ;single entry > + (files '("share/icecat/extensions"))))) > (home-page "https://www.gnu.org/software/gnuzilla/") > (synopsis "Entirely free browser derived from Mozilla Firefox") > (description > diff --git a/gnu/packages/patches/icecat-compare-paths.patch b/gnu/packag= es/patches/icecat-compare-paths.patch > new file mode 100644 > index 000000000000..9205899dc0c4 > --- /dev/null > +++ b/gnu/packages/patches/icecat-compare-paths.patch > @@ -0,0 +1,19 @@ > +--- a/toolkit/mozapps/extensions/internal/XPIDatabase.jsm > ++++ b/toolkit/mozapps/extensions/internal/XPIDatabase.jsm > +@@ -3452,6 +3452,7 @@ const XPIDatabaseReconcile =3D { > + if ( > + newAddon || > + oldAddon.updateDate !=3D xpiState.mtime || > ++ oldAddon.path !=3D xpiState.path || > + (aUpdateCompatibility && this.isAppBundledLocation(installLocatio= n)) > + ) { > + newAddon =3D this.updateMetadata( > +@@ -3460,8 +3461,6 @@ const XPIDatabaseReconcile =3D { > + xpiState, > + newAddon > + ); > +- } else if (oldAddon.path !=3D xpiState.path) { > +- newAddon =3D this.updatePath(installLocation, oldAddon, xpiState); > + } else if (aUpdateCompatibility || aSchemaChange) { > + newAddon =3D this.updateCompatibility( > + installLocation, > diff --git a/gnu/packages/patches/icecat-use-guix-extensions.patch b/gnu/= packages/patches/icecat-use-guix-extensions.patch > new file mode 100644 > index 000000000000..f2fe4260c2cd > --- /dev/null > +++ b/gnu/packages/patches/icecat-use-guix-extensions.patch > @@ -0,0 +1,52 @@ > +--- a/toolkit/xre/nsXREDirProvider.cpp > ++++ b/toolkit/xre/nsXREDirProvider.cpp > +@@ -415,13 +415,7 @@ nsXREDirProvider::GetFile(const char* aProperty, bo= ol* aPersistent, > + #if defined(XP_UNIX) && !defined(XP_MACOSX) > + else if (!strcmp(aProperty, XRE_SYS_SHARE_EXTENSION_PARENT_DIR)) { > + # ifdef ENABLE_SYSTEM_EXTENSION_DIRS > +-# if defined(__OpenBSD__) || defined(__FreeBSD__) > +- static const char* const sysLExtDir =3D "/usr/local/share/mozilla/e= xtensions"; > +-# else > +- static const char* const sysLExtDir =3D "/usr/share/mozilla/extensi= ons"; > +-# endif > +- rv =3D NS_NewNativeLocalFile(nsDependentCString(sysLExtDir), false, > +- getter_AddRefs(file)); > ++ rv =3D GetGuixExtensionDir(getter_AddRefs(file)); > + # endif > + } > + #endif // defined(XP_UNIX) && !defined(XP_MACOSX) > +@@ -1198,6 +1192,24 @@ nsresult nsXREDirProvider::SetUserDataProfileDire= ctory(nsCOMPtr& aFile, > + return NS_OK; > + } > +=20 > ++nsresult nsXREDirProvider::GetGuixExtensionDir(nsIFile** aFile) { > ++ nsresult rv; > ++ nsCOMPtr localDir; > ++ > ++#if defined(XP_UNIX) > ++ const char* extensionDir =3D getenv("ICECAT_EXTENSION_DIR"); > ++ if (!extensionDir || !*extensionDir) return NS_ERROR_FAILURE; > ++ > ++ rv =3D NS_NewNativeLocalFile(nsDependentCString(extensionDir), true, > ++ getter_AddRefs(localDir)); > ++#else > ++# error "Don't know how to get product dir on your platform" > ++#endif > ++ > ++ NS_IF_ADDREF(*aFile =3D localDir); > ++ return rv; > ++} > ++ > + nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, > + bool aLocal) { > + // Copied from nsAppFileLocationProvider (more or less) > +--- a/toolkit/xre/nsXREDirProvider.h > ++++ b/toolkit/xre/nsXREDirProvider.h > +@@ -112,6 +112,7 @@ class nsXREDirProvider final : public nsIDirectorySe= rviceProvider2, > + private: > + nsresult GetFilesInternal(const char* aProperty, > + nsISimpleEnumerator** aResult); > ++ static nsresult GetGuixExtensionDir(nsIFile** aFile); > + static nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal= ); > + static nsresult GetSysUserExtensionsDirectory(nsIFile** aFile); > + #if defined(XP_UNIX) || defined(XP_MACOSX) > > base-commit: 9ad9113fc238ee8de5191a5e15b5153fd149e9fa Looks good! =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmU2IsgACgkQIgjSCVjB 3rB8/Q//fbgL8NJ2qhnuT++xfrOMGY5jp0o23n5e4B6rDvNNMbtFxCSGyWPdW+ss 98l8iJUWcApod8NBEgLou9E9tLoYQGSc73kbpqYt72OFJAHpp0rZDKsNFsoWha0C ctNkuLdJLu2tG7eOLa9xwJO9lzIzkcDTwwrn7fkvZYNFVB9hiI8vyxpNW9lJucpI dinarw+/hYMPvkW1LN0bmMyQLXhc2I2lSGBXhWDImNYXJK41H5TZOTTNALtgASUq PDN09AddO6pHAoZ6dJNs1aAq/4ToT2TRu5UM3ihQqY/lvhwcs8/a2TZJ7sJM4SiS HkjyTj9WCFl4yWqmObPqgCmZejVHHGGZVOwbkisN06gObjg7No9Uyi71KR3+uH1U mofMb/G1F4qFLik8Iy1Sjw54XfebdftapJX0ULs+qvmAFPy8t27LiKsWRWEr4DXg Kifr3fRPtw+WtfhN8Bv5O/KvcT2nuo5RWJ/EzG4KM82BB9wVhseDeaY8oy9gmaEO msI3JxwEJ+xMDRnhmEG+1ZWLFA6GIWoOpQ2KqaXdleAkMsGx1Il20dqPY2yNz47s EH+BNXUdCtf5V8iycZ4C6QUT+d5HuicumVBkwADtp3Y4zqXWdNE8bg9wtxG4vf1D AYo+vSpaH8fftMqP7x3lIf2J1AAN42iR8W1ynCGZ6BksMsGu3tc= =8FqG -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 23 05:56:05 2023 Received: (at 66408-done) by debbugs.gnu.org; 23 Oct 2023 09:56:06 +0000 Received: from localhost ([127.0.0.1]:49082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qurfJ-0005Mz-K6 for submit@debbugs.gnu.org; Mon, 23 Oct 2023 05:56:05 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:50153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qurfH-0005MV-GY for 66408-done@debbugs.gnu.org; Mon, 23 Oct 2023 05:56:04 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6E4A35C023B; Mon, 23 Oct 2023 05:55:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 23 Oct 2023 05:55:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lassieur.org; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1698054929; x=1698141329; bh=4g qVzu5QuFXlQkUMe+Cz433oa4Y1qE5I3NXp7zOsPlU=; b=RiS8OG7XpZfiVFP9TI mGRY73DZFHLcgHEj6afWB58JjxXIqsras9Anm1aN4W7+5id9tPQL8+R0DHL5UEva KhoOc872poULXUcQ1iHdwyVcgdJx6HpsfJBUM292jM3HAQr2FnyIaBYIBoo4ljZ/ 43TjnipiORliG4GHFDmzbsBLK2YVykIWPrduwxFS5+4hsubg6L8yj/QS271EjKtc xMoJacMAcwdPZqiC99cBgDiw+Cmu8lAR3qomz5GOOBxlIuo+wGuzT8lDwdAUaB6d aHHCuBYgrYqw/mzpyGRcjBW03Mo4pDhMhrNASL+1XJMkXjrztF3SNFe+YKEEjufp rFbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698054929; x=1698141329; bh=4gqVzu5QuFXlQ kUMe+Cz433oa4Y1qE5I3NXp7zOsPlU=; b=KnXqPRHoF7/eNr1lMkfRqVDBye9BX ieUn0USWnW+J5TMuE2DTxVhEiFhJ7Ra3SJMHIXvxVRCAlsU7MngHbGfVDMf97yFh +KBUue0EbXt2IxqXdr1coAeZNwQfGUhRi/tyBtjLVrGcIThQoj4KKcfpRdSaFbEF vAu5YqQSpz6fUhWdQWWMJ4tBEJFP48tW6Nl8pvXdKLgifxcvm9/TJ+tg/WSJgDmy GcblSTzmolhdFeeH8kbYrYuDv7CR3jHVPPYsjZ1hVia995Zmofuk2dR1xgMdSDbu 1g92kQp9UGjWkwU40W2Lf5V6yYzIdeTBj7qhwCgjWOFcu18M5R/OlzYIA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeeigddvtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufgjfhffkfgfgggtsehttdertddtreejnecuhfhrohhmpeevlhormhgv nhhtucfnrghsshhivghurhcuoegtlhgvmhgvnhhtsehlrghsshhivghurhdrohhrgheqne cuggftrfgrthhtvghrnhepveejleejhfeltdehudekjefhkeeugfelgfdtvdduteevleej keduvedthfdtgfffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheptghlvghmvghntheslhgrshhsihgvuhhrrdhorhhg X-ME-Proxy: Feedback-ID: i4c21472a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 23 Oct 2023 05:55:28 -0400 (EDT) From: =?utf-8?Q?Cl=C3=A9ment_Lassieur?= To: Mathieu Othacehe , Andrew Tropin Subject: Re: [bug#66408] [PATCH v5] gnu: icecat: Support Guix packaged extensions and native manifests. In-Reply-To: <87cyx5g69m.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 23 Oct 2023 09:14:13 +0200") References: <2ae9c5496838c6644de4c1199e188e44c7171f0f.1697561146.git.clement@lassieur.org> <87h6mllijc.fsf@gnu.org> <87r0lpsc0l.fsf@lassieur.org> <87cyx5g69m.fsf@gnu.org> Date: Mon, 23 Oct 2023 11:55:23 +0200 Message-ID: <87cyx5u0hg.fsf@lassieur.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 66408-done Cc: 66408-done@debbugs.gnu.org, Jonathan Brielmaier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Andrew Tropin writes: > Looks good! Mathieu Othacehe writes: > Hello, > >> Indeed! That's a small change that should be in another patch I >> believe. > > Agreed. I think you can go ahead! > > Thanks, > > Mathieu Pushed as 25043e01b6cb6696ffdc6cdedd9cdf8235bb695c, thanks! From unknown Sun Jun 22 03:52:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Nov 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator