unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Packaging IceCat extensions with Guix
@ 2017-01-12 19:12 Marius Bakke
  2017-01-12 22:49 ` ng0
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Marius Bakke @ 2017-01-12 19:12 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 541 bytes --]

Hi Guix,

I read somewhere that Debian packages certain Firefox extensions. I
tried doing the same with Guix, but haven't been able to get IceCat to
load extensions from a directory.

The attached (outdated!) patch adds the "uBlock" XPI to
<guix-profile>/lib/icecat/extensions. I've tried symlinking this to
"standard" system folders (from IceCat source code), and disabled
unsigned extensions, but no luck so far. Maybe someone more familiar
with IceCat internals can try it?

I would love to have my favourite extensions managed by Guix!


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

[-- Attachment #2: 0001-gnu-Add-ublock.patch --]
[-- Type: text/x-patch, Size: 5390 bytes --]

From 3a1bc1a489c5f7cd624c661a8887bf2e89ea74b2 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Tue, 1 Nov 2016 10:33:52 +0000
Subject: [PATCH] gnu: Add ublock.

---
 gnu/packages/web-plugins.scm | 114 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)
 create mode 100644 gnu/packages/web-plugins.scm

diff --git a/gnu/packages/web-plugins.scm b/gnu/packages/web-plugins.scm
new file mode 100644
index 000000000..e124b8e74
--- /dev/null
+++ b/gnu/packages/web-plugins.scm
@@ -0,0 +1,114 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
+;;;
+;;; 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 <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages web-plugins)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix download)
+  #:use-module (guix git-download)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system trivial)
+  #:use-module (guix packages)
+  #:use-module (gnu packages python)
+  #:use-module (gnu packages zip))
+
+(define uassets
+  (package
+    (name "uassets")
+    (version "8f505b07572f0ed35d3bfec6ba4c9058f4270ae7")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/uBlockOrigin/uAssets.git")
+                    (commit version)))
+              (file-name (string-append name "-" version "-checkout"))
+              (sha256
+               (base32
+                "154i7p2qa2jq5907n9bqsy9bh2l2iiynhd7x9s4d6dabwfq7aa5n"))))
+    (build-system trivial-build-system)
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+         (copy-recursively (assoc-ref %build-inputs "source")
+                           (assoc-ref %outputs "out"))
+         #t)))
+    (synopsis "Filter lists and rulesets for uBlock and uMatrix")
+    (description
+     "Resources for uBlock Origin, uMatrix: static filter lists,
+ready-to-use rulesets, etc.")
+    (home-page "https://github.com/uBlockOrigin/uAssets")
+    (license license:gpl3))) ; TODO: verify
+
+(define-public ublock
+  (package
+    (name "ublock")
+    (version "1.9.16")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/gorhill/uBlock/archive/"
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "0460sh05ahxl6539pfxbgaf1ibxxi3c656pxazwnppln2zaiigfz"))))
+    (build-system gnu-build-system)
+    ;; We use gnu-build-system to benefit from unpack and
+    ;; source patching, but won't use any standard phases.
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'copy-assets
+           (lambda* (#:key inputs #:allow-other-keys)
+             (copy-recursively (assoc-ref inputs "uassets")
+                               "../uAssets")
+             #t))
+         (delete 'configure)
+         (replace 'build
+           (lambda _
+             (zero? (system* "./tools/make-firefox.sh" "all"))
+             ;(zero? (system* "./tools/make-firefox.sh"))
+             ))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (extdir (string-append
+                             out "/lib/icecat/extensions")))
+               ;(mkdir-p extdir)
+               ;(copy-recursively "dist/build/uBlock0.firefox" extdir)
+               (install-file "dist/build/uBlock0.firefox.xpi" extdir)
+               #t))))))
+    (native-inputs
+     `(("python" ,python-wrapper)
+       ("uassets" ,uassets)
+       ("zip" ,zip)))
+    (synopsis "Efficient content blocker")
+    (description
+     "uBlock Origin is a \"wide spectrum\" blocker for web content.
+It can block ads, trackers, malware sites and similar and comes with a
+comprehensive pre-configured filter list covering known-bad sites.")
+    (home-page "https://github.com/gorhill/uBlock")
+    ;; uBlock is distributed under GPL3+ but includes a handful of
+    ;; components covered by other licenses.
+    (license (list license:gpl3+
+                   license:cc-by-sa3.0
+                   license:mpl2.0
+                   ;; The malware hosts list has no proper license and just
+                   ;; includes the text "our list can be used by anyone".
+                   (license:non-copyleft "https://www.malwaredomainlist.com/")))))
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-12 19:12 Packaging IceCat extensions with Guix Marius Bakke
@ 2017-01-12 22:49 ` ng0
  2017-01-13  1:26   ` Adonay Felipe Nogueira
  2017-01-13  9:49   ` ng0
  2017-01-13  1:49 ` Mark H Weaver
  2017-01-13  2:18 ` Mark H Weaver
  2 siblings, 2 replies; 10+ messages in thread
From: ng0 @ 2017-01-12 22:49 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

Marius Bakke <mbakke@fastmail.com> writes:

> Hi Guix,
>
> I read somewhere that Debian packages certain Firefox extensions. I
> tried doing the same with Guix, but haven't been able to get IceCat to
> load extensions from a directory.
>
> The attached (outdated!) patch adds the "uBlock" XPI to
> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
> "standard" system folders (from IceCat source code), and disabled
> unsigned extensions, but no luck so far. Maybe someone more familiar
> with IceCat internals can try it?
>
> I would love to have my favourite extensions managed by Guix!

I've had a similar idea last year, and I still think it's worth
considering. I'm not sure if I mentioned it here on the mailing
list.

Certain applications, like Chromium based browsers and Mozilla
based software (firefox, thunderbird) allow the use of an system
wide extension/addon store. This is how Gentoo handles it, and I
quiet like it that I don't have to trust these corporations with
how they think distributing such code is secure/just/etc.

When we do this, we have the possibility to control what's inside
the app-stores and avoid the web interface as a middleware.
I have more reasons to lobby for this, but I hope it's just self
explanatory why this is a good idea.

For starters you could look at the Gentoo ebuild for chromium,
palemoon, firefox, or let me come up with a short patch to
icecat. I could work on this tomorrow.

When we do this, I also suggest to name accordingly, like
(gnu packages gnuzilla-plugins)
(gnu packages qupzilla-plugins)
etc, one module for each compatible browser (extensions which
work in a family of browsers or deriviates of them).

I am especially unhappy with palemoon, where the website, and
therefore the store, is behind the great firewall of
cloudflare. I'm still packaging it, but it's annyoing.

> From 3a1bc1a489c5f7cd624c661a8887bf2e89ea74b2 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Tue, 1 Nov 2016 10:33:52 +0000
> Subject: [PATCH] gnu: Add ublock.
>
> ---
>  gnu/packages/web-plugins.scm | 114 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 114 insertions(+)
>  create mode 100644 gnu/packages/web-plugins.scm
>
> diff --git a/gnu/packages/web-plugins.scm b/gnu/packages/web-plugins.scm
> new file mode 100644
> index 000000000..e124b8e74
> --- /dev/null
> +++ b/gnu/packages/web-plugins.scm
> @@ -0,0 +1,114 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
> +;;;
> +;;; 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 <http://www.gnu.org/licenses/>.
> +
> +(define-module (gnu packages web-plugins)
> +  #:use-module ((guix licenses) #:prefix license:)
> +  #:use-module (guix download)
> +  #:use-module (guix git-download)
> +  #:use-module (guix build-system gnu)
> +  #:use-module (guix build-system trivial)
> +  #:use-module (guix packages)
> +  #:use-module (gnu packages python)
> +  #:use-module (gnu packages zip))
> +
> +(define uassets
> +  (package
> +    (name "uassets")
> +    (version "8f505b07572f0ed35d3bfec6ba4c9058f4270ae7")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/uBlockOrigin/uAssets.git")
> +                    (commit version)))
> +              (file-name (string-append name "-" version "-checkout"))
> +              (sha256
> +               (base32
> +                "154i7p2qa2jq5907n9bqsy9bh2l2iiynhd7x9s4d6dabwfq7aa5n"))))
> +    (build-system trivial-build-system)
> +    (arguments
> +     `(#:modules ((guix build utils))
> +       #:builder
> +       (begin
> +         (use-modules (guix build utils))
> +         (copy-recursively (assoc-ref %build-inputs "source")
> +                           (assoc-ref %outputs "out"))
> +         #t)))
> +    (synopsis "Filter lists and rulesets for uBlock and uMatrix")
> +    (description
> +     "Resources for uBlock Origin, uMatrix: static filter lists,
> +ready-to-use rulesets, etc.")
> +    (home-page "https://github.com/uBlockOrigin/uAssets")
> +    (license license:gpl3))) ; TODO: verify
> +
> +(define-public ublock
> +  (package
> +    (name "ublock")
> +    (version "1.9.16")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "https://github.com/gorhill/uBlock/archive/"
> +                    version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "0460sh05ahxl6539pfxbgaf1ibxxi3c656pxazwnppln2zaiigfz"))))
> +    (build-system gnu-build-system)
> +    ;; We use gnu-build-system to benefit from unpack and
> +    ;; source patching, but won't use any standard phases.
> +    (arguments
> +     `(#:tests? #f
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'copy-assets
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (copy-recursively (assoc-ref inputs "uassets")
> +                               "../uAssets")
> +             #t))
> +         (delete 'configure)
> +         (replace 'build
> +           (lambda _
> +             (zero? (system* "./tools/make-firefox.sh" "all"))
> +             ;(zero? (system* "./tools/make-firefox.sh"))
> +             ))
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (extdir (string-append
> +                             out "/lib/icecat/extensions")))
> +               ;(mkdir-p extdir)
> +               ;(copy-recursively "dist/build/uBlock0.firefox" extdir)
> +               (install-file "dist/build/uBlock0.firefox.xpi" extdir)
> +               #t))))))
> +    (native-inputs
> +     `(("python" ,python-wrapper)
> +       ("uassets" ,uassets)
> +       ("zip" ,zip)))
> +    (synopsis "Efficient content blocker")
> +    (description
> +     "uBlock Origin is a \"wide spectrum\" blocker for web content.
> +It can block ads, trackers, malware sites and similar and comes with a
> +comprehensive pre-configured filter list covering known-bad sites.")
> +    (home-page "https://github.com/gorhill/uBlock")
> +    ;; uBlock is distributed under GPL3+ but includes a handful of
> +    ;; components covered by other licenses.
> +    (license (list license:gpl3+
> +                   license:cc-by-sa3.0
> +                   license:mpl2.0
> +                   ;; The malware hosts list has no proper license and just
> +                   ;; includes the text "our list can be used by anyone".
> +                   (license:non-copyleft "https://www.malwaredomainlist.com/")))))
> -- 
> 2.11.0
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-12 22:49 ` ng0
@ 2017-01-13  1:26   ` Adonay Felipe Nogueira
  2017-01-13  4:11     ` Mike Gerwitz
  2017-01-13  9:49   ` ng0
  1 sibling, 1 reply; 10+ messages in thread
From: Adonay Felipe Nogueira @ 2017-01-13  1:26 UTC (permalink / raw)
  To: guix-devel

We are more unhappy because CludFlare makes site visitors (of any site
that uses their service) to use non-free software automatically.

Sorry for self-promoting my actionst, but: There's even an action item
about it on LibrePlanet wiki:
<https://libreplanet.org/wiki/Action_items/To_CloudFlare:_Free_your_JavaScript>. You
can also contribute, just follow what is suggested there.
-- 
* pt-BR: Brasileiro | en: Brazilian
* pt-BR: Ativista do software livre | en: Free/libre software activist
* https://libreplanet.org/wiki/User:Adfeno
* pt-BR: Palestrante, consultor e avaliador | en: Speaker, consultant and evaluator

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-12 19:12 Packaging IceCat extensions with Guix Marius Bakke
  2017-01-12 22:49 ` ng0
@ 2017-01-13  1:49 ` Mark H Weaver
  2017-01-13  2:18 ` Mark H Weaver
  2 siblings, 0 replies; 10+ messages in thread
From: Mark H Weaver @ 2017-01-13  1:49 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

Hi Marius,

Marius Bakke <mbakke@fastmail.com> writes:

> I read somewhere that Debian packages certain Firefox extensions. I
> tried doing the same with Guix, but haven't been able to get IceCat to
> load extensions from a directory.
>
> The attached (outdated!) patch adds the "uBlock" XPI to
> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
> "standard" system folders (from IceCat source code), and disabled
> unsigned extensions, but no luck so far. Maybe someone more familiar
> with IceCat internals can try it?

The relevant code is in toolkit/xre/nsXREDirProvider.cpp.  It looks to
me like the functions to patch are GetSystemExtensionsDirectory and
AppendSysUserExtensionPath.

In GetSystemExtensionsDirectory, I guess the strings
"/usr/lib/mozilla/extensions" and "/usr/lib64/mozilla/extensions" should
both be changed to "/run/current-system/profile/lib/mozilla/extensions".

In AppendSysUserExtensionPath, instead of appending ".mozilla" and
"extensions" components to the file name, we should append
".guix-profile", "lib", "mozilla", and "extensions".

Would you like to work on it?

As a temporary hack, icecat is currently looking in
~/.mozilla/extensions, so you could make that a symlink pointing to the
appropriate place.

> I would love to have my favourite extensions managed by Guix!

I agree, wholeheartedly :)

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (extdir (string-append
> +                             out "/lib/icecat/extensions")))

s/icecat/mozilla/

Thanks very much for taking this on!

      Mark

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-12 19:12 Packaging IceCat extensions with Guix Marius Bakke
  2017-01-12 22:49 ` ng0
  2017-01-13  1:49 ` Mark H Weaver
@ 2017-01-13  2:18 ` Mark H Weaver
  2017-01-14 17:46   ` Ludovic Courtès
  2 siblings, 1 reply; 10+ messages in thread
From: Mark H Weaver @ 2017-01-13  2:18 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

I wrote:

> Marius Bakke <mbakke@fastmail.com> writes:
>
>> I read somewhere that Debian packages certain Firefox extensions. I
>> tried doing the same with Guix, but haven't been able to get IceCat to
>> load extensions from a directory.
>>
>> The attached (outdated!) patch adds the "uBlock" XPI to
>> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
>> "standard" system folders (from IceCat source code), and disabled
>> unsigned extensions, but no luck so far. Maybe someone more familiar
>> with IceCat internals can try it?
>
> The relevant code is in toolkit/xre/nsXREDirProvider.cpp.  It looks to
> me like the functions to patch are GetSystemExtensionsDirectory and
> AppendSysUserExtensionPath.
>
> In GetSystemExtensionsDirectory, I guess the strings
> "/usr/lib/mozilla/extensions" and "/usr/lib64/mozilla/extensions" should
> both be changed to "/run/current-system/profile/lib/mozilla/extensions".

Also, in GetFile, "/usr/share/mozilla/extensions" should be changed to
"/run/current-system/profile/share/mozilla/extensions".

Here's another file that needs patching:

  xpcom/io/nsAppFileLocationProvider.cpp

In nsAppFileLocationProvider::GetFile, "/usr/lib/mozilla/plugins" and
"/usr/lib64/mozilla/plugins" should be changed to
"/run/current-system/profile/lib/mozilla/plugins".  Note that the
MOZ_PLUGIN_PATH environment variable is consulted here.

Here are a couple of other files that might be relevant:

  toolkit/mozapps/extensions/AddonManager.jsm
  toolkit/mozapps/extensions/internal/XPIProvider.jsm

      Mark

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-13  1:26   ` Adonay Felipe Nogueira
@ 2017-01-13  4:11     ` Mike Gerwitz
  0 siblings, 0 replies; 10+ messages in thread
From: Mike Gerwitz @ 2017-01-13  4:11 UTC (permalink / raw)
  To: Adonay Felipe Nogueira; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 944 bytes --]

On Thu, Jan 12, 2017 at 23:26:24 -0200, Adonay Felipe Nogueira wrote:
> We are more unhappy because CludFlare makes site visitors (of any site
> that uses their service) to use non-free software automatically.

Not that this excuses the issue or lessens the need for the liberation
of CloudFlare's JS, but it is worth noting that their CAPTCHA works with
JS disabled.  Certain adblockers and other privacy addons (including
FF's built-in) might block the JS-free version from loading; you'll have
to play around with that as appropriate.

There are rare occasions where the site uses the JS-only "challenge",
which does actually require JS.  I use archive.org or some other cache
to view the site in that case.

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
Old: 2217 5B02 E626 BC98 D7C0  C2E5 F22B B815 8EE3 0EAB
https://mikegerwitz.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-12 22:49 ` ng0
  2017-01-13  1:26   ` Adonay Felipe Nogueira
@ 2017-01-13  9:49   ` ng0
  2017-06-08 18:46     ` ng0
  1 sibling, 1 reply; 10+ messages in thread
From: ng0 @ 2017-01-13  9:49 UTC (permalink / raw)
  To: guix-devel

ng0 <ng0@libertad.pw> writes:

> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Hi Guix,
>>
>> I read somewhere that Debian packages certain Firefox extensions. I
>> tried doing the same with Guix, but haven't been able to get IceCat to
>> load extensions from a directory.
>>
>> The attached (outdated!) patch adds the "uBlock" XPI to
>> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
>> "standard" system folders (from IceCat source code), and disabled
>> unsigned extensions, but no luck so far. Maybe someone more familiar
>> with IceCat internals can try it?
>>
>> I would love to have my favourite extensions managed by Guix!
>
> I've had a similar idea last year, and I still think it's worth
> considering. I'm not sure if I mentioned it here on the mailing
> list.
>
> Certain applications, like Chromium based browsers and Mozilla
> based software (firefox, thunderbird) allow the use of an system
> wide extension/addon store. This is how Gentoo handles it, and I
> quiet like it that I don't have to trust these corporations with
> how they think distributing such code is secure/just/etc.
>
> When we do this, we have the possibility to control what's inside
> the app-stores and avoid the web interface as a middleware.
> I have more reasons to lobby for this, but I hope it's just self
> explanatory why this is a good idea.
>
> For starters you could look at the Gentoo ebuild for chromium,
> palemoon, firefox, or let me come up with a short patch to
> icecat. I could work on this tomorrow.

Alright, in addition to what Mark wrote:

The ebuild for firefox based browsers does this:
https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/firefox/firefox-45.6.0-r1.ebuild#n145

Which includes a simple sed:

# Ensure that our plugins dir is enabled as default
	sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
	sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"

And then there's an appropriate, fitting eclass you use when you
package firefox extensions.
This is for the firefox version they use. I have forgotten which
version we are on, but it really is that simple. Only needs to be
adjusted to a location we agree on. Sort of.

> When we do this, I also suggest to name accordingly, like
> (gnu packages gnuzilla-plugins)
> (gnu packages qupzilla-plugins)
> etc, one module for each compatible browser (extensions which
> work in a family of browsers or deriviates of them).
>
> I am especially unhappy with palemoon, where the website, and
> therefore the store, is behind the great firewall of
> cloudflare. I'm still packaging it, but it's annyoing.
>
>> From 3a1bc1a489c5f7cd624c661a8887bf2e89ea74b2 Mon Sep 17 00:00:00 2001
>> From: Marius Bakke <mbakke@fastmail.com>
>> Date: Tue, 1 Nov 2016 10:33:52 +0000
>> Subject: [PATCH] gnu: Add ublock.
>>
>> ---
>>  gnu/packages/web-plugins.scm | 114 +++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 114 insertions(+)
>>  create mode 100644 gnu/packages/web-plugins.scm
>>
>> diff --git a/gnu/packages/web-plugins.scm b/gnu/packages/web-plugins.scm
>> new file mode 100644
>> index 000000000..e124b8e74
>> --- /dev/null
>> +++ b/gnu/packages/web-plugins.scm
>> @@ -0,0 +1,114 @@
>> +;;; GNU Guix --- Functional package management for GNU
>> +;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
>> +;;;
>> +;;; 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 <http://www.gnu.org/licenses/>.
>> +
>> +(define-module (gnu packages web-plugins)
>> +  #:use-module ((guix licenses) #:prefix license:)
>> +  #:use-module (guix download)
>> +  #:use-module (guix git-download)
>> +  #:use-module (guix build-system gnu)
>> +  #:use-module (guix build-system trivial)
>> +  #:use-module (guix packages)
>> +  #:use-module (gnu packages python)
>> +  #:use-module (gnu packages zip))
>> +
>> +(define uassets
>> +  (package
>> +    (name "uassets")
>> +    (version "8f505b07572f0ed35d3bfec6ba4c9058f4270ae7")
>> +    (source (origin
>> +              (method git-fetch)
>> +              (uri (git-reference
>> +                    (url "https://github.com/uBlockOrigin/uAssets.git")
>> +                    (commit version)))
>> +              (file-name (string-append name "-" version "-checkout"))
>> +              (sha256
>> +               (base32
>> +                "154i7p2qa2jq5907n9bqsy9bh2l2iiynhd7x9s4d6dabwfq7aa5n"))))
>> +    (build-system trivial-build-system)
>> +    (arguments
>> +     `(#:modules ((guix build utils))
>> +       #:builder
>> +       (begin
>> +         (use-modules (guix build utils))
>> +         (copy-recursively (assoc-ref %build-inputs "source")
>> +                           (assoc-ref %outputs "out"))
>> +         #t)))
>> +    (synopsis "Filter lists and rulesets for uBlock and uMatrix")
>> +    (description
>> +     "Resources for uBlock Origin, uMatrix: static filter lists,
>> +ready-to-use rulesets, etc.")
>> +    (home-page "https://github.com/uBlockOrigin/uAssets")
>> +    (license license:gpl3))) ; TODO: verify
>> +
>> +(define-public ublock
>> +  (package
>> +    (name "ublock")
>> +    (version "1.9.16")
>> +    (source (origin
>> +              (method url-fetch)
>> +              (uri (string-append
>> +                    "https://github.com/gorhill/uBlock/archive/"
>> +                    version ".tar.gz"))
>> +              (sha256
>> +               (base32
>> +                "0460sh05ahxl6539pfxbgaf1ibxxi3c656pxazwnppln2zaiigfz"))))
>> +    (build-system gnu-build-system)
>> +    ;; We use gnu-build-system to benefit from unpack and
>> +    ;; source patching, but won't use any standard phases.
>> +    (arguments
>> +     `(#:tests? #f
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         (add-after 'unpack 'copy-assets
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             (copy-recursively (assoc-ref inputs "uassets")
>> +                               "../uAssets")
>> +             #t))
>> +         (delete 'configure)
>> +         (replace 'build
>> +           (lambda _
>> +             (zero? (system* "./tools/make-firefox.sh" "all"))
>> +             ;(zero? (system* "./tools/make-firefox.sh"))
>> +             ))
>> +         (replace 'install
>> +           (lambda* (#:key outputs #:allow-other-keys)
>> +             (let* ((out (assoc-ref outputs "out"))
>> +                    (extdir (string-append
>> +                             out "/lib/icecat/extensions")))
>> +               ;(mkdir-p extdir)
>> +               ;(copy-recursively "dist/build/uBlock0.firefox" extdir)
>> +               (install-file "dist/build/uBlock0.firefox.xpi" extdir)
>> +               #t))))))
>> +    (native-inputs
>> +     `(("python" ,python-wrapper)
>> +       ("uassets" ,uassets)
>> +       ("zip" ,zip)))
>> +    (synopsis "Efficient content blocker")
>> +    (description
>> +     "uBlock Origin is a \"wide spectrum\" blocker for web content.
>> +It can block ads, trackers, malware sites and similar and comes with a
>> +comprehensive pre-configured filter list covering known-bad sites.")
>> +    (home-page "https://github.com/gorhill/uBlock")
>> +    ;; uBlock is distributed under GPL3+ but includes a handful of
>> +    ;; components covered by other licenses.
>> +    (license (list license:gpl3+
>> +                   license:cc-by-sa3.0
>> +                   license:mpl2.0
>> +                   ;; The malware hosts list has no proper license and just
>> +                   ;; includes the text "our list can be used by anyone".
>> +                   (license:non-copyleft "https://www.malwaredomainlist.com/")))))
>> -- 
>> 2.11.0
>>
>
> -- 
> ♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/
>
>

-- 
♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-13  2:18 ` Mark H Weaver
@ 2017-01-14 17:46   ` Ludovic Courtès
  0 siblings, 0 replies; 10+ messages in thread
From: Ludovic Courtès @ 2017-01-14 17:46 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> I wrote:
>
>> Marius Bakke <mbakke@fastmail.com> writes:
>>
>>> I read somewhere that Debian packages certain Firefox extensions. I
>>> tried doing the same with Guix, but haven't been able to get IceCat to
>>> load extensions from a directory.
>>>
>>> The attached (outdated!) patch adds the "uBlock" XPI to
>>> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
>>> "standard" system folders (from IceCat source code), and disabled
>>> unsigned extensions, but no luck so far. Maybe someone more familiar
>>> with IceCat internals can try it?
>>
>> The relevant code is in toolkit/xre/nsXREDirProvider.cpp.  It looks to
>> me like the functions to patch are GetSystemExtensionsDirectory and
>> AppendSysUserExtensionPath.
>>
>> In GetSystemExtensionsDirectory, I guess the strings
>> "/usr/lib/mozilla/extensions" and "/usr/lib64/mozilla/extensions" should
>> both be changed to "/run/current-system/profile/lib/mozilla/extensions".
>
> Also, in GetFile, "/usr/share/mozilla/extensions" should be changed to
> "/run/current-system/profile/share/mozilla/extensions".
>
> Here's another file that needs patching:
>
>   xpcom/io/nsAppFileLocationProvider.cpp
>
> In nsAppFileLocationProvider::GetFile, "/usr/lib/mozilla/plugins" and
> "/usr/lib64/mozilla/plugins" should be changed to
> "/run/current-system/profile/lib/mozilla/plugins".  Note that the
> MOZ_PLUGIN_PATH environment variable is consulted here.

This sounds like the right approach, and I agree that it’d be nice if
Guix could provide extensions!

Ludo’.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-01-13  9:49   ` ng0
@ 2017-06-08 18:46     ` ng0
  2017-07-02 20:28       ` ng0
  0 siblings, 1 reply; 10+ messages in thread
From: ng0 @ 2017-06-08 18:46 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 9521 bytes --]

What happened to this idea?

Is anyone working on it or should I try to find someone who
wants to work on it?

It's rather simple from my perspective.

ng0 transcribed 8.4K bytes:
> ng0 <ng0@libertad.pw> writes:
> 
> > Marius Bakke <mbakke@fastmail.com> writes:
> >
> >> Hi Guix,
> >>
> >> I read somewhere that Debian packages certain Firefox extensions. I
> >> tried doing the same with Guix, but haven't been able to get IceCat to
> >> load extensions from a directory.
> >>
> >> The attached (outdated!) patch adds the "uBlock" XPI to
> >> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
> >> "standard" system folders (from IceCat source code), and disabled
> >> unsigned extensions, but no luck so far. Maybe someone more familiar
> >> with IceCat internals can try it?
> >>
> >> I would love to have my favourite extensions managed by Guix!
> >
> > I've had a similar idea last year, and I still think it's worth
> > considering. I'm not sure if I mentioned it here on the mailing
> > list.
> >
> > Certain applications, like Chromium based browsers and Mozilla
> > based software (firefox, thunderbird) allow the use of an system
> > wide extension/addon store. This is how Gentoo handles it, and I
> > quiet like it that I don't have to trust these corporations with
> > how they think distributing such code is secure/just/etc.
> >
> > When we do this, we have the possibility to control what's inside
> > the app-stores and avoid the web interface as a middleware.
> > I have more reasons to lobby for this, but I hope it's just self
> > explanatory why this is a good idea.
> >
> > For starters you could look at the Gentoo ebuild for chromium,
> > palemoon, firefox, or let me come up with a short patch to
> > icecat. I could work on this tomorrow.
> 
> Alright, in addition to what Mark wrote:
> 
> The ebuild for firefox based browsers does this:
> https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/firefox/firefox-45.6.0-r1.ebuild#n145
> 
> Which includes a simple sed:
> 
> # Ensure that our plugins dir is enabled as default
> 	sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
> 		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
> 	sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
> 		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
> 
> And then there's an appropriate, fitting eclass you use when you
> package firefox extensions.
> This is for the firefox version they use. I have forgotten which
> version we are on, but it really is that simple. Only needs to be
> adjusted to a location we agree on. Sort of.
> 
> > When we do this, I also suggest to name accordingly, like
> > (gnu packages gnuzilla-plugins)
> > (gnu packages qupzilla-plugins)
> > etc, one module for each compatible browser (extensions which
> > work in a family of browsers or deriviates of them).
> >
> > I am especially unhappy with palemoon, where the website, and
> > therefore the store, is behind the great firewall of
> > cloudflare. I'm still packaging it, but it's annyoing.
> >
> >> From 3a1bc1a489c5f7cd624c661a8887bf2e89ea74b2 Mon Sep 17 00:00:00 2001
> >> From: Marius Bakke <mbakke@fastmail.com>
> >> Date: Tue, 1 Nov 2016 10:33:52 +0000
> >> Subject: [PATCH] gnu: Add ublock.
> >>
> >> ---
> >>  gnu/packages/web-plugins.scm | 114 +++++++++++++++++++++++++++++++++++++++++++
> >>  1 file changed, 114 insertions(+)
> >>  create mode 100644 gnu/packages/web-plugins.scm
> >>
> >> diff --git a/gnu/packages/web-plugins.scm b/gnu/packages/web-plugins.scm
> >> new file mode 100644
> >> index 000000000..e124b8e74
> >> --- /dev/null
> >> +++ b/gnu/packages/web-plugins.scm
> >> @@ -0,0 +1,114 @@
> >> +;;; GNU Guix --- Functional package management for GNU
> >> +;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
> >> +;;;
> >> +;;; 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 <http://www.gnu.org/licenses/>.
> >> +
> >> +(define-module (gnu packages web-plugins)
> >> +  #:use-module ((guix licenses) #:prefix license:)
> >> +  #:use-module (guix download)
> >> +  #:use-module (guix git-download)
> >> +  #:use-module (guix build-system gnu)
> >> +  #:use-module (guix build-system trivial)
> >> +  #:use-module (guix packages)
> >> +  #:use-module (gnu packages python)
> >> +  #:use-module (gnu packages zip))
> >> +
> >> +(define uassets
> >> +  (package
> >> +    (name "uassets")
> >> +    (version "8f505b07572f0ed35d3bfec6ba4c9058f4270ae7")
> >> +    (source (origin
> >> +              (method git-fetch)
> >> +              (uri (git-reference
> >> +                    (url "https://github.com/uBlockOrigin/uAssets.git")
> >> +                    (commit version)))
> >> +              (file-name (string-append name "-" version "-checkout"))
> >> +              (sha256
> >> +               (base32
> >> +                "154i7p2qa2jq5907n9bqsy9bh2l2iiynhd7x9s4d6dabwfq7aa5n"))))
> >> +    (build-system trivial-build-system)
> >> +    (arguments
> >> +     `(#:modules ((guix build utils))
> >> +       #:builder
> >> +       (begin
> >> +         (use-modules (guix build utils))
> >> +         (copy-recursively (assoc-ref %build-inputs "source")
> >> +                           (assoc-ref %outputs "out"))
> >> +         #t)))
> >> +    (synopsis "Filter lists and rulesets for uBlock and uMatrix")
> >> +    (description
> >> +     "Resources for uBlock Origin, uMatrix: static filter lists,
> >> +ready-to-use rulesets, etc.")
> >> +    (home-page "https://github.com/uBlockOrigin/uAssets")
> >> +    (license license:gpl3))) ; TODO: verify
> >> +
> >> +(define-public ublock
> >> +  (package
> >> +    (name "ublock")
> >> +    (version "1.9.16")
> >> +    (source (origin
> >> +              (method url-fetch)
> >> +              (uri (string-append
> >> +                    "https://github.com/gorhill/uBlock/archive/"
> >> +                    version ".tar.gz"))
> >> +              (sha256
> >> +               (base32
> >> +                "0460sh05ahxl6539pfxbgaf1ibxxi3c656pxazwnppln2zaiigfz"))))
> >> +    (build-system gnu-build-system)
> >> +    ;; We use gnu-build-system to benefit from unpack and
> >> +    ;; source patching, but won't use any standard phases.
> >> +    (arguments
> >> +     `(#:tests? #f
> >> +       #:phases
> >> +       (modify-phases %standard-phases
> >> +         (add-after 'unpack 'copy-assets
> >> +           (lambda* (#:key inputs #:allow-other-keys)
> >> +             (copy-recursively (assoc-ref inputs "uassets")
> >> +                               "../uAssets")
> >> +             #t))
> >> +         (delete 'configure)
> >> +         (replace 'build
> >> +           (lambda _
> >> +             (zero? (system* "./tools/make-firefox.sh" "all"))
> >> +             ;(zero? (system* "./tools/make-firefox.sh"))
> >> +             ))
> >> +         (replace 'install
> >> +           (lambda* (#:key outputs #:allow-other-keys)
> >> +             (let* ((out (assoc-ref outputs "out"))
> >> +                    (extdir (string-append
> >> +                             out "/lib/icecat/extensions")))
> >> +               ;(mkdir-p extdir)
> >> +               ;(copy-recursively "dist/build/uBlock0.firefox" extdir)
> >> +               (install-file "dist/build/uBlock0.firefox.xpi" extdir)
> >> +               #t))))))
> >> +    (native-inputs
> >> +     `(("python" ,python-wrapper)
> >> +       ("uassets" ,uassets)
> >> +       ("zip" ,zip)))
> >> +    (synopsis "Efficient content blocker")
> >> +    (description
> >> +     "uBlock Origin is a \"wide spectrum\" blocker for web content.
> >> +It can block ads, trackers, malware sites and similar and comes with a
> >> +comprehensive pre-configured filter list covering known-bad sites.")
> >> +    (home-page "https://github.com/gorhill/uBlock")
> >> +    ;; uBlock is distributed under GPL3+ but includes a handful of
> >> +    ;; components covered by other licenses.
> >> +    (license (list license:gpl3+
> >> +                   license:cc-by-sa3.0
> >> +                   license:mpl2.0
> >> +                   ;; The malware hosts list has no proper license and just
> >> +                   ;; includes the text "our list can be used by anyone".
> >> +                   (license:non-copyleft "https://www.malwaredomainlist.com/")))))
> >> -- 
> >> 2.11.0
> >>
> >
> > -- 
> > ♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/
> >
> >
> 
> -- 
> ♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/
> 
> 

-- 
ng0
OpenPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Packaging IceCat extensions with Guix
  2017-06-08 18:46     ` ng0
@ 2017-07-02 20:28       ` ng0
  0 siblings, 0 replies; 10+ messages in thread
From: ng0 @ 2017-07-02 20:28 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 10835 bytes --]

ng0 transcribed 10K bytes:
> What happened to this idea?
> 
> Is anyone working on it or should I try to find someone who
> wants to work on it?
> 
> It's rather simple from my perspective.

Alright. Going by the example I provided earlier this
year, could we simply use a variable in there which
gets picked up?

# Ensure that our plugins dir is enabled as default
	sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
	sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"

Nix solves this differently, the wrapper for firefox
is simply told where each installed plugin is located.

Before I just do it, I want your opinion.

> ng0 transcribed 8.4K bytes:
> > ng0 <ng0@libertad.pw> writes:
> > 
> > > Marius Bakke <mbakke@fastmail.com> writes:
> > >
> > >> Hi Guix,
> > >>
> > >> I read somewhere that Debian packages certain Firefox extensions. I
> > >> tried doing the same with Guix, but haven't been able to get IceCat to
> > >> load extensions from a directory.
> > >>
> > >> The attached (outdated!) patch adds the "uBlock" XPI to
> > >> <guix-profile>/lib/icecat/extensions. I've tried symlinking this to
> > >> "standard" system folders (from IceCat source code), and disabled
> > >> unsigned extensions, but no luck so far. Maybe someone more familiar
> > >> with IceCat internals can try it?
> > >>
> > >> I would love to have my favourite extensions managed by Guix!
> > >
> > > I've had a similar idea last year, and I still think it's worth
> > > considering. I'm not sure if I mentioned it here on the mailing
> > > list.
> > >
> > > Certain applications, like Chromium based browsers and Mozilla
> > > based software (firefox, thunderbird) allow the use of an system
> > > wide extension/addon store. This is how Gentoo handles it, and I
> > > quiet like it that I don't have to trust these corporations with
> > > how they think distributing such code is secure/just/etc.
> > >
> > > When we do this, we have the possibility to control what's inside
> > > the app-stores and avoid the web interface as a middleware.
> > > I have more reasons to lobby for this, but I hope it's just self
> > > explanatory why this is a good idea.
> > >
> > > For starters you could look at the Gentoo ebuild for chromium,
> > > palemoon, firefox, or let me come up with a short patch to
> > > icecat. I could work on this tomorrow.
> > 
> > Alright, in addition to what Mark wrote:
> > 
> > The ebuild for firefox based browsers does this:
> > https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/firefox/firefox-45.6.0-r1.ebuild#n145
> > 
> > Which includes a simple sed:
> > 
> > # Ensure that our plugins dir is enabled as default
> > 	sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
> > 		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
> > 	sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
> > 		"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
> > 
> > And then there's an appropriate, fitting eclass you use when you
> > package firefox extensions.
> > This is for the firefox version they use. I have forgotten which
> > version we are on, but it really is that simple. Only needs to be
> > adjusted to a location we agree on. Sort of.
> > 
> > > When we do this, I also suggest to name accordingly, like
> > > (gnu packages gnuzilla-plugins)
> > > (gnu packages qupzilla-plugins)
> > > etc, one module for each compatible browser (extensions which
> > > work in a family of browsers or deriviates of them).
> > >
> > > I am especially unhappy with palemoon, where the website, and
> > > therefore the store, is behind the great firewall of
> > > cloudflare. I'm still packaging it, but it's annyoing.
> > >
> > >> From 3a1bc1a489c5f7cd624c661a8887bf2e89ea74b2 Mon Sep 17 00:00:00 2001
> > >> From: Marius Bakke <mbakke@fastmail.com>
> > >> Date: Tue, 1 Nov 2016 10:33:52 +0000
> > >> Subject: [PATCH] gnu: Add ublock.
> > >>
> > >> ---
> > >>  gnu/packages/web-plugins.scm | 114 +++++++++++++++++++++++++++++++++++++++++++
> > >>  1 file changed, 114 insertions(+)
> > >>  create mode 100644 gnu/packages/web-plugins.scm
> > >>
> > >> diff --git a/gnu/packages/web-plugins.scm b/gnu/packages/web-plugins.scm
> > >> new file mode 100644
> > >> index 000000000..e124b8e74
> > >> --- /dev/null
> > >> +++ b/gnu/packages/web-plugins.scm
> > >> @@ -0,0 +1,114 @@
> > >> +;;; GNU Guix --- Functional package management for GNU
> > >> +;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
> > >> +;;;
> > >> +;;; 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 <http://www.gnu.org/licenses/>.
> > >> +
> > >> +(define-module (gnu packages web-plugins)
> > >> +  #:use-module ((guix licenses) #:prefix license:)
> > >> +  #:use-module (guix download)
> > >> +  #:use-module (guix git-download)
> > >> +  #:use-module (guix build-system gnu)
> > >> +  #:use-module (guix build-system trivial)
> > >> +  #:use-module (guix packages)
> > >> +  #:use-module (gnu packages python)
> > >> +  #:use-module (gnu packages zip))
> > >> +
> > >> +(define uassets
> > >> +  (package
> > >> +    (name "uassets")
> > >> +    (version "8f505b07572f0ed35d3bfec6ba4c9058f4270ae7")
> > >> +    (source (origin
> > >> +              (method git-fetch)
> > >> +              (uri (git-reference
> > >> +                    (url "https://github.com/uBlockOrigin/uAssets.git")
> > >> +                    (commit version)))
> > >> +              (file-name (string-append name "-" version "-checkout"))
> > >> +              (sha256
> > >> +               (base32
> > >> +                "154i7p2qa2jq5907n9bqsy9bh2l2iiynhd7x9s4d6dabwfq7aa5n"))))
> > >> +    (build-system trivial-build-system)
> > >> +    (arguments
> > >> +     `(#:modules ((guix build utils))
> > >> +       #:builder
> > >> +       (begin
> > >> +         (use-modules (guix build utils))
> > >> +         (copy-recursively (assoc-ref %build-inputs "source")
> > >> +                           (assoc-ref %outputs "out"))
> > >> +         #t)))
> > >> +    (synopsis "Filter lists and rulesets for uBlock and uMatrix")
> > >> +    (description
> > >> +     "Resources for uBlock Origin, uMatrix: static filter lists,
> > >> +ready-to-use rulesets, etc.")
> > >> +    (home-page "https://github.com/uBlockOrigin/uAssets")
> > >> +    (license license:gpl3))) ; TODO: verify
> > >> +
> > >> +(define-public ublock
> > >> +  (package
> > >> +    (name "ublock")
> > >> +    (version "1.9.16")
> > >> +    (source (origin
> > >> +              (method url-fetch)
> > >> +              (uri (string-append
> > >> +                    "https://github.com/gorhill/uBlock/archive/"
> > >> +                    version ".tar.gz"))
> > >> +              (sha256
> > >> +               (base32
> > >> +                "0460sh05ahxl6539pfxbgaf1ibxxi3c656pxazwnppln2zaiigfz"))))
> > >> +    (build-system gnu-build-system)
> > >> +    ;; We use gnu-build-system to benefit from unpack and
> > >> +    ;; source patching, but won't use any standard phases.
> > >> +    (arguments
> > >> +     `(#:tests? #f
> > >> +       #:phases
> > >> +       (modify-phases %standard-phases
> > >> +         (add-after 'unpack 'copy-assets
> > >> +           (lambda* (#:key inputs #:allow-other-keys)
> > >> +             (copy-recursively (assoc-ref inputs "uassets")
> > >> +                               "../uAssets")
> > >> +             #t))
> > >> +         (delete 'configure)
> > >> +         (replace 'build
> > >> +           (lambda _
> > >> +             (zero? (system* "./tools/make-firefox.sh" "all"))
> > >> +             ;(zero? (system* "./tools/make-firefox.sh"))
> > >> +             ))
> > >> +         (replace 'install
> > >> +           (lambda* (#:key outputs #:allow-other-keys)
> > >> +             (let* ((out (assoc-ref outputs "out"))
> > >> +                    (extdir (string-append
> > >> +                             out "/lib/icecat/extensions")))
> > >> +               ;(mkdir-p extdir)
> > >> +               ;(copy-recursively "dist/build/uBlock0.firefox" extdir)
> > >> +               (install-file "dist/build/uBlock0.firefox.xpi" extdir)
> > >> +               #t))))))
> > >> +    (native-inputs
> > >> +     `(("python" ,python-wrapper)
> > >> +       ("uassets" ,uassets)
> > >> +       ("zip" ,zip)))
> > >> +    (synopsis "Efficient content blocker")
> > >> +    (description
> > >> +     "uBlock Origin is a \"wide spectrum\" blocker for web content.
> > >> +It can block ads, trackers, malware sites and similar and comes with a
> > >> +comprehensive pre-configured filter list covering known-bad sites.")
> > >> +    (home-page "https://github.com/gorhill/uBlock")
> > >> +    ;; uBlock is distributed under GPL3+ but includes a handful of
> > >> +    ;; components covered by other licenses.
> > >> +    (license (list license:gpl3+
> > >> +                   license:cc-by-sa3.0
> > >> +                   license:mpl2.0
> > >> +                   ;; The malware hosts list has no proper license and just
> > >> +                   ;; includes the text "our list can be used by anyone".
> > >> +                   (license:non-copyleft "https://www.malwaredomainlist.com/")))))
> > >> -- 
> > >> 2.11.0
> > >>
> > >
> > > -- 
> > > ♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/
> > >
> > >
> > 
> > -- 
> > ♥Ⓐ  ng0 -- https://www.inventati.org/patternsinthechaos/
> > 
> > 
> 
> -- 
> ng0
> OpenPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588



-- 
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://n0is.noblogs.org/my-keys
https://www.infotropique.org https://krosos.org

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-07-02 20:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-12 19:12 Packaging IceCat extensions with Guix Marius Bakke
2017-01-12 22:49 ` ng0
2017-01-13  1:26   ` Adonay Felipe Nogueira
2017-01-13  4:11     ` Mike Gerwitz
2017-01-13  9:49   ` ng0
2017-06-08 18:46     ` ng0
2017-07-02 20:28       ` ng0
2017-01-13  1:49 ` Mark H Weaver
2017-01-13  2:18 ` Mark H Weaver
2017-01-14 17:46   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).