GNU bug report logs - #67878
[PATCH] Adding Privacy Badger

Previous Next

Package: guix-patches;

Reported by: outlook user <RACP <at> outlook.fr>

Date: Mon, 18 Dec 2023 15:01:01 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 67878 AT debbugs.gnu.org.

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

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


Report forwarded to guix-patches <at> gnu.org:
bug#67878; Package guix-patches. (Mon, 18 Dec 2023 15:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to outlook user <RACP <at> outlook.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 18 Dec 2023 15:01:02 GMT) Full text and rfc822 format available.

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

From: outlook user <RACP <at> outlook.fr>
To: "guix-patches <at> gnu.org" <guix-patches <at> gnu.org>
Subject: [PATCH] Adding Privacy Badger
Date: Mon, 18 Dec 2023 12:32:40 +0000
From a5164360d62cbf67dc9c60ebae23f6f1ccbd1e52 Mon Sep 17 00:00:00 2001
From: nobody <no <at> body.org>
Date: Mon, 18 Dec 2023 13:14:19 +0100
Subject: [PATCH] Adding Privacy Badger

---
 browser-extensions.scm | 69 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 68 insertions(+), 1 deletion(-)

diff --git a/browser-extensions.scm b/browser-extensions.scm
index 5a6ee7c..9783ed3 100644
--- a/browser-extensions.scm
+++ b/browser-extensions.scm
@@ -220,4 +220,71 @@ fill and submit login forms if a matching password entry is found.")
     (license license:gpl2+)))
 
 (define-public passff/icecat
-  (make-icecat-extension passff))
\ No newline at end of file
+  (make-icecat-extension passff))
+
+(define-public privacy-badger/chromium
+  (let* ((name "privacy-badger")
+         (version "PUT_THE_CURRENT_VERSION_HERE")
+         (output "out")
+         (url-chromium "https://www.eff.org/files/privacy_badger-chrome.crx"))
+    (package
+      (name name)
+      (version version)
+      (source (origin
+                (method url-fetch)
+                (uri url-chromium)
+                (sha256
+                 (base32
+                  "PUT_THE_SHA256_HASH_HERE"))))
+      (build-system trivial-build-system)
+      (arguments '(#:modules ((guix build utils))
+                     #:builder
+                     (begin
+                       (use-modules (guix build utils))
+                       (let* ((output (assoc-ref %outputs "out"))
+                              (share (string-append output "/share/chrome/extensions/xxxxxx")) ; replace "xxxxxx" with the actual extension ID
+                              (source (assoc-ref %build-inputs "source")))
+                         (mkdir-p share)
+                         (copy-file source (string-append share "/privacy_badger.crx"))))))
+      (home-page "https://privacybadger.org/")
+      (synopsis "Privacy tool from the Electronic Frontier Foundation")
+      (description "Privacy Badger is a browser add-on that stops advertisers and other third-party trackers
+                  from secretly tracking where you go and what pages you look at on the web. ")
+      (license license:gpl3+))))
+
+(define-public privacy-badger/icecat
+  (let* ((name "privacy-badger")
+         (version "PUT_THE_CURRENT_VERSION_HERE")
+         (url-icecat "https://www.eff.org/files/privacy-badger-latest.xpi"))
+    (package
+      (name name)
+      (version version)
+      (source (origin
+                (method url-fetch)
+                (uri url-icecat)
+                (sha256
+                 (base32
+                  "PUT_THE_SHA256_HASH_HERE"))))
+      (build-system trivial-build-system)
+      (arguments `(;; Standard arguments.
+                   #:modules ((guix build utils))
+                   #:builder
+                   (begin
+                     ;; Return the extension's ID based on its manifest file.
+                     (use-modules (guix build utils) (ice-9 json))
+                     (let* ((output (assoc-ref %outputs "out"))
+                            (profile (string-append output "/share/icecat/extensions"))
+                            (source (assoc-ref %build-inputs "source"))
+                            (manifest (call-with-input-file (string-append source "/manifest.json")
+                                            json->scm))
+                            (id (alist-ref 'applications (alist-ref 'browser_specific_settings manifest))))
+    
+                       ;; Copy the source to the output directory under the appropriate
+                       ;; extension ID.
+                       (mkdir-p profile)
+                       (copy-recursively source (string-append profile "/" id))))))))
+      (home-page "https://privacybadger.org/")
+      (synopsis "Privacy tool from the Electronic Frontier Foundation")
+      (description "Privacy Badger is a browser add-on that stops advertisers and other third-party trackers
+                  from secretly tracking where you go and what pages you look at on the web. ")
+      (license license:gpl3+))))
\ No newline at end of file
--
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#67878; Package guix-patches. (Sat, 13 Jan 2024 10:53:02 GMT) Full text and rfc822 format available.

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

From: Clément Lassieur <clement <at> lassieur.org>
To: outlook user <RACP <at> outlook.fr>
Cc: 67878 <at> debbugs.gnu.org
Subject: Re: [bug#67878] [PATCH] Adding Privacy Badger
Date: Sat, 13 Jan 2024 11:52:42 +0100
Hi,

Thanks for this patch!

On Mon, Dec 18 2023, outlook user wrote:

> +(define-public privacy-badger/chromium
> +  (let* ((name "privacy-badger")
> +         (version "PUT_THE_CURRENT_VERSION_HERE")

Could you write a package with the last version, and test this version?

> +         (output "out")
> +         (url-chromium "https://www.eff.org/files/privacy_badger-chrome.crx"))
> +    (package
> +      (name name)
> +      (version version)
> +      (source (origin
> +                (method url-fetch)
> +                (uri url-chromium)
> +                (sha256
> +                 (base32
> +                  "PUT_THE_SHA256_HASH_HERE"))))
> +      (build-system trivial-build-system)
> +      (arguments '(#:modules ((guix build utils))
> +                     #:builder
> +                     (begin
> +                       (use-modules (guix build utils))
> +                       (let* ((output (assoc-ref %outputs "out"))
> +                              (share (string-append output "/share/chrome/extensions/xxxxxx")) ; replace "xxxxxx" with the actual extension ID

Why don't you write the extension id?

> +                              (source (assoc-ref %build-inputs "source")))
> +                         (mkdir-p share)
> +                         (copy-file source (string-append share "/privacy_badger.crx"))))))
> +      (home-page "https://privacybadger.org/")
> +      (synopsis "Privacy tool from the Electronic Frontier Foundation")
> +      (description "Privacy Badger is a browser add-on that stops advertisers and other third-party trackers
> +                  from secretly tracking where you go and what pages you look at on the web. ")
> +      (license license:gpl3+))))
> +
> +(define-public privacy-badger/icecat
> +  (let* ((name "privacy-badger")
> +         (version "PUT_THE_CURRENT_VERSION_HERE")
> +         (url-icecat "https://www.eff.org/files/privacy-badger-latest.xpi"))
> +    (package
> +      (name name)
> +      (version version)
> +      (source (origin
> +                (method url-fetch)
> +                (uri url-icecat)
> +                (sha256
> +                 (base32
> +                  "PUT_THE_SHA256_HASH_HERE"))))
> +      (build-system trivial-build-system)
> +      (arguments `(;; Standard arguments.
> +                   #:modules ((guix build utils))
> +                   #:builder
> +                   (begin
> +                     ;; Return the extension's ID based on its manifest file.
> +                     (use-modules (guix build utils) (ice-9 json))
> +                     (let* ((output (assoc-ref %outputs "out"))
> +                            (profile (string-append output "/share/icecat/extensions"))
> +                            (source (assoc-ref %build-inputs "source"))
> +                            (manifest (call-with-input-file (string-append source "/manifest.json")
> +                                            json->scm))
> +                            (id (alist-ref 'applications (alist-ref 'browser_specific_settings manifest))))

This part might be useful in icecat-extension.scm, but for now, here,
it's best to just write the id.

> +    
> +                       ;; Copy the source to the output directory under the appropriate
> +                       ;; extension ID.
> +                       (mkdir-p profile)
> +                       (copy-recursively source (string-append profile "/" id))))))))
> +      (home-page "https://privacybadger.org/")
> +      (synopsis "Privacy tool from the Electronic Frontier Foundation")
> +      (description "Privacy Badger is a browser add-on that stops advertisers and other third-party trackers
> +                  from secretly tracking where you go and what pages you look at on the web. ")
> +      (license license:gpl3+))))
> \ No newline at end of file
> --
> 2.41.0

Can you write an updated patch?  And could you please send it in a way
that makes it easy for us to apply?  Like with git send-email or as an
attachment.

Thanks,
Clément

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

Previous Next


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