diff options
author | Hanketsu <hanketsu@egregore.fun> | 2024-10-28 02:55:31 +0100 |
---|---|---|
committer | Hanketsu <hanketsu@egregore.fun> | 2025-06-13 00:04:38 +0200 |
commit | ca8d5b67cac999a9655701e5cb22c05d6563da83 (patch) | |
tree | d5f4c5421e08c1cd395f0fc5d2f3f48a8e6c13a0 | |
parent | d8a7da5b11ff8072114c4df28c354ede6d6180aa (diff) |
battering: palemoon: Factor out an UXP browser procedure
* battering/packages/palemoon.scm
(make-uxp-browser): New procedure.
(make-palemoon): Refactor to depend on make-uxp-browser.
-rw-r--r-- | battering/packages/palemoon.scm | 95 |
1 files changed, 56 insertions, 39 deletions
diff --git a/battering/packages/palemoon.scm b/battering/packages/palemoon.scm index 3faea3d..4a70e36 100644 --- a/battering/packages/palemoon.scm +++ b/battering/packages/palemoon.scm @@ -32,29 +32,15 @@ #:use-module (gnu packages xorg)) -(define* (make-palemoon #:key - (with-gtk3? #f) - (branding "official")) +(define* (make-uxp-browser app-name + app-version + #:key + (with-gtk3? #f) + (branding "official")) (package - (name "palemoon") - (version "33.4.0.1") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://repo.palemoon.org/MoonchildProductions/Pale-Moon.git") - (commit (string-append version "_Release")) - (recursive? #t))) - (file-name (git-file-name name version)) - (sha256 - (base32 "16h25qfvirsan8rr7rk6b4hyvn7w1gb0y9wlsxjpzqac6kl2s98c")) - (patches - (parameterize - ((%patch-path - (map (lambda (directory) - (string-append directory "/battering/packages/patches")) - %load-path))) - (search-patches "palemoon-vendor-basename.patch"))))) + (name app-name) + (version app-version) + (source #f) (build-system mozilla-build-system) (native-inputs (list autoconf @@ -180,19 +166,7 @@ ("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" - ;; New tab should open the user's specified "New Tab" page, not the palemoon start page. - (("^Exec=palemoon -new-tab .*") "Exec=palemoon -new-tab")) - (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 + (add-after 'fix-prefs '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")))))) @@ -259,10 +233,53 @@ (copy-file (format #f "~a/mozicon128.png" #$branding-dir) (in-vicinity dir (format #f "~a.png" #$name)))))))))) - (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.") - (license license:mpl2.0))) + (synopsis "") + (description "") + (license #f) + (home-page ""))) + +(define (make-palemoon . args) + (let ((palemoon (apply make-uxp-browser "palemoon" "33.4.0.1" args))) + (package + (inherit palemoon) + (name "palemoon") + (version "33.4.0.1") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://repo.palemoon.org/MoonchildProductions/Pale-Moon.git") + (commit (string-append version "_Release")) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "16h25qfvirsan8rr7rk6b4hyvn7w1gb0y9wlsxjpzqac6kl2s98c")) + (patches + (parameterize + ((%patch-path + (map (lambda (directory) + (string-append directory "/sigils/packages/patches")) + %load-path))) + (search-patches "palemoon-vendor-basename.patch"))))) + (arguments (substitute-keyword-arguments (package-arguments palemoon) + ((#:phases phases) + #~(modify-phases #$phases + (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" + ;; New tab should open the user's specified "New Tab" page, not the palemoon start page. + (("^Exec=palemoon -new-tab .*") + "Exec=palemoon -new-tab" )) + (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|override)_url\",\".*\"\\);\n$") "")))))))) + (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.") + (license license:mpl2.0)))) (define-public palemoon (make-palemoon #:with-gtk3? #f)) |