GNU bug report logs - #68298
[PATCH 0/2] Add output in ‘make-icecat-extension’ for each Firefox variant.

Previous Next

Package: guix-patches;

Reported by: Clément Lassieur <clement <at> lassieur.org>

Date: Sun, 7 Jan 2024 00:03:02 UTC

Severity: normal

Tags: patch, wontfix

Done: Clément Lassieur <clement <at> lassieur.org>

Bug is archived. No further changes may be made.

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

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

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


Report forwarded to clement <at> lassieur.org, jonathan.brielmaier <at> web.de, guix-patches <at> gnu.org:
bug#68298; Package guix-patches. (Sun, 07 Jan 2024 00:03:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Clément Lassieur <clement <at> lassieur.org>:
New bug report received and forwarded. Copy sent to clement <at> lassieur.org, jonathan.brielmaier <at> web.de, guix-patches <at> gnu.org. (Sun, 07 Jan 2024 00:03:02 GMT) Full text and rfc822 format available.

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

From: Clément Lassieur <clement <at> lassieur.org>
To: guix-patches <at> gnu.org
Cc: Clément Lassieur <clement <at> lassieur.org>
Subject: [PATCH 0/2] Add output in ‘make-icecat-extension’ for each Firefox variant.
Date: Sun,  7 Jan 2024 01:02:14 +0100
Hi, this patch allows to install extensions specifically for icecat, or for
torbrowser.  One can test it like this:

guix shell --no-cwd -E DISPLAY -CNF \
    icecat ublock-origin-icecat -- icecat                   # ublock
guix shell --no-cwd -E DISPLAY -CNF \
    icecat ublock-origin-icecat:icecat -- icecat            # ublock
guix shell --no-cwd -E DISPLAY -CNF \
    icecat ublock-origin-icecat:torbrowser -- icecat        # no ublock
guix shell --no-cwd -E DISPLAY -CNF \
    torbrowser ublock-origin-icecat:icecat -- torbrowser    # no ublock

Clément Lassieur (2):
  gnu: Move comment in ‘make-icecat-extension’.
  gnu: Add output in ‘make-icecat-extension’ for each Firefox variant.

 gnu/build/icecat-extension.scm | 60 ++++++++++++++++++++--------------
 gnu/packages/tor.scm           | 11 ++++++-
 2 files changed, 45 insertions(+), 26 deletions(-)


base-commit: be1d05c10766a979dd0720b677889ed950d3b895
-- 
2.41.0





Information forwarded to clement <at> lassieur.org, jonathan.brielmaier <at> web.de, guix-patches <at> gnu.org:
bug#68298; Package guix-patches. (Sun, 07 Jan 2024 00:06:01 GMT) Full text and rfc822 format available.

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

From: Clément Lassieur <clement <at> lassieur.org>
To: 68298 <at> debbugs.gnu.org
Cc: Clément Lassieur <clement <at> lassieur.org>
Subject: [PATCH 1/2] gnu: Move comment in ‘make-icecat-extension’.
Date: Sun,  7 Jan 2024 01:05:15 +0100
* gnu/build/icecat-extension.scm (make-icecat-extension)[arguments]: Move
comment so that next commit there is more readable.

Change-Id: I70009d1e928b3f394be25467b090ef9aab6bf1d1
---
 gnu/build/icecat-extension.scm | 38 +++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm
index e6927c79df19..9013ab0fac05 100644
--- a/gnu/build/icecat-extension.scm
+++ b/gnu/build/icecat-extension.scm
@@ -42,29 +42,29 @@ (define* (make-icecat-extension pkg #:optional (pkg-output "out"))
       #:builder
       #~(begin
           (use-modules (guix build utils))
+          ;; 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).
           (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)
-- 
2.41.0





Information forwarded to clement <at> lassieur.org, jonathan.brielmaier <at> web.de, guix-patches <at> gnu.org:
bug#68298; Package guix-patches. (Sun, 07 Jan 2024 00:06:02 GMT) Full text and rfc822 format available.

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

From: Clément Lassieur <clement <at> lassieur.org>
To: 68298 <at> debbugs.gnu.org
Cc: Clément Lassieur <clement <at> lassieur.org>
Subject: [PATCH 2/2] gnu: Add output in ‘make-icecat-extension’ for each Firefox variant.
Date: Sun,  7 Jan 2024 01:05:16 +0100
* gnu/build/icecat-extension.scm (make-icecat-extension)[arguments]: Loop
through all variants and for each variant, symlink the add-on there, and in
the main output too.
* gnu/packages/tor.scm (torbrowser)[arguments]: Add a 'fix-system-dir' phase
so that the system directory is not shared between variants.
[propagated-inputs]: Propagate only the "torbrowser" output of
noscript/icecat.
[native-search-paths]: Use TORBROWSER_SYSTEM_DIR instead of inheriting from
the icecat package.

Change-Id: I409bae5c317e98d1bd308eb64a66f1ce1a304bcc
---
 gnu/build/icecat-extension.scm | 28 +++++++++++++++++++---------
 gnu/packages/tor.scm           | 11 ++++++++++-
 2 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm
index 9013ab0fac05..b5d44e3b5559 100644
--- a/gnu/build/icecat-extension.scm
+++ b/gnu/build/icecat-extension.scm
@@ -34,7 +34,7 @@ (define* (make-icecat-extension pkg #:optional (pkg-output "out"))
     (native-inputs '())
     (inputs '())
     (propagated-inputs (package-propagated-inputs pkg))
-    (outputs '("out"))
+    (outputs '("out" "icecat" "torbrowser"))
     (build-system trivial-build-system)
     (arguments
      (list
@@ -61,11 +61,21 @@ (define* (make-icecat-extension pkg #:optional (pkg-output "out"))
           ;; 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).
-          (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)))
-
-            (mkdir-p search-dir)
-            (symlink (in-vicinity (ungexp pkg pkg-output) addon-id)
-                     (in-vicinity search-dir addon-id))))))))
+          (for-each
+           (lambda (variant)
+             (let* ((addon-id #$(assq-ref (package-properties pkg) 'addon-id))
+                    (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
+                    (search-dir
+                     (lambda (out)
+                       (string-append (assoc-ref %outputs out) "/lib/" variant
+                                      "/extensions/" moz-app-id)))
+                    (symlink-addon
+                     (lambda (out)
+                       (mkdir-p (search-dir out))
+                       (symlink (in-vicinity (ungexp pkg pkg-output) addon-id)
+                                (in-vicinity (search-dir out) addon-id)))))
+               (symlink-addon variant)
+               ;; Symlink to the main output so that a user can install the
+               ;; add-on for all of the Firefox variants at once.
+               (symlink-addon "out")))
+           (cdr '#$outputs)))))))
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index b81944ee6b96..c46f48a808da 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -563,6 +563,10 @@ (define-public torbrowser
            #$flags))
        ((#:phases phases)
         #~(modify-phases #$phases
+            (add-after 'apply-guix-specific-patches 'fix-system-dir
+              (lambda _
+                (substitute* "toolkit/xre/nsXREDirProvider.cpp"
+                  (("ICECAT_SYSTEM_DIR") "TORBROWSER_SYSTEM_DIR"))))
             (add-before 'configure 'setenv
               (lambda _
                 (setenv "CONFIG_SHELL" (which "bash"))
@@ -758,7 +762,12 @@ (define-public torbrowser
                tor-client
                torbrowser-assets)))
     (propagated-inputs
-     (list noscript/icecat))
+     (list `(,noscript/icecat "torbrowser")))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "TORBROWSER_SYSTEM_DIR")
+            (separator #f)              ;single entry
+            (files '("lib/torbrowser")))))
     (home-page "https://www.torproject.org")
     (synopsis "Anonymous browser derived from Mozilla Firefox")
     (description
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#68298; Package guix-patches. (Sun, 07 Jan 2024 00:14:02 GMT) Full text and rfc822 format available.

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

From: Clément Lassieur <clement <at> lassieur.org>
To: 68298 <at> debbugs.gnu.org
Cc: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Subject: Re: [bug#68298] [PATCH 2/2] gnu: Add output in
 ‘make-icecat-extension’ for each Firefox
 variant.
Date: Sun, 07 Jan 2024 01:12:56 +0100
On Sun, Jan 07 2024, Clément Lassieur wrote:

> * gnu/build/icecat-extension.scm (make-icecat-extension)[arguments]: Loop
> through all variants and for each variant, symlink the add-on there, and in
> the main output too.
> * gnu/packages/tor.scm (torbrowser)[arguments]: Add a 'fix-system-dir' phase
> so that the system directory is not shared between variants.
> [propagated-inputs]: Propagate only the "torbrowser" output of
> noscript/icecat.
> [native-search-paths]: Use TORBROWSER_SYSTEM_DIR instead of inheriting from
> the icecat package.

I forgot

    [outputs]: Add "icecat" and "torbrowser".


Also, the first patch is just so that the second is clearer.




Reply sent to Clément Lassieur <clement <at> lassieur.org>:
You have taken responsibility. (Fri, 12 Jan 2024 17:55:01 GMT) Full text and rfc822 format available.

Notification sent to Clément Lassieur <clement <at> lassieur.org>:
bug acknowledged by developer. (Fri, 12 Jan 2024 17:55:02 GMT) Full text and rfc822 format available.

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

From: Clément Lassieur <clement <at> lassieur.org>
To: 68298-done <at> debbugs.gnu.org
Cc: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Subject: Re: [bug#68298] [PATCH 2/2] gnu: Add output in
 ‘make-icecat-extension’ for each Firefox
 variant.
Date: Fri, 12 Jan 2024 18:54:30 +0100
I no longer think this is a good idea because
- it adds a lot of complexity
- extensions are disabled by default on Tor Browser
- if one wants to run Tor Browser with a specific set of extensions,
  they can still use 'guix shell'.

Closing as wontfix.

On Sun, Jan 07 2024, Clément Lassieur wrote:

> * gnu/build/icecat-extension.scm (make-icecat-extension)[arguments]: Loop
> through all variants and for each variant, symlink the add-on there, and in
> the main output too.
> * gnu/packages/tor.scm (torbrowser)[arguments]: Add a 'fix-system-dir' phase
> so that the system directory is not shared between variants.
> [propagated-inputs]: Propagate only the "torbrowser" output of
> noscript/icecat.
> [native-search-paths]: Use TORBROWSER_SYSTEM_DIR instead of inheriting from
> the icecat package.
>
> Change-Id: I409bae5c317e98d1bd308eb64a66f1ce1a304bcc
> ---
>  gnu/build/icecat-extension.scm | 28 +++++++++++++++++++---------
>  gnu/packages/tor.scm           | 11 ++++++++++-
>  2 files changed, 29 insertions(+), 10 deletions(-)
>
> diff --git a/gnu/build/icecat-extension.scm b/gnu/build/icecat-extension.scm
> index 9013ab0fac05..b5d44e3b5559 100644
> --- a/gnu/build/icecat-extension.scm
> +++ b/gnu/build/icecat-extension.scm
> @@ -34,7 +34,7 @@ (define* (make-icecat-extension pkg #:optional (pkg-output "out"))
>      (native-inputs '())
>      (inputs '())
>      (propagated-inputs (package-propagated-inputs pkg))
> -    (outputs '("out"))
> +    (outputs '("out" "icecat" "torbrowser"))
>      (build-system trivial-build-system)
>      (arguments
>       (list
> @@ -61,11 +61,21 @@ (define* (make-icecat-extension pkg #:optional (pkg-output "out"))
>            ;; 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).
> -          (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)))
> -
> -            (mkdir-p search-dir)
> -            (symlink (in-vicinity (ungexp pkg pkg-output) addon-id)
> -                     (in-vicinity search-dir addon-id))))))))
> +          (for-each
> +           (lambda (variant)
> +             (let* ((addon-id #$(assq-ref (package-properties pkg) 'addon-id))
> +                    (moz-app-id "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}")
> +                    (search-dir
> +                     (lambda (out)
> +                       (string-append (assoc-ref %outputs out) "/lib/" variant
> +                                      "/extensions/" moz-app-id)))
> +                    (symlink-addon
> +                     (lambda (out)
> +                       (mkdir-p (search-dir out))
> +                       (symlink (in-vicinity (ungexp pkg pkg-output) addon-id)
> +                                (in-vicinity (search-dir out) addon-id)))))
> +               (symlink-addon variant)
> +               ;; Symlink to the main output so that a user can install the
> +               ;; add-on for all of the Firefox variants at once.
> +               (symlink-addon "out")))
> +           (cdr '#$outputs)))))))
> diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
> index b81944ee6b96..c46f48a808da 100644
> --- a/gnu/packages/tor.scm
> +++ b/gnu/packages/tor.scm
> @@ -563,6 +563,10 @@ (define-public torbrowser
>             #$flags))
>         ((#:phases phases)
>          #~(modify-phases #$phases
> +            (add-after 'apply-guix-specific-patches 'fix-system-dir
> +              (lambda _
> +                (substitute* "toolkit/xre/nsXREDirProvider.cpp"
> +                  (("ICECAT_SYSTEM_DIR") "TORBROWSER_SYSTEM_DIR"))))
>              (add-before 'configure 'setenv
>                (lambda _
>                  (setenv "CONFIG_SHELL" (which "bash"))
> @@ -758,7 +762,12 @@ (define-public torbrowser
>                 tor-client
>                 torbrowser-assets)))
>      (propagated-inputs
> -     (list noscript/icecat))
> +     (list `(,noscript/icecat "torbrowser")))
> +    (native-search-paths
> +     (list (search-path-specification
> +            (variable "TORBROWSER_SYSTEM_DIR")
> +            (separator #f)              ;single entry
> +            (files '("lib/torbrowser")))))
>      (home-page "https://www.torproject.org")
>      (synopsis "Anonymous browser derived from Mozilla Firefox")
>      (description




Added tag(s) wontfix. Request was from Clément Lassieur <clement <at> lassieur.org> to control <at> debbugs.gnu.org. (Fri, 12 Jan 2024 17:56:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 10 Feb 2024 12:24:22 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 223 days ago.

Previous Next


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