aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanketsu <hanketsu@egregore.fun>2024-10-27 13:35:56 +0100
committerHanketsu <hanketsu@egregore.fun>2025-06-13 00:04:37 +0200
commit8055abc420c01ad7ce2fbd3dd2d629444e893b01 (patch)
treed58208e49d3d655fc4d2069f6ca621bba8c183a9
parent03838f85acb9f5055f525b7c849a0bfdbb6442c2 (diff)
battering: palemoon: Remove spyware infestation and feudal choices.
* battering/packages/palemoon.scm (make-palemoon): Stop handling user-appdir. * battering/packages/palemoon.scm (make-palemoon)<#:phases> ['fix-prefs, 'remove-spyware-home-page]: New phases. * battering/packages/palemoon.scm (palemoon): Switch to gtk3 by default.
-rw-r--r--battering/packages/palemoon.scm51
1 files changed, 33 insertions, 18 deletions
diff --git a/battering/packages/palemoon.scm b/battering/packages/palemoon.scm
index 65d1749..6b20c26 100644
--- a/battering/packages/palemoon.scm
+++ b/battering/packages/palemoon.scm
@@ -6,7 +6,6 @@
#:use-module (guix git-download)
#:use-module (guix build-system mozilla)
#:use-module ((guix licenses) #:prefix license:)
- #:use-module (ice-9 string-fun)
#:use-module (gnu packages)
#:use-module (gnu packages assembly)
#:use-module (gnu packages autotools)
@@ -32,9 +31,7 @@
#:use-module (gnu packages xorg))
-(define* (make-palemoon #:key
- (with-gtk3? #f)
- (moz-app-name "moonchild_productions"))
+(define* (make-palemoon #:key (with-gtk3? #f))
(package
(name "palemoon")
(version "33.4.0.1")
@@ -134,7 +131,6 @@
;; "--with-gl-provider=EGL"
"--with-pthreads"
"--with-x"
- #$(string-append "--with-user-appdir=" moz-app-name)
;; Avoid bundled libraries.
;; UNBUNDLE-ME! "--enable-system-sqlite"
;; UNBUNDLE-ME! "--with-system-bz2"
@@ -158,7 +154,35 @@
"--enable-accessibility"))
#:phases
#~(modify-phases %standard-phases
- (add-after 'patch-source-shebangs 'patch-configure-in
+ (add-after 'unpack 'fix-prefs
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((port (open-file #$(format #f "~a/app/profile/~a.js" name name) "a")))
+ (for-each (lambda (pref)
+ (let ((key (car pref))
+ (value (if (boolean? (cadr pref)) (if (cadr pref)
+ 'true
+ 'false)
+ (cadr pref))))
+ (format port "~%pref(~s, ~s);~%" key value)
+ (format #t "fix-prefs: setting value of ~s to ~s~%" key value)))
+ '(("browser.backspace_action" 0)
+ ("extensions.blocklist.enabled" #f) ;; Feudal blocking
+ ("browser.shell.checkDefaultBrowser" #f)
+ ("security.sandbox.content.read_path_whitelist" (%store-directory))))
+ (close-port port))))
+ (add-after 'fix-prefs 'remove-spyware-home-page
+ (lambda _
+ (substitute* "palemoon/branding/shared/locales/browserconfig.properties"
+ ;; Switch the page from the properties to something local
+ (("(https?://)start.palemoon.org(/?)" all https slash) "about:home"))
+ (substitute* "palemoon/branding/official/palemoon.desktop"
+ ;; Remove the -new-tab from the desktop file (it opens the same page)
+ (("^Exec=palemoon.*") "Exec=palemoon"))
+ (substitute* '("palemoon/branding/shared/pref/preferences.inc"
+ "palemoon/branding/unofficial/pref/palemoon-branding.js")
+ ;; Remove the startup.homepage_welcome_url preference
+ (("^pref\\(\"startup\\.homepage_welcome_url\",\".*\"\\);\n$") ""))))
+ (add-after 'remove-spyware-home-page 'patch-configure-in
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "./configure.in" ;; Doesn't get patched automatically. Why ? This eludes me.
(("^#!/bin/sh") (format #f "#!~a" (search-input-file inputs "bin/sh"))))))
@@ -193,12 +217,6 @@
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(invoke "./mach" "test"))))
- (add-before 'install 'set-prefs
- (lambda* (#:key prefs #:allow-other-keys)
- (let ((p (open-file (format #f "~a/bin/browser/defaults/preferences/~a.js" #$distdir #$name) "a")))
- (for-each (lambda (pref)
- (format p "pref(~s, ~a)" (car pref) (cadr pref)))
- '(("browser.backspace_action" 0))))))
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(invoke "./mach" "package")
@@ -212,12 +230,9 @@
(format #f "~a/~a" bin #$name)))))
(add-after 'install 'wrap-program
(lambda* (#:key inputs #:allow-other-keys)
- (let ((ld-libs '#$(map (lambda (label)
- (file-append (this-package-input label) "/lib"))
- '("libdbusmenu"))))
- (wrap-program (format #f "~a/lib/~a/~a" #$output #$name #$name)
- `("GDK_BACKEND" = ("x11"))
- `("MOZ_ENABLE_WAYLAND" = ("0"))))))))))
+ (wrap-program (format #f "~a/lib/~a/~a" #$output #$name #$name)
+ `("GDK_BACKEND" = ("x11"))
+ `("MOZ_ENABLE_WAYLAND" = ("0")))))))))
(home-page "https://palemoon.org")
(synopsis "Independent browser derived from Firefox/Mozilla community code")
(description "Pale Moon is an Open Source, Goanna-based web browser.")