[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32026: [PATCH 08/10] gnu: Add language packs to icecat and icedove.
From: |
Maxim Cournoyer |
Subject: |
bug#32026: [PATCH 08/10] gnu: Add language packs to icecat and icedove. |
Date: |
Mon, 13 Feb 2023 20:55:53 -0500 |
Fixes <https://issues.guix.gnu.org/32026>.
* gnu/packages/gnuzilla.scm (icecat): Rename to...
(icecat-minimal): ... this.
(icedove: Rename to...
(icedove-minimal): ... this.
(make-mozilla-with-l10n): New procedure.
(icecat, icedove): New variables.
---
gnu/packages/gnuzilla.scm | 135 ++++++++++++++++++++++++++++----------
1 file changed, 100 insertions(+), 35 deletions(-)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 2c83323c64..05f96c9622 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -680,9 +680,9 @@ (define icecat-source
"--sort=name"
icecat-dir)))))))))
-(define-public icecat
+(define-public icecat-minimal
(package
- (name "icecat")
+ (name "icecat-minimal")
(version %icecat-version)
(source icecat-source)
(build-system gnu-build-system)
@@ -1304,9 +1304,9 @@ (define icedove-source
"--sort=name"
#$name))))))))
-(define-public icedove
+(define-public icedove-minimal
(package
- (name "icedove")
+ (name "icedove-minimal")
(version %icedove-version)
(source icedove-source)
(properties
@@ -1556,35 +1556,6 @@ (define-public icedove
Thunderbird. It supports email, news feeds, chat, calendar and contacts.")
(license license:mpl2.0)))
-(define-public icedove/wayland
- (package
- (inherit icedove)
- (name "icedove-wayland")
- (build-system trivial-build-system)
- (arguments
- (list
- #:modules '((guix build utils))
- #:builder
- #~(begin
- (use-modules (guix build utils))
- (let* ((exe (string-append #$output "/bin/icedove")))
- (mkdir-p (dirname exe))
- (call-with-output-file exe
- (lambda (port)
- (format port "#!~a
- MOZ_ENABLE_WAYLAND=1 exec ~a $@"
- #$(file-append bash-minimal "/bin/bash")
- #$(file-append icedove "/bin/icedove"))))
- (chmod exe #o555)
- ;; Provide the manual and .desktop file.
- (copy-recursively (string-append #$icedove "/share")
- (string-append #$output "/share"))
- (substitute* (string-append #$output
- "/share/applications/icedove.desktop")
- ((#$icedove) #$output))))))
- (native-inputs '())
- (inputs '())))
-
(define (make-l10n-package project)
"Return a package for PROJECT, a symbol (either icecat or icedove).
It assumes the %PROJECT-VERSION, PROJECT-SOURCE and %PROJECT-LOCALES variables
@@ -1706,9 +1677,103 @@ (define (find-file dir name)
associated with their name."))
(license license:mpl2.0))))
-(define-public icecat-l10n (make-l10n-package 'icecat))
+(define icecat-l10n (make-l10n-package 'icecat))
+
+(define icedove-l10n (make-l10n-package 'icedove))
+
+;;; This hack exists because there's no way to configure extra extension
+;;; search paths for IceCat or Icedove. The global extensions directory is
+;;; constructed relatively to the executable file name.
+(define (make-mozilla-with-l10n project)
+ (let ((base (module-ref (current-module)
+ (symbol-append project '-minimal)))
+ (l10n-package (module-ref (current-module)
+ (symbol-append project '-l10n)))
+ (name (symbol->string project))
+ (icecat? (eq? 'icecat project)))
+ (package
+ (inherit base)
+ (name (symbol->string project))
+ (build-system trivial-build-system)
+ (arguments
+ (list
+ #:modules '((guix build union)
+ (guix build utils))
+ #:builder
+ #~(begin
+ (use-modules (guix build union)
+ (guix build utils))
+
+ (union-build #$output (list #$base #$l10n-package)
+ #:create-all-directories? #t)
+
+ (define* (expose name #:optional (proc copy-file)
+ #:key (source #$base))
+ (let ((dest (string-append #$output "/" name)))
+ (mkdir-p (dirname dest))
+ (proc (string-append source "/" name) dest)))
+
+ (let ((wrapper (string-append "lib/" #$name "/" #$name))
+ (real-binary (string-append "lib/" #$name "/." #$name
+ "-real"))
+ (desktop-file (string-append "share/applications/"
+ #$name ".desktop")))
+ ;; Copy wrapper file.
+ (delete-file (string-append #$output "/" wrapper))
+ (expose wrapper)
+
+ ;; Recreate bin symlink.
+ (delete-file (string-append #$output "/bin/" #$name))
+ (symlink (string-append #$output "/" wrapper)
+ (string-append #$output "/bin/" #$name))
+
+ ;; Copy actual binary.
+ (delete-file (string-append #$output "/" real-binary))
+ (expose real-binary)
+
+ ;; Copy desktop file.
+ (delete-file (string-append #$output "/" desktop-file))
+ (expose desktop-file)
+
+ ;; Adjust the references in the desktop file and wrapper.
+ (substitute* (list (string-append #$output "/" desktop-file)
+ (string-append #$output "/" wrapper))
+ ((#$base) #$output))))))
+ (native-inputs '())
+ (inputs '()))))
+
+(define-public icecat (make-mozilla-with-l10n 'icecat))
+
+(define-public icedove (make-mozilla-with-l10n 'icedove))
-(define-public icedove-l10n (make-l10n-package 'icedove))
+(define-public icedove/wayland
+ (package
+ (inherit icedove)
+ (name "icedove-wayland")
+ (build-system trivial-build-system)
+ (arguments
+ (list
+ #:modules '((guix build utils))
+ #:builder
+ #~(begin
+ (use-modules (guix build utils))
+ (let* ((exe (string-append #$output "/bin/icedove")))
+ (mkdir-p (dirname exe))
+ (call-with-output-file exe
+ (lambda (port)
+ (format port "#!~a
+ MOZ_ENABLE_WAYLAND=1 exec ~a $@"
+ #$(file-append bash-minimal "/bin/bash")
+ #$(file-append icedove "/bin/icedove"))))
+ (chmod exe #o555)
+ ;; Provide the manual and .desktop file.
+ (copy-recursively (string-append #$icedove "/share")
+ (string-append #$output "/share"))
+ (substitute* (string-append #$output
+ "/share/applications/icedove.desktop")
+ ((#$icedove) #$output))))))
+ (native-inputs '())
+ (inputs '())))
(define-public firefox-decrypt
(package
--
2.39.1
- bug#32026: [PATCH 02/10] gnu: icedove: Compute a self-contained source., (continued)
bug#32026: [PATCH 04/10] gnu: icecat: Update the "ach" locale., Maxim Cournoyer, 2023/02/13
bug#32026: [PATCH 06/10] gnu: Add icecat-l10n and icedove-l10n., Maxim Cournoyer, 2023/02/13
bug#32026: [PATCH 08/10] gnu: Add language packs to icecat and icedove.,
Maxim Cournoyer <=
bug#32026: [PATCH 07/10] gnu: icedove: Automatically load system-provided extensions., Maxim Cournoyer, 2023/02/13
bug#32026: [PATCH 10/10] gnu: icecat: Use the locale of the system., Maxim Cournoyer, 2023/02/13
bug#32026: [PATCH 03/10] gnu: Define UPSTREAM-FIREFOX-SOURCE at the top level., Maxim Cournoyer, 2023/02/13