all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 32026@debbugs.gnu.org
Cc: mhw@netris.org, ludo@gnu.org,
	Jonathan Brielmaier <jonathan.brielmaier@web.de>,
	Maxim Cournoyer <maxim.cournoyer@gmail.com>
Subject: bug#32026: [PATCH v4 6/9] gnu: Add language packs to icecat and icedove.
Date: Sun, 19 Feb 2023 14:24:02 -0500	[thread overview]
Message-ID: <20230219192405.26549-6-maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <20230219192405.26549-1-maxim.cournoyer@gmail.com>

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.

---

(no changes since v3)

Changes in v3:
- Make make-l10n-package more functional, taking inputs as arguments
- Validate the PROJECT argument in make-l10n-package

Changes in v2:
- Do not clear native-inputs and inputs in make-mozilla-with-l10n, for 'guix
shell -D icecat'

 gnu/packages/gnuzilla.scm | 133 ++++++++++++++++++++++++++++----------
 1 file changed, 100 insertions(+), 33 deletions(-)

diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 38c34251ab..ab2065054a 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -671,9 +671,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)
@@ -1295,9 +1295,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
@@ -1547,35 +1547,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 version source locales)
   "Return a package for PROJECT, a symbol (either icecat or icedove), with
 their corresponding VERSION, SOURCE and LOCALES variables."
@@ -1698,6 +1669,102 @@ (define-public icecat-l10n
 (define-public icedove-l10n
   (make-l10n-package 'icedove %icedove-version icedove-source %icedove-locales))
 
+;;; 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 base l10n-package)
+  "Return a package definition for PROJECT (a symbol such as 'icecat or
+'icedove) that combines the BASE package with L10N-PACKAGE."
+
+  (unless (member project '(icecat icedove))
+    (error "only icecat or icedove components are currently supported"))
+
+  (let ((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)))))))))
+
+(define-public icecat
+  (make-mozilla-with-l10n 'icecat icecat-minimal icecat-l10n))
+
+(define-public icedove
+  (make-mozilla-with-l10n 'icedove icedove-minimal icedove-l10n))
+
+(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
     (name "firefox-decrypt")
-- 
2.39.1





  parent reply	other threads:[~2023-02-19 19:27 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-01 20:23 bug#32026: IceCat locales are missing? Ludovic Courtès
2023-02-14  1:55 ` bug#32026: [PATCH 00/10] Add proper locale support to IceCat and Icedove Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 01/10] gnu: Add a 'update-mozilla-locales' helper for maintenance Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 02/10] gnu: icedove: Compute a self-contained source Maxim Cournoyer
2023-02-14 21:32     ` Jonathan Brielmaier
2023-02-16  0:55       ` Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 03/10] gnu: Define UPSTREAM-FIREFOX-SOURCE at the top level Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 04/10] gnu: icecat: Update the "ach" locale Maxim Cournoyer
2023-02-15  6:39     ` Mark H Weaver
2023-02-14  1:55   ` bug#32026: [PATCH 05/10] gnu: icecat: Add a patch that makes building language packs reproducible Maxim Cournoyer
2023-02-14  7:58     ` Mark H Weaver
2023-02-14 13:58       ` Maxim Cournoyer
2023-02-14 21:06         ` Mark H Weaver
2023-02-15 21:32           ` Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 06/10] gnu: Add icecat-l10n and icedove-l10n Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 07/10] gnu: icedove: Automatically load system-provided extensions Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 08/10] gnu: Add language packs to icecat and icedove Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 09/10] gnu: icedove: Use the locale of the system Maxim Cournoyer
2023-02-14  1:55   ` bug#32026: [PATCH 10/10] gnu: icecat: " Maxim Cournoyer
2023-02-14  9:23     ` Mark H Weaver
2023-02-14 14:00       ` Maxim Cournoyer
2023-02-16  4:36 ` bug#32026: [PATCH 01/10] gnu: Add a 'update-mozilla-locales' helper for maintenance Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 02/10] gnu: icedove: Compute a self-contained source Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 03/10] gnu: Define UPSTREAM-FIREFOX-SOURCE at the top level Maxim Cournoyer
2023-02-16 22:26     ` Mark H Weaver
2023-02-17  2:55       ` Maxim Cournoyer
2023-02-18 20:46         ` Mark H Weaver
2023-02-19 17:43           ` Maxim Cournoyer
2023-02-20  1:06           ` Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 04/10] gnu: icecat: Make language packs reproducible Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 05/10] gnu: Add icecat-l10n and icedove-l10n Maxim Cournoyer
2023-02-16 22:45     ` Mark H Weaver
2023-02-17  3:37       ` Maxim Cournoyer
2023-02-18 20:22         ` Mark H Weaver
2023-02-18 20:42           ` Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 06/10] gnu: icedove: Automatically load system-provided extensions Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 07/10] gnu: Add language packs to icecat and icedove Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 08/10] gnu: icedove: Use the locale of the system Maxim Cournoyer
2023-02-16  4:36   ` bug#32026: [PATCH 09/10] gnu: icecat: Remove gtk+-2 input Maxim Cournoyer
2023-02-16 22:50     ` Mark H Weaver
2023-02-16  4:36   ` bug#32026: [PATCH 10/10] gnu: icecat: Unbundle nss and nspr Maxim Cournoyer
2023-02-16 22:14     ` Mark H Weaver
2023-02-17 19:44       ` Maxim Cournoyer
2023-02-18  1:02         ` Mark H Weaver
2023-02-18 14:09           ` Maxim Cournoyer
2023-02-16 22:05   ` bug#32026: [PATCH 01/10] gnu: Add a 'update-mozilla-locales' helper for maintenance Mark H Weaver
2023-02-17  2:25     ` Maxim Cournoyer
2023-02-17 12:55 ` bug#32026: [PATCH v3 01/11] " Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 02/11] gnu: icedove: Compute a self-contained source Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 03/11] gnu: Define UPSTREAM-FIREFOX-SOURCE at the top level Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 04/11] gnu: icecat: Make language packs reproducible Maxim Cournoyer
2023-02-18 21:02     ` Mark H Weaver
2023-02-19 17:35       ` Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 05/11] gnu: Add icecat-l10n and icedove-l10n Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 06/11] gnu: icedove: Automatically load system-provided extensions Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 07/11] gnu: Add language packs to icecat and icedove Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 08/11] gnu: icedove: Use the locale of the system Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 09/11] gnu: icecat: Remove gtk+-2 input Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 10/11] gnu: nss-next: Update to 3.88.1 [fixes CVE-2023-0767] Maxim Cournoyer
2023-02-17 21:38     ` Mark H Weaver
2023-02-18 17:27       ` Maxim Cournoyer
2023-02-18 19:49         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2023-02-18 20:45           ` Maxim Cournoyer
2023-02-17 12:55   ` bug#32026: [PATCH v3 11/11] gnu: icecat: Unbundle nss and nspr Maxim Cournoyer
2023-02-19 19:23 ` bug#32026: [PATCH v4 1/9] gnu: Add a 'update-mozilla-locales' helper for maintenance Maxim Cournoyer
2023-02-19 19:23   ` bug#32026: [PATCH v4 2/9] gnu: icedove: Compute a self-contained source Maxim Cournoyer
2023-02-19 19:23   ` bug#32026: [PATCH v4 3/9] gnu: Define %icecat-base-version at the top level Maxim Cournoyer
2023-02-19 20:13     ` Mark H Weaver
2023-02-19 22:14       ` Maxim Cournoyer
2023-02-19 19:24   ` bug#32026: [PATCH v4 4/9] gnu: Add icecat-l10n and icedove-l10n Maxim Cournoyer
2023-02-19 19:24   ` bug#32026: [PATCH v4 5/9] gnu: icedove: Automatically load system-provided extensions Maxim Cournoyer
2023-02-19 19:24   ` Maxim Cournoyer [this message]
2023-02-19 19:24   ` bug#32026: [PATCH v4 7/9] gnu: icedove: Use the locale of the system Maxim Cournoyer
2023-02-19 19:24   ` bug#32026: [PATCH v4 8/9] gnu: icecat: Remove gtk+-2 input Maxim Cournoyer
2023-02-19 19:24   ` bug#32026: [PATCH v4 9/9] gnu: icecat: Unbundle nss and nspr Maxim Cournoyer
2023-02-19 20:17   ` bug#32026: [PATCH v4 1/9] gnu: Add a 'update-mozilla-locales' helper for maintenance Mark H Weaver
2023-02-19 23:17     ` Maxim Cournoyer
2023-02-20 11:06   ` Ludovic Courtès
2023-02-20 15:35     ` Maxim Cournoyer
2023-02-22  9:19       ` bug#32026: LibreOffice locales Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230219192405.26549-6-maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=32026@debbugs.gnu.org \
    --cc=jonathan.brielmaier@web.de \
    --cc=ludo@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.