diff options
author | Sisiutl <sisiutl@egregore.fun> | 2024-10-28 02:55:31 +0100 |
---|---|---|
committer | Sisiutl <sisiutl@egregore.fun> | 2024-10-28 02:55:31 +0100 |
commit | 44ba423e914b085e7de45afc1150c3062933682a (patch) | |
tree | 64f9578bc8ce1122c7f7dcaae94d8cda9d442a90 | |
parent | 2828794022b57ecaeadd8dcd78cc05edb9bbd017 (diff) |
factor make-uxp-browser function out of palemoon
-rw-r--r-- | sigils/packages/palemoon.scm | 130 |
1 files changed, 89 insertions, 41 deletions
diff --git a/sigils/packages/palemoon.scm b/sigils/packages/palemoon.scm index 1a35036..1983eba 100644 --- a/sigils/packages/palemoon.scm +++ b/sigils/packages/palemoon.scm @@ -31,29 +31,18 @@ #:use-module (gnu packages video) #:use-module (gnu packages xorg)) -(define* (make-palemoon #:key - (with-gtk3? #f) - (branding "official")) +(define %basilisk-official-branding-commit + "63a2bff658c5dfff3b6de17fa54743078aa4eb7e") + +(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 "/sigils/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 @@ -176,19 +165,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")))))) @@ -255,14 +232,85 @@ (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)) +(define-public palemoon + (make-palemoon)) -(define-public palemoon-gtk3 +(define-public palemoon/gtk3 (package (inherit (make-palemoon #:with-gtk3? #t)) (name "palemoon-gtk3"))) + +;; (define (make-basilisk palemoon) +;; (package +;; (inherit palemoon) +;; (name (string-replace-substring (package-name palemoon) +;; "palemoon" "basilisk")) +;; (version "2024.10.24") +;; (source +;; (origin +;; (method git-fetch) +;; (uri (git-reference +;; (url "https://repo.palemoon.org/Basilisk-Dev/Basilisk.git") +;; (commit (string-append "v" version)) +;; (recursive? #t))) +;; (file-name (git-file-name name version)) +;; (sha256 +;; (base32 "1z3yspg2migsrli360iym535sns1n5lc2phh6nr0xp91fwk823j1")))) +;; (home-page "https://www.basilisk-browser.org/") +;; (synopsis "A XUL-based web-browser built on top of the Unified XUL Platform (UXP). This browser is a +;; close twin to pre-Servo Firefox in how it operates.") +;; (description "Basilisk is a free and Open Source XUL-based web browser, featuring the well-known Firefox-style +;; interface and operation. It is based on the Goanna layout and rendering engine (a fork of Gecko) and builds on the +;; Unified XUL Platform (UXP), which in turn is a fork of the Mozilla code base without Servo or Rust.") +;; (license license:mpl2.0))) + +;; (define-public basilisk +;; (make-basilisk palemoon)) |