From mboxrd@z Thu Jan 1 00:00:00 1970 From: ng0 Subject: Re: Packaging IceCat extensions with Guix Date: Sun, 2 Jul 2017 20:28:22 +0000 Message-ID: <20170702202822.flniirarc6louunf@abyayala> References: <87ziiw5bzt.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> <87shonki5o.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> <87ziiv9tnw.fsf@wasp.i-did-not-set--mail-host-address--so-tickle-me> <20170608184606.smyp5y7oufftkort@abyayala> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eqdyu4un4x7lavtj" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRlU7-000248-Rr for guix-devel@gnu.org; Sun, 02 Jul 2017 16:28:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRlU4-0001My-MR for guix-devel@gnu.org; Sun, 02 Jul 2017 16:28:47 -0400 Received: from aibo.runbox.com ([91.220.196.211]:49616) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dRlU4-0001Mn-B5 for guix-devel@gnu.org; Sun, 02 Jul 2017 16:28:44 -0400 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1dRlU2-0002OI-Os for guix-devel@gnu.org; Sun, 02 Jul 2017 22:28:42 +0200 Received: from [188.214.129.85] (helo=localhost) by mailfront10.runbox.com with esmtpsa (uid:892961 ) (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1dRlTj-0004O8-Mj for guix-devel@gnu.org; Sun, 02 Jul 2017 22:28:24 +0200 Content-Disposition: inline In-Reply-To: <20170608184606.smyp5y7oufftkort@abyayala> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --eqdyu4un4x7lavtj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable ng0 transcribed 10K bytes: > What happened to this idea? >=20 > Is anyone working on it or should I try to find someone who > wants to work on it? >=20 > 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 repla= ce 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 repla= ce 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 writes: > >=20 > > > Marius Bakke 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 > > >> /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. > >=20 > > Alright, in addition to what Mark wrote: > >=20 > > The ebuild for firefox based browsers does this: > > https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/firefox/firef= ox-45.6.0-r1.ebuild#n145 > >=20 > > Which includes a simple sed: > >=20 > > # 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 r= eplace 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 r= eplace plugin path for 64bit!" > >=20 > > 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. > >=20 > > > 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 20= 01 > > >> From: Marius Bakke > > >> 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= =2Escm > > >> 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 =C2=A9 2016 Marius Bakke > > >> +;;; > > >> +;;; This file is part of GNU Guix. > > >> +;;; > > >> +;;; GNU Guix is free software; you can redistribute it and/or modif= y 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 Licen= se > > >> +;;; along with GNU Guix. If not, see . > > >> + > > >> +(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.g= it") > > >> + (commit version))) > > >> + (file-name (string-append name "-" version "-checkout= ")) > > >> + (sha256 > > >> + (base32 > > >> + "154i7p2qa2jq5907n9bqsy9bh2l2iiynhd7x9s4d6dabwfq7aa= 5n")))) > > >> + (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 > > >> + "0460sh05ahxl6539pfxbgaf1ibxxi3c656pxazwnppln2zaiig= fz")))) > > >> + (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" extd= ir) > > >> + (install-file "dist/build/uBlock0.firefox.xpi" extdi= r) > > >> + #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 wit= h 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 an= yone". > > >> + (license:non-copyleft "https://www.malwaredomain= list.com/"))))) > > >> --=20 > > >> 2.11.0 > > >> > > > > > > --=20 > > > =E2=99=A5=E2=92=B6 ng0 -- https://www.inventati.org/patternsinthecha= os/ > > > > > > > >=20 > > --=20 > > =E2=99=A5=E2=92=B6 ng0 -- https://www.inventati.org/patternsinthechaos/ > >=20 > >=20 >=20 > --=20 > ng0 > OpenPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588 --=20 ng0 GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588 GnuPG: https://n0is.noblogs.org/my-keys https://www.infotropique.org https://krosos.org --eqdyu4un4x7lavtj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEqIyK3RKYKNfqwC5S4i+bv+40hYgFAllZV2YACgkQ4i+bv+40 hYjqzA//RtgU+m8rzzkNydm3+G7WWxAADPtyXZR7LcTmdvlJh4pl00qEHVlltlc+ ygKBIHrWfj4ou9RfcHwgYpyySQM8BxNVmlq6T0Dg/f2a5LgQmYblE0cQvtDBtGz4 qaxxAOCfYaIGjDzXK5rzqHA3FLAkRB7FvuyU6ntRZlHVRxT8eZW7C7nhgUS/i1GY bbDC8TjEbxPTqYlAHPtwUblEAQVE/ZnCg5+5bMqR4+W9DlQvMfeNzHh40oHXjlZT ZGq5AdoGtyM08RbMMaW2NJd4BMG7q84qOtagUPnAUbrt+dI0xXcVwXOJ3Q6iNyBs A26uPgaG9p1x8XFJSIi31LfpABIuW2RkgZtxwg3Tsjp6UWWtAQe4cMjhaSHCfM6g KCSiREBVbdJDOGkUTAryO41BSLiSdTxzHrqdEz5x2v8rf9gyE8mCFaS9YhXSuIGd TYusgKsQdLxqc/+o21uZUSrZxhzgJmDG4dc81ydCA104OxJ4v4Yc08BuuQp7mRtX wueZmBxowlby0pLEL2oJNMUiq8dlpA+8xE0xuV9tJKA1DIL6GfYk7F9zzq+RiYGK luP5sK+1eHOfX2Z0kFXO18gqXCaFTn6FCsa2vcaEsO3WOCiOo2w5Jrvf7FdNnKkK pxm01R19eSDfhn72S0Dc9l3cb1eRG/5lEwOkqDGlXUqZOx6wA5E= =gP9i -----END PGP SIGNATURE----- --eqdyu4un4x7lavtj--