unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Lassieur" <clement@lassieur.org>
To: 68577@debbugs.gnu.org
Cc: "Clément Lassieur" <clement@lassieur.org>,
	"Mark H Weaver" <mhw@netris.org>,
	"André Batista" <nandre@riseup.net>,
	"Jonathan Brielmaier" <jonathan.brielmaier@web.de>,
	"Ian Eure" <ian@retrospec.tv>
Subject: [bug#68577] [PATCH 2/2] gnu: Add mullvad-browser.
Date: Fri, 19 Jan 2024 00:19:59 +0100	[thread overview]
Message-ID: <174f8492bd3c72fa1bd186ee29e66eb837684768.1705619435.git.clement@lassieur.org> (raw)
In-Reply-To: <cover.1705619435.git.clement@lassieur.org>

* gnu/packages/tor.scm (%mullvadbrowser-version,
%mullvadbrowser-firefox-version, %mullvadbrowser-locales,
translation-mullvad-browser, mullvadbrowser-assets, mullvadbrowser-base,
mullvadbrowser): New variables.

Change-Id: Ie6d48823b3794710f60f0ae201a0297925221f66
---
 gnu/packages/tor.scm | 131 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 131 insertions(+)

diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index 6eb0c7609f0b..357b561874c7 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -879,3 +879,134 @@ (define-public torbrowser
                    #:assets torbrowser-assets
                    #:locales %torbrowser-locales
                    #:base-browser-version %torbrowser-version))
+
+;; To find the last version, look at
+;; https://mullvad.net/en/download/browser/linux.
+(define %mullvadbrowser-version "13.0.7")
+
+;; To find the last Firefox version, browse
+;; https://archive.torproject.org/tor-package-archive/mullvadbrowser/<%mullvadbrowser-version>
+;; There should be only one archive that starts with
+;; "src-firefox-mullvad-browser-".
+(define %mullvadbrowser-firefox-version "115.6.0esr-13.0-1-build1")
+
+;; Use the list in tor-browser-build/rbm.conf.
+(define %mullvadbrowser-locales
+  '("ar" "da" "de" "es-ES" "fa" "fi" "fr" "it" "ja" "ko" "my" "nb-NO" "nl"
+    "pl" "pt-BR" "ru" "sv-SE" "th" "tr" "zh-CN" "zh-TW"))
+
+;; See tor-browser-build/projects/translation/config.
+(define translation-mullvad-browser
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://gitlab.torproject.org/tpo/translation.git")
+          (commit "57de1569da0e2c48fd999a13e555f6b522041993")))
+    (file-name "translation-mullvad-browser")
+    (sha256
+     (base32
+      "1q3979ac92c5mib573hx9w06x3hrfw7r52wzmj9r75sz2hhsmrq3"))))
+
+(define-public mullvadbrowser-assets
+  ;; This is a prebuilt Mullvad Browser from which we take the assets we need.
+  (package
+    (name "mullvadbrowser-assets")
+    (version %mullvadbrowser-version)
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://archive.torproject.org/tor-package-archive/mullvadbrowser/"
+         version "/mullvad-browser-linux-x86_64-" version ".tar.xz"))
+       (sha256
+        (base32
+         "1i7vf7cn6s5iajsp4999jpxxn8qblljrrmfs4nswmc2swdmi07gk"))))
+    (arguments
+     (list
+      #:install-plan
+      ''(("Browser" "." #:include-regexp
+          ("^\\./fonts/"
+           "^\\./fontconfig/fonts.conf"
+           ;; Mullvad Browser Extension
+           "^\\./distribution/extensions/\\{d19a89b9-76c1-4a61-bcd4-49e8de916403\\}.xpi"
+           )))))
+    (build-system copy-build-system)
+    (home-page "https://www.torproject.org")
+    (synopsis "Mullvad Browser assets")
+    (description "This package contains fonts and configuration files for
+Mullvad Browser.")
+    (license license:silofl1.1)))
+
+(define mullvadbrowser-base
+  (make-torbrowser #:moz-app-name "mullvadbrowser"
+                   #:moz-app-remotingname "Mullvad Browser"
+                   #:branding-directory "browser/branding/mb-release"
+                   #:assets mullvadbrowser-assets
+                   #:locales %mullvadbrowser-locales
+                   #:base-browser-version %mullvadbrowser-version))
+
+(define-public mullvadbrowser
+  (package
+    (inherit mullvadbrowser-base)
+    (name "mullvadbrowser")
+    (version %mullvadbrowser-version)
+    (source
+     (origin
+       (method url-fetch)
+       (uri
+        (string-append
+         "https://archive.torproject.org/tor-package-archive/mullvadbrowser/"
+         version "/src-firefox-mullvad-browser-"
+         %mullvadbrowser-firefox-version ".tar.xz"))
+       (sha256
+        (base32
+         "1hhmq0sh949vzs3mhh0pmpd2llgw149mv7kzzg2ylj8h2628y0px"))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments mullvadbrowser-base)
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'ublock-private-allowed
+              (lambda _
+                (substitute* "toolkit/components/extensions/Extension.sys.mjs"
+                  ;; The code that gives the correct permission only applies to
+                  ;; distribution add-ons (see installDistributionAddon() in
+                  ;; XPIProvider.jsm).
+                  (("this.isNoScript")
+                   "this.isNoScript || this.id === \"uBlock0@raymondhill.net\""))))
+            ;; See tor-browser-build/projects/firefox/build.
+            (replace 'copy-torbrowser-locales
+              (lambda _
+                (for-each
+                 (lambda (lang)
+                   (system
+                    (format #f "cp -Lr ~a/~a .mozbuild/l10n-central/"
+                            #$translation-mullvad-browser lang)))
+                 '#$%mullvadbrowser-locales)))
+            (add-before 'build 'fix-profiles
+              ;; Otherwise the profile would change every time the install
+              ;; location changes, that is: at every package update.  These
+              ;; values are already the default values for Icecat and Tor
+              ;; Browser.
+              (lambda _
+                (substitute* "browser/moz.configure"
+                  (("\"MOZ_DEDICATED_PROFILES\", True")
+                   "\"MOZ_DEDICATED_PROFILES\", False")
+                  (("\"MOZ_BLOCK_PROFILE_DOWNGRADE\", True")
+                   "\"MOZ_BLOCK_PROFILE_DOWNGRADE\", False"))))
+            (add-after 'deploy-fonts 'deploy-extension
+              (lambda* (#:key inputs #:allow-other-keys)
+                (let ((lib (in-vicinity #$output "lib/mullvadbrowser")))
+                  ;; Mullvad Browser Extension (FIXME: package it)
+                  (copy-recursively
+                   (in-vicinity #$mullvadbrowser-assets "distribution")
+                   (in-vicinity lib "distribution")))))
+            (delete 'deploy-tor-assets)
+            (delete 'autoconfig-tor)))))
+    (inputs (package-inputs icecat-minimal))
+    (propagated-inputs
+     (list noscript/icecat
+           ublock-origin/icecat))
+    (synopsis "Privacy-focused browser")
+    (description "Mullvad Browser is a privacy-focused web browser designed to
+be used with a trustworthy VPN instead of the Tor Network.")))
-- 
2.41.0





  parent reply	other threads:[~2024-01-18 23:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 23:14 [bug#68577] [PATCH 0/2] gnu: Add Mullvad Browser Clément Lassieur
2024-01-18 23:19 ` [bug#68577] [PATCH 1/2] gnu: icecat: Improve inheritance Clément Lassieur
2024-01-22  6:09   ` Mark H Weaver
2024-01-22 11:25     ` Clément Lassieur
2024-01-22 18:42     ` André Batista
2024-02-03 19:28       ` Mark H Weaver
2024-02-07 15:52         ` Clément Lassieur
2024-01-18 23:19 ` Clément Lassieur [this message]
2024-01-22  5:57   ` [bug#68577] [PATCH 2/2] gnu: Add mullvad-browser Mark H Weaver
2024-01-22  6:15     ` Mark H Weaver
2024-01-22 11:41       ` Clément Lassieur
2024-01-22 10:33     ` Clément Lassieur
2024-01-19  5:49 ` [bug#68577] [PATCH v2 0/2] gnu: Add Mullvad Browser Clément Lassieur
2024-01-19  5:11   ` [bug#68577] [PATCH v2 1/2] gnu: icecat: Improve inheritance Clément Lassieur
2024-01-19  5:12   ` [bug#68577] [PATCH v2 2/2] gnu: Add mullvadbrowser Clément Lassieur
2024-01-22  5:29 ` [bug#68577] [PATCH 0/2] gnu: Add Mullvad Browser Mark H Weaver
2024-01-22 10:23   ` Clément Lassieur
2024-01-22 12:10 ` Clément Lassieur
2024-01-25 22:41 ` [bug#68577] [PATCH v2 0/2] Stop inheriting Icecat and add " Clément Lassieur
2024-01-25 22:54   ` [bug#68577] [PATCH v2 1/2] gnu: torbrowser: Stop inheriting Icecat Clément Lassieur
2024-02-01 23:46     ` André Batista
2024-02-02 11:04       ` Clément Lassieur
2024-01-25 22:55   ` [bug#68577] [PATCH v2 2/2] gnu: Add mullvadbrowser Clément Lassieur
2024-01-31 16:20     ` Clément Lassieur
2024-02-02  1:52       ` André Batista
2024-02-02 12:03         ` Clément Lassieur
2024-02-04  1:53       ` Clément Lassieur
2024-02-04  1:48   ` [bug#68577] [PATCH v3] " Clément Lassieur
2024-02-05 14:10     ` bug#68577: " Clément Lassieur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=174f8492bd3c72fa1bd186ee29e66eb837684768.1705619435.git.clement@lassieur.org \
    --to=clement@lassieur.org \
    --cc=68577@debbugs.gnu.org \
    --cc=ian@retrospec.tv \
    --cc=jonathan.brielmaier@web.de \
    --cc=mhw@netris.org \
    --cc=nandre@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).