[PATCH] gnu: Add tosdr-chromium.

  • Open
  • quality assurance status badge
Details
3 participants
  • Sarah Morgensen
  • Justin Veilleux
  • Maxime Devos
Owner
unassigned
Submitted by
Justin Veilleux
Severity
normal
Merged with
J
J
Justin Veilleux wrote on 15 Jul 2021 20:06
(address . bug-guix@gnu.org)
CAJppLC8TJTzf157uLQc5C3wOJvq6XRxRG_TDPdppqOGw6krkpw@mail.gmail.com
this patch adds the tos;dr initiative's extension
Attachment: file
From c6881b9b065cf2a85b604c8a1e5ddbae77822034 Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Thu, 15 Jul 2021 14:03:19 -0400
Subject: [PATCH] gnu: Add tosdr-chromium.

* gnu/packages/browser-extensions.scm (tosdr, tosdr-chromium): New variables.
---
gnu/packages/browser-extensions.scm | 50 ++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)

Toggle diff (76 lines)
diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm
index a6120baf96..7a1a5bda69 100644
--- a/gnu/packages/browser-extensions.scm
+++ b/gnu/packages/browser-extensions.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -21,10 +22,14 @@
#:use-module (guix git-download)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu build chromium-extension)
#:use-module (gnu packages compression)
- #:use-module (gnu packages python))
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
+ #:use-module (gnu packages node))
(define play-to-kodi
(package
@@ -121,3 +126,46 @@ ungoogled-chromium.")
(define-public ublock-origin/chromium
(make-chromium-extension ublock-origin "chromium"))
+
+(define tosdr
+ (package
+ (name "tosdr")
+ (version "4.1.1")
+ (source
+ (origin
+ (uri
+ (git-reference
+ (url "https://github.com/tosdr/browser-extensions.git")
+ (commit version)))
+ (sha256
+ (base32 "0wz31f9rz087yw1a7cdhdgqvgnhbk569jywv846n122m4bpk3yw0"))
+ (method git-fetch)))
+ (inputs
+ `(("bash" ,bash)
+ ("coreutils" ,coreutils)
+ ("node" ,node)
+ ("zip" ,zip)
+ ("unzip" ,unzip)))
+ (arguments
+ `(#:builder
+ (begin
+ (use-modules (guix build utils))
+ (set-path-environment-variable "PATH"
+ '("bin")
+ (map cdr %build-inputs))
+ (copy-recursively (assoc-ref %build-inputs "source") ".")
+ (invoke "sh" "./build.sh")
+ (invoke "unzip" "dist/chrome.zip" "-d" %output)
+ #t)
+ #:modules ((guix build utils))))
+ (build-system trivial-build-system)
+ (synopsis "extension to inform of the important aspects of the terms and
+conditions of a web service")
+ (description "This extension informs you instantly of your rights online by
+showing an unintrusive icon in the toolbar. You can click on this icon to get
+summaries from the Terms of Service; Didn't Read initiative.")
+ (license license:agpl3)
+ (home-page "https://tosdr.org/")))
+
+(define-public tosdr-chromium
+ (make-chromium-extension tosdr))
--
2.32.0
S
S
Sarah Morgensen wrote on 25 Jul 2021 03:24
(name . Justin Veilleux)(address . justun1011@gmail.com)(address . 49582@debbugs.gnu.org)
86k0lfp4ma.fsf@mgsn.dev
Hi,

Apologies, I didn't see this patch when I sent my previous reply.

This patch applies and builds, but the bulk of my previous suggestions
remain.

Justin Veilleux <justun1011@gmail.com> writes:

Toggle quote (71 lines)
> this patch adds the tos;dr initiative's extension
>
> From c6881b9b065cf2a85b604c8a1e5ddbae77822034 Mon Sep 17 00:00:00 2001
> From: terramorpha <terramorpha@cock.li>
> Date: Thu, 15 Jul 2021 14:03:19 -0400
> Subject: [PATCH] gnu: Add tosdr-chromium.
>
> * gnu/packages/browser-extensions.scm (tosdr, tosdr-chromium): New variables.
> ---
> gnu/packages/browser-extensions.scm | 50 ++++++++++++++++++++++++++++-
> 1 file changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm
> index a6120baf96..7a1a5bda69 100644
> --- a/gnu/packages/browser-extensions.scm
> +++ b/gnu/packages/browser-extensions.scm
> @@ -1,5 +1,6 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
> +;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -21,10 +22,14 @@
> #:use-module (guix git-download)
> #:use-module (guix build-system copy)
> #:use-module (guix build-system gnu)
> + #:use-module (guix build-system trivial)
> #:use-module ((guix licenses) #:prefix license:)
> #:use-module (gnu build chromium-extension)
> #:use-module (gnu packages compression)
> - #:use-module (gnu packages python))
> + #:use-module (gnu packages python)
> + #:use-module (gnu packages base)
> + #:use-module (gnu packages bash)
> + #:use-module (gnu packages node))
>
> (define play-to-kodi
> (package
> @@ -121,3 +126,46 @@ ungoogled-chromium.")
>
> (define-public ublock-origin/chromium
> (make-chromium-extension ublock-origin "chromium"))
> +
> +(define tosdr
> + (package
> + (name "tosdr")
> + (version "4.1.1")
> + (source
> + (origin
> + (uri
> + (git-reference
> + (url "https://github.com/tosdr/browser-extensions.git")
> + (commit version)))
> + (sha256
> + (base32 "0wz31f9rz087yw1a7cdhdgqvgnhbk569jywv846n122m4bpk3yw0"))
> + (method git-fetch)))
> + (inputs
> + `(("bash" ,bash)
> + ("coreutils" ,coreutils)
> + ("node" ,node)
> + ("zip" ,zip)
> + ("unzip" ,unzip)))
> + (arguments
> + `(#:builder
> + (begin
> + (use-modules (guix build utils))
> + (set-path-environment-variable "PATH"
> + '("bin")
> + (map cdr %build-inputs))

Also, these should be spaces, not tabs.

Toggle quote (17 lines)
> + (copy-recursively (assoc-ref %build-inputs "source") ".")
> + (invoke "sh" "./build.sh")
> + (invoke "unzip" "dist/chrome.zip" "-d" %output)
> + #t)
> + #:modules ((guix build utils))))
> + (build-system trivial-build-system)
> + (synopsis "extension to inform of the important aspects of the terms and
> +conditions of a web service")
> + (description "This extension informs you instantly of your rights online by
> +showing an unintrusive icon in the toolbar. You can click on this icon to get
> +summaries from the Terms of Service; Didn't Read initiative.")
> + (license license:agpl3)
> + (home-page "https://tosdr.org/")))
> +
> +(define-public tosdr-chromium
> + (make-chromium-extension tosdr))

--
Sarah
S
S
Sarah Morgensen wrote on 25 Jul 2021 04:32
control message for bug #49499
(address . control@debbugs.gnu.org)
86fsw3p1h4.fsf@mgsn.dev
reassign 49582 guix-patches
merge 49499 49582
thanks
M
M
Maxime Devos wrote on 25 Jul 2021 17:40
Re: bug#49582: [PATCH] gnu: Add tosdr-chromium.
f9d6d4cfc22d9ab7b857eccd1e308d8b9f4d0216.camel@telenet.be
Justin Veilleux schreef op do 15-07-2021 om 14:06 [-0400]:
Toggle quote (4 lines)
> + (inputs
> + `(("bash" ,bash)
> + ("coreutils" ,coreutils)

Would "coreutils-minimal" and "bash-minimal" suffice?
Or, more minimalistic,

(parameterize ((%current-target-system #f))
`(("bash" ,(canonical-package "bash")
("coreutils" ,(canonical-package "bash"))))

Or, more simply, let the inputs be (standard-packages).

Toggle quote (4 lines)
> + ("node" ,node)
> + ("zip" ,zip)
> + ("unzip" ,unzip)))

These should probably be 'native-inputs' and not 'inputs'
for cross-compilation reasons. Try
"./pre-inst-env guix build tosdr-chromium --target=aarch64-linux-gnu"
without transparant QEMU emulation, I think it will fail if these
inputs are in 'inputs' and not 'native-inputs'.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYP2F2BccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rUfAP9ukCMY1O5gM58xQuIYov2h0q4e
9tCBRmHXHRwiibNkkgEA0PST5LMIsFL4dM9Bt+NhFtrwnqVtH3vYUmOgazvUkgE=
=B6F5
-----END PGP SIGNATURE-----


J
J
Justin Veilleux wrote on 25 Jul 2021 19:40
(address . 49582@debbugs.gnu.org)
aa49c0d7-4577-45e0-fb62-24e41f924fbb@gmail.com
I've attached a patch in which I've changed bash and coreutils for
bash-minimal and coreutils-minimal.

Also, since every package in `inputs` was actually just a build
dependency, I've moved them all to `native-inputs`.

I've tested `./pre-inst-env guix build tosdr-chromium
--target=aarch64-linux-gnu`, but since everything is a native input, it
gives out the exact same derivation.
From ff40ed3410aaa8bebb310e8803fe36bc4821ca77 Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Sun, 25 Jul 2021 13:04:49 -0400
Subject: [PATCH] gnu: Add tosdr-chromium.

* gnu/packages/browser-extensions.scm (tosdr, tosdr-chromium): New variables.
---
gnu/packages/browser-extensions.scm | 50 ++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)

Toggle diff (76 lines)
diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm
index a6120baf96..017b831d8a 100644
--- a/gnu/packages/browser-extensions.scm
+++ b/gnu/packages/browser-extensions.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -21,10 +22,14 @@
#:use-module (guix git-download)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu build chromium-extension)
#:use-module (gnu packages compression)
- #:use-module (gnu packages python))
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
+ #:use-module (gnu packages node))
(define play-to-kodi
(package
@@ -121,3 +126,46 @@ ungoogled-chromium.")
(define-public ublock-origin/chromium
(make-chromium-extension ublock-origin "chromium"))
+
+(define tosdr
+ (package
+ (name "tosdr")
+ (version "4.1.1")
+ (source
+ (origin
+ (uri
+ (git-reference
+ (url "https://github.com/tosdr/browser-extensions.git")
+ (commit version)))
+ (sha256
+ (base32 "0wz31f9rz087yw1a7cdhdgqvgnhbk569jywv846n122m4bpk3yw0"))
+ (method git-fetch)))
+ (native-inputs
+ `(("bash" ,bash-minimal)
+ ("coreutils" ,coreutils-minimal)
+ ("node" ,node)
+ ("zip" ,zip)
+ ("unzip" ,unzip)))
+ (arguments
+ `(#:builder
+ (begin
+ (use-modules (guix build utils))
+ (set-path-environment-variable "PATH"
+ '("bin")
+ (map cdr %build-inputs))
+ (copy-recursively (assoc-ref %build-inputs "source") ".")
+ (invoke "sh" "./build.sh")
+ (invoke "unzip" "dist/chrome.zip" "-d" %output)
+ #t)
+ #:modules ((guix build utils))))
+ (build-system trivial-build-system)
+ (synopsis "extension to inform of the important aspects of the terms and
+conditions of a web service")
+ (description "This extension informs you instantly of your rights online by
+showing an unintrusive icon in the toolbar. You can click on this icon to get
+summaries from the Terms of Service; Didn't Read initiative.")
+ (license license:agpl3)
+ (home-page "https://tosdr.org/")))
+
+(define-public tosdr-chromium
+ (make-chromium-extension tosdr))
--
2.31.1
J
J
Justin Veilleux wrote on 25 Jul 2021 20:04
(address . 49582@debbugs.gnu.org)
236d4a8f-b911-8242-5e09-9ccb07981592@gmail.com
oops. I forgot to fix the tabs.
From bc5f008f967d918013255a905ef2e8bfd10cb28a Mon Sep 17 00:00:00 2001
From: terramorpha <terramorpha@cock.li>
Date: Sun, 25 Jul 2021 13:04:49 -0400
Subject: [PATCH] gnu: Add tosdr-chromium.

* gnu/packages/browser-extensions.scm (tosdr, tosdr-chromium): New variables.
---
gnu/packages/browser-extensions.scm | 50 ++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)

Toggle diff (76 lines)
diff --git a/gnu/packages/browser-extensions.scm b/gnu/packages/browser-extensions.scm
index a6120baf96..b9fb464b7a 100644
--- a/gnu/packages/browser-extensions.scm
+++ b/gnu/packages/browser-extensions.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020, 2021 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2021 Justin Veilleux <terramorpha@cock.li>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -21,10 +22,14 @@
#:use-module (guix git-download)
#:use-module (guix build-system copy)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu build chromium-extension)
#:use-module (gnu packages compression)
- #:use-module (gnu packages python))
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
+ #:use-module (gnu packages node))
(define play-to-kodi
(package
@@ -121,3 +126,46 @@ ungoogled-chromium.")
(define-public ublock-origin/chromium
(make-chromium-extension ublock-origin "chromium"))
+
+(define tosdr
+ (package
+ (name "tosdr")
+ (version "4.1.1")
+ (source
+ (origin
+ (uri
+ (git-reference
+ (url "https://github.com/tosdr/browser-extensions.git")
+ (commit version)))
+ (sha256
+ (base32 "0wz31f9rz087yw1a7cdhdgqvgnhbk569jywv846n122m4bpk3yw0"))
+ (method git-fetch)))
+ (native-inputs
+ `(("bash" ,bash-minimal)
+ ("coreutils" ,coreutils-minimal)
+ ("node" ,node)
+ ("zip" ,zip)
+ ("unzip" ,unzip)))
+ (arguments
+ `(#:builder
+ (begin
+ (use-modules (guix build utils))
+ (set-path-environment-variable "PATH"
+ '("bin")
+ (map cdr %build-inputs))
+ (copy-recursively (assoc-ref %build-inputs "source") ".")
+ (invoke "sh" "./build.sh")
+ (invoke "unzip" "dist/chrome.zip" "-d" %output)
+ #t)
+ #:modules ((guix build utils))))
+ (build-system trivial-build-system)
+ (synopsis "extension to inform of the important aspects of the terms and
+conditions of a web service")
+ (description "This extension informs you instantly of your rights online by
+showing an unintrusive icon in the toolbar. You can click on this icon to get
+summaries from the Terms of Service; Didn't Read initiative.")
+ (license license:agpl3)
+ (home-page "https://tosdr.org/")))
+
+(define-public tosdr-chromium
+ (make-chromium-extension tosdr))
--
2.32.0
?