summaryrefslogtreecommitdiff
path: root/sigils/packages/palemoon.scm
diff options
context:
space:
mode:
authorSisiutl <sisiutl@egregore.fun>2024-10-27 16:33:38 +0100
committerSisiutl <sisiutl@egregore.fun>2024-10-27 16:33:38 +0100
commit5778a595bc347d44786b7569daa8679bfe197690 (patch)
tree6ef65598adaf85a47b1c7ed0abbafb1398c8531b /sigils/packages/palemoon.scm
parent0bccc9e26840d8f6ea37a241679f0b7cce0c1f3f (diff)
palemoon: branding
Diffstat (limited to 'sigils/packages/palemoon.scm')
-rw-r--r--sigils/packages/palemoon.scm136
1 files changed, 80 insertions, 56 deletions
diff --git a/sigils/packages/palemoon.scm b/sigils/packages/palemoon.scm
index 30f1270..149e95e 100644
--- a/sigils/packages/palemoon.scm
+++ b/sigils/packages/palemoon.scm
@@ -32,7 +32,9 @@
(define %palemoon-version "33.4.0.1")
-(define* (make-palemoon #:key (with-gtk3? #f))
+(define* (make-palemoon #:key
+ (with-gtk3? #f)
+ (branding "official"))
(package
(name "palemoon")
(version %palemoon-version)
@@ -86,68 +88,69 @@
gconf))
(arguments
(let* ((gtk-version (if with-gtk3? "gtk3" "gtk2"))
+ (branding-dir (format #f "~a/branding/~a" name branding))
(distdir (format #f "obj-~a/dist" (string-replace-substring
(or (%current-target-system)
%host-type)
"unknown"
"pc")))
- (dist-tarball
+ (tarball-dist
(format #f "~a/~a-~a.~a-~a.tar.xz"
distdir
name
version
(string-join (reverse (string-split (or (%current-target-system)
(%current-system)) #\-)) "-")
- gtk-version))
- (dist-branding
- (format #f "~a/branding" distdir)))
+ gtk-version)))
(list #:tests? #f
- #:configure-flags #~(list #$(string-append "--enable-application=" name)
- "--enable-appcompat-guid"
- "--enable-av1"
- #$(string-append "--enable-default-toolkit=cairo-" gtk-version)
- "--enable-devtools"
- "--enable-jemalloc"
- "--enable-jxl"
- "--enable-more-deterministic"
- "--enable-necko-wifi"
- "--enable-official-branding" ;; Official branding.
- "--enable-optimize=\"-O2 -w\""
- "--enable-strip"
- "--enable-system-ffi"
- "--enable-system-pixman"
- "--disable-debug"
- "--disable-debug-symbols"
- "--disable-elf-hack"
- "--disable-gamepad"
- "--disable-gold"
- "--disable-tests"
- "--disable-updater"
- "--disable-webrtc"
- ;; "--with-gl-provider=EGL"
- "--with-pthreads"
- "--with-x"
- ;; Avoid bundled libraries.
- ;; UNBUNDLE-ME! "--enable-system-sqlite"
- ;; UNBUNDLE-ME! "--with-system-bz2"
- ;; UNBUNDLE-ME! "--with-system-graphite2"
- ;; UNBUNDLE-ME! "--with-system-harfbuzz"
- ;; UNBUNDLE-ME! "--with-system-libevent"
- ;; UNBUNDLE-ME! "--with-system-libvpx"
- ;; UNBUNDLE-ME! "--with-system-nss" ; pending upgrade of 'nss' to 3.90
- ;; UNBUNDLE-ME! "--with-system-ogg"
- ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
- ;; UNBUNDLE-ME! "--with-system-vorbis"
- ;; UNBUNDLE-ME! "--with-system-jpeg" ;must be libjpeg-turbo
- ;; UNBUNDLE-ME! "--with-system-zlib"
- ;; UNBUNDLE-ME! "--with-system-icu"
- ;; UNBUNDLE-ME! "--with-system-png" ;must be libpng-apng
- #$(if with-gtk3? ;; NPAPI requires gtk2. It's for Adobe Flash and Silverlight.
- "--disable-npapi"
- "--enable-npapi")
- #$(if with-gtk3? ;; TODO: find a way to link atk_bridge_adaptor_init
- "--disable-accessibility"
- "--enable-accessibility"))
+ #:configure-flags #~'(#$(string-append "--enable-application=" name)
+ "--enable-appcompat-guid"
+ "--enable-av1"
+ #$(string-append "--enable-default-toolkit=cairo-" gtk-version)
+ "--enable-devtools"
+ "--enable-jemalloc"
+ "--enable-jxl"
+ "--enable-more-deterministic"
+ "--enable-necko-wifi"
+ "--enable-official-branding" ;; Official branding.
+ #$(string-append "--with-branding=" branding-dir)
+ "--enable-optimize=\"-O2 -w\""
+ "--enable-strip"
+ "--enable-system-ffi"
+ "--enable-system-pixman"
+ "--disable-debug"
+ "--disable-debug-symbols"
+ "--disable-debug-js-modules"
+ "--disable-elf-hack"
+ "--disable-gamepad"
+ "--disable-gold"
+ "--disable-tests"
+ "--disable-updater"
+ "--disable-webrtc"
+ ;; "--with-gl-provider=EGL"
+ "--with-pthreads"
+ "--with-x"
+ ;; Avoid bundled libraries.
+ ;; UNBUNDLE-ME! "--enable-system-sqlite"
+ ;; UNBUNDLE-ME! "--with-system-bz2"
+ ;; UNBUNDLE-ME! "--with-system-graphite2"
+ ;; UNBUNDLE-ME! "--with-system-harfbuzz"
+ ;; UNBUNDLE-ME! "--with-system-libevent"
+ ;; UNBUNDLE-ME! "--with-system-libvpx"
+ ;; UNBUNDLE-ME! "--with-system-nss" ; pending upgrade of 'nss' to 3.90
+ ;; UNBUNDLE-ME! "--with-system-ogg"
+ ;; UNBUNDLE-ME! "--with-system-theora" ; wants theora-1.2, not yet released
+ ;; UNBUNDLE-ME! "--with-system-vorbis"
+ ;; UNBUNDLE-ME! "--with-system-jpeg" ;must be libjpeg-turbo
+ ;; UNBUNDLE-ME! "--with-system-zlib"
+ ;; UNBUNDLE-ME! "--with-system-icu"
+ ;; UNBUNDLE-ME! "--with-system-png" ;must be libpng-apng
+ #$(if with-gtk3? ;; NPAPI requires gtk2. It's for Adobe Flash and Silverlight.
+ "--disable-npapi"
+ "--enable-npapi")
+ #$(if with-gtk3? ;; TODO: find a way to link atk_bridge_adaptor_init
+ "--disable-accessibility"
+ "--enable-accessibility"))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-prefs
@@ -172,8 +175,8 @@
;; 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"))
+ ;; 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
@@ -221,17 +224,38 @@
(bin (string-append #$output "/bin")))
(mkdir-p lib)
(mkdir-p bin)
- (invoke tar "xJpf" #$dist-tarball "-C" lib)
+ (invoke tar "xJpf" #$tarball-dist "-C" lib)
(symlink (format #f "~a/~a/~a" lib #$name #$name)
(format #f "~a/~a" bin #$name)))))
(add-after 'install 'wrap-program
(lambda* (#:key inputs #:allow-other-keys)
(wrap-program (format #f "~a/lib/~a/~a" #$output #$name #$name)
`("GDK_BACKEND" = ("x11"))
- `("MOZ_ENABLE_WAYLAND" = ("0")))))))))
+ `("MOZ_ENABLE_WAYLAND" = ("0")))))
+ (add-after 'install 'install-branding
+ (lambda* (#:key outputs #:allow-other-keys)
+ (install-file #$(format #f "~a/branding/official/~a.desktop" name name)
+ (string-append #$output "/share/applications/"))
+ (for-each (lambda (size)
+ (let ((dir (format #f "~a/share/icons/hicolor/~ax~a/apps" #$output size size)))
+ (mkdir-p dir)
+ (copy-file
+ (format #f "~a/default~a.png" #$branding-dir size)
+ (in-vicinity dir (format #f "~a.png" #$name)))))
+ '(16 32 48))
+ (let* ((dir (format #f "~a/share/icons/hicolor/128x128/apps" #$output)))
+ (mkdir-p dir)
+ (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)))
-(define-public palemoon (make-palemoon #:with-gtk3? #t))
+(define-public palemoon (make-palemoon #:with-gtk3? #f))
+
+(define-public palemoon-gtk3
+ (package
+ (inherit (make-palemoon #:with-gtk3? #t))
+ (name "palemoon-gtk3")))