From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id MHYZIrjq6mMtHgAAbAwnHQ (envelope-from ) for ; Tue, 14 Feb 2023 02:58:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MKwQIrjq6mNQMgAA9RJhRA (envelope-from ) for ; Tue, 14 Feb 2023 02:58:16 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 342EE30F19 for ; Tue, 14 Feb 2023 02:58:16 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Qaug3AE5; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676339896; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4d8/exqvyHTxbMMruQ59/rYx11Xa6zQrzisfEpnrLC0=; b=om1+uX8tMuP8Pv0mzyJ2y/98fWHHQfsluKaY4W9aUR3ZQ/qcbekdTMcITf0+sEF481bFkJ WBe82/Ddpob7RQK0TwnldyvHp1owrbRLKz2pWRVdG00AoOVuDoKP2P6/sewMmH0yxi6TaK 6iUxqQwSOxOAdKhbaOUpj7UHFfitOOEfhop/EqqkpZ2P+AClbjBxEFLsDYk5n/BP/Q3w1y 3aSh7XPrZovPKonG3QJqqQh14TgWaLuU1yX+RJH2iztw6En/x1wk3sKUe8VHWya0tGHn5N tQckGPmLBqPwd7E0eD0qen7nwBh33ziGUhBqE82qOLUiJne+Qs2LCYGzXh98JQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Qaug3AE5; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676339896; a=rsa-sha256; cv=none; b=Pxuf4Cbg1AIciN4co04+fAYo3yBxX1On1G+8bzEhLvvlGtDLZSFgpNKuxiPBocXBEYVkSG g3bTg+IASPsZrJ09IRZfTDa1e8KzwuO5rCXVZYoawQ6BCpaNWUcdlWdbUwBRYmVZ+C/bKo 3fuYsrJhcTckGGg946jfD0miWw0yni3h328ZQhAjJI5DgCgyhOxLBJDwDnjwYqVUZtMWBn LYoOFtX3NB7+j1rpjzPmmLcjd1ChdsspZtOFpe/DOhV1beQL8NDPk15Vmfcgl9NYxrqMRm iRP8E1PfZMlIS1WNZN3+7rZ/Yy2U6gFyxHaMMVK80et8ap4h5evZy3nf5xAmAw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRkZD-000277-Ko; Mon, 13 Feb 2023 20:57:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRkZ8-00025M-DK for bug-guix@gnu.org; Mon, 13 Feb 2023 20:57:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRkZ4-0003By-VI for bug-guix@gnu.org; Mon, 13 Feb 2023 20:57:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRkZ4-0007Xf-RI for bug-guix@gnu.org; Mon, 13 Feb 2023 20:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#32026: [PATCH 02/10] gnu: icedove: Compute a self-contained source. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 14 Feb 2023 01:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32026 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 32026@debbugs.gnu.org Cc: mhw@netris.org, ludo@gnu.org, Jonathan Brielmaier , Maxim Cournoyer Received: via spool by 32026-submit@debbugs.gnu.org id=B32026.167633979128849 (code B ref 32026); Tue, 14 Feb 2023 01:57:02 +0000 Received: (at 32026) by debbugs.gnu.org; 14 Feb 2023 01:56:31 +0000 Received: from localhost ([127.0.0.1]:52053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRkYY-0007V8-FP for submit@debbugs.gnu.org; Mon, 13 Feb 2023 20:56:31 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:38484) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRkYT-0007UC-JC for 32026@debbugs.gnu.org; Mon, 13 Feb 2023 20:56:26 -0500 Received: by mail-qv1-f42.google.com with SMTP id k28so9574277qve.5 for <32026@debbugs.gnu.org>; Mon, 13 Feb 2023 17:56:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4d8/exqvyHTxbMMruQ59/rYx11Xa6zQrzisfEpnrLC0=; b=Qaug3AE52/adojOL6EYJ03avOmpuJC4SXHu9FUUDHI4LoRHc2oFP1aHiqurjOga+4g 34IQjUNvV59REKqorPV40MXeh0doJxitO2MjCCiGBfa/9HUATVmQfC3xHzGJgah/ZYoL X7SrZmyY0LezqH398pmOQ4blmzI5s0fatUwD7QPDAU51ox3yC1tOf4xmfotQGEKNFTh3 nw9yCI/OBhrNc0rqMrHB5U60piSC2I7FPWI0aYoyGw6FWYc+0yiQYc3Wh10KTGVfF0AW nykvPqyeV4TY+0MJObDjZtb6CIPQR15xZ5sqPLeQhtOD2WENXZfAs/cvR8VUF2I8MOrG +dwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4d8/exqvyHTxbMMruQ59/rYx11Xa6zQrzisfEpnrLC0=; b=rIl6NUxCbR9EtFNlNkG99yuSIpy9X4Z+fHatQblsZVMJOov6QMs9gTtZhdMVdN3FR0 us0tYRgl1vqkR8KGyustYW9Mg0KkbWsM9JsX0NXXZWIGTyP01Lli1cNRPvpFPIQ/xdHf I1/wnHEyxa8PpLINHCbVxZMpdrawVtfVGlYvbET0MhSj/l2UHUU71SxkXxVIIKPQs6Kb JCpoLNmPN4fFXst2YKJyopvYgiWzhZkcbZWLMzmfyn80ee9TWpIIdR3f195xrjdlgNqB KCDnFyXskabG2fTtOBboItWL/A9RdBW21G4NEpNO9MhYVB7i9DjB4ZNkQJmBnHy8RoEg axfQ== X-Gm-Message-State: AO0yUKWpgdTffe8MR1hm9+qc49qHzpTu6D/GjmJwWmGNNKE8tIl+VUBn oUp838fX2Yr5XcLkgzdksUmw8Tn0daH4yEj4 X-Google-Smtp-Source: AK7set+4EQhtUL6bWevnypOKdkW3nyUYCjO7OIyQjCYTqzDGwCHQ/NCHZso2squSl1uDlsr5aV6sjA== X-Received: by 2002:ad4:5bae:0:b0:53d:3816:d79f with SMTP id 14-20020ad45bae000000b0053d3816d79fmr1878186qvq.35.1676339779720; Mon, 13 Feb 2023 17:56:19 -0800 (PST) Received: from localhost.localdomain (dsl-10-133-137.b2b2c.ca. [72.10.133.137]) by smtp.gmail.com with ESMTPSA id p205-20020a3742d6000000b0072a375c291csm10948798qka.30.2023.02.13.17.56.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 17:56:19 -0800 (PST) From: Maxim Cournoyer Date: Mon, 13 Feb 2023 20:55:47 -0500 Message-Id: <20230214015555.8643-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214015555.8643-1-maxim.cournoyer@gmail.com> References: <20230214015555.8643-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: X-Migadu-Queue-Id: 342EE30F19 X-Spam-Score: 7.28 X-Migadu-Spam-Score: 7.28 X-Migadu-Scanner: scn0.migadu.com List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: 5h/VMGr8TLPO This refactoring work is to prepare for adding a icedove-l10n package, which will reuse that source. * gnu/packages/gnuzilla.scm (comm-source->locales+changset): New procedure. (thunderbird-source): Rename to... (thunderbird-comm-source): ... here. (icedove-source): New variable. (icedove) [source]: Use it. [phases]: Remove the prepare-thunderbird-sources and rename-to-icedove phases. --- gnu/packages/gnuzilla.scm | 210 +++++++++++++++++++++++++------------- 1 file changed, 140 insertions(+), 70 deletions(-) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 7e549d93e6..8be41c2832 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -47,6 +47,7 @@ (define-module (gnu packages gnuzilla) #:use-module (guix hg-download) #:use-module (guix gexp) #:use-module (guix store) + #:use-module (guix modules) #:use-module (guix monads) #:use-module (guix utils) #:use-module (guix build-system gnu) @@ -1129,7 +1130,7 @@ (define %icedove-version "102.7.2") ;; Provides the "comm" folder which is inserted into the icecat source. ;; Avoids the duplication of Icecat's source tarball. -(define thunderbird-source +(define thunderbird-comm-source (origin (method hg-fetch) (uri (hg-reference @@ -1140,11 +1141,148 @@ (define thunderbird-source (base32 "071q0pcfvfpzx741ly1sl8anlmzx02h17w4ylfnrkwrpaclq3p6p")))) +(define (comm-source->locales+changset source) + "Given SOURCE, a checkout of the Thunderbird 'comm' component, return the +list of languages supported as well as the currently used changeset." + (match (update-mozilla-locales + (string-append source "/mail/locales/l10n-changesets.json")) + (((_ changeset locale) ...) + (values locale (first changeset))))) + +;;; To find out which changeset to use for the comm-l10n repo, use the +;;; 'comm-source->locales+changeset' procedure on the thunderbird-comm-source +;;; checkout directory. The complete localization data will be released as a +;;; tarball starting with 102.2.8 (see: +;;; https://bugzilla.mozilla.org/show_bug.cgi?id=1810727). When this tarball +;;; is available, it should replace the complete 'l10n' directory at the root +;;; of the IceCat source, instead of only the 'calendar', chat and mail +;;; directories that it provides. +(define thunderbird-comm-l10n + (let* ((changeset "5b6788295358") + (version (git-version %icedove-version "0" changeset))) + (origin + (method hg-fetch) + (uri (hg-reference + (url "https://hg.mozilla.org/projects/comm-l10n") + (changeset changeset))) + (file-name (git-file-name "comm-l10n" version)) + (sha256 + (base32 + "1jrsmkscjjllcfawi3788vwm53wn25inbhdis5nk4vfpr7wk5ill"))))) + +(define icedove-source + (let ((name (string-append "icedove-" %icedove-version))) + (origin + (method computed-origin-method) + (file-name (string-append name ".tar.xz")) + (sha256 #f) + (uri + (delay + (with-imported-modules (source-module-closure '((guix build utils))) + #~(begin + (use-modules (guix build utils) + (sxml simple)) + + (set-path-environment-variable + "PATH" '("bin") + (list #+(canonical-package tar) + #+(canonical-package xz))) + + ;; Extract the base Icecat tarball, renaming its top-level + ;; directory. + (invoke "tar" "--transform" (string-append "s,[^/]*," #$name ",") + "-xf" #$icecat-source) + (chdir #$name) + + ;; Merge the Thunderdbird localization data. + (copy-recursively #$thunderbird-comm-l10n "l10n") + + ;; Add the Thunderbird-specific "comm" directory.. + (mkdir "comm") + (copy-recursively #$thunderbird-comm-source "comm") + (delete-file "sourcestamp.txt") + + ;; Adjust the application name. + (substitute* "comm/mail/confvars.sh" + (("MOZ_APP_NAME=thunderbird") + "MOZ_APP_NAME=icedove") + (("MOZ_UPDATER=1") + "MOZ_UPDATER=0")) + + ;; Remove branding to comply with Mozilla's trademark policy + (with-directory-excursion "comm/mail/branding/nightly" + (delete-file "content/about-wordmark.svg") + (call-with-output-file "content/about-wordmark.svg" + (lambda (port) + (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg") + (viewBox "0 0 789.1 90.78") + (width "333") + (height "48") + (fill "#fff")) + (text (@ (x "400") (y "70") + (text-anchor "middle") + (font-size "90")) + "Icedove Daily")) + port))) + (substitute* '("locales/en-US/brand.properties" + "locales/en-US/brand.ftl" + "locales/en-US/brand.dtd" + "configure.sh") + (("Thunderbird") "Icedove") + (("mozilla.org") "guix.gnu.org"))) + ;; Remove other mentions of Thunderbird in user-visible text. + (with-directory-excursion "comm/mail/base/content" + (substitute* '("overrides/app-license-name.html") + (("Thunderbird") "Icedove"))) + (with-directory-excursion "comm/mail/components/" + (substitute* '("MailGlue.jsm" + "extensions/schemas/addressBook.json" + "extensions/schemas/tabs.json" + "extensions/schemas/cloudFile.json" + "extensions/schemas/chrome_settings_overrides.json" + "extensions/schemas/windows.json" + "extensions/parent/ext-mail.js" + "im/messages/mail/Info.plist" + "enterprisepolicies/moz.build" + "enterprisepolicies/helpers/moz.build" + "enterprisepolicies/schemas/moz.build") + (("Thunderbird") "Icedove"))) + (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js" + "comm/mail/base/content/customizeToolbar.js" + "comm/suite/components/customizeToolbar.js") + (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e) + (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e))) + + ;; Override addon URLs and settings + (substitute* "comm/mail/app/profile/all-thunderbird.js" + (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m) + (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");")) + (("(pref\\(\"extensions.getAddons.search.url\").*" _ m) + (string-append m ", \"https://guix.gnu.org/packages\");")) + (("(pref\\(\"extensions.update.enabled\").*" _ m) + (string-append m ", false);")) + (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m) + (string-append m ", false);")) + (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m) + (string-append m ", false);"))) + + ;; Step out of the directory and create the tarball. + (chdir "..") + (format #t "Packing Icedove source tarball...~%") + (force-output) + (setenv "XZ_DEFAULTS" (string-join (%xz-parallel-args))) + (invoke "tar" "cfa" #$output + "--mtime=@315619200" ;1980-01-02 UTC + "--owner=root:0" + "--group=root:0" + "--sort=name" + #$name)))))))) + (define-public icedove (package (name "icedove") (version %icedove-version) - (source icecat-source) + (source icedove-source) (properties `((cpe-name . "thunderbird_esr"))) (build-system gnu-build-system) @@ -1158,11 +1296,6 @@ (define-public icedove ,@%gnu-build-system-modules) #:phases #~(modify-phases %standard-phases - (add-after 'unpack 'prepare-thunderbird-sources - (lambda _ - (mkdir "comm") - (copy-recursively #$thunderbird-source "comm") - (delete-file "sourcestamp.txt"))) (add-after 'patch-source-shebangs 'patch-cargo-checksums (lambda _ (use-modules (guix build cargo-utils)) @@ -1192,69 +1325,6 @@ (define-public icedove (substitute* "comm/mail/moz.configure" (("MOZ_DEDICATED_PROFILES, True") "MOZ_DEDICATED_PROFILES, False")))) - (add-after 'prepare-thunderbird-sources 'rename-to-icedove - (lambda _ - (substitute* "comm/mail/confvars.sh" - (("MOZ_APP_NAME=thunderbird") - "MOZ_APP_NAME=icedove") - (("MOZ_UPDATER=1") - "MOZ_UPDATER=0")) - ;; Remove branding to comply with Mozilla's trademark policy - (with-directory-excursion "comm/mail/branding/nightly" - (delete-file "content/about-wordmark.svg") - (call-with-output-file "content/about-wordmark.svg" - (lambda (port) - (sxml->xml '(svg (@ (xmlns "http://www.w3.org/2000/svg") - (viewBox "0 0 789.1 90.78") - (width "333") - (height "48") - (fill "#fff")) - (text (@ (x "400") (y "70") - (text-anchor "middle") - (font-size "90")) - "Icedove Daily")) - port))) - (substitute* '("locales/en-US/brand.properties" - "locales/en-US/brand.ftl" - "locales/en-US/brand.dtd" - "configure.sh") - (("Thunderbird") "Icedove") - (("mozilla.org") "guix.gnu.org"))) - ;; Remove other mentions of Thunderbird in user-visible text. - (with-directory-excursion "comm/mail/base/content" - (substitute* '("overrides/app-license-name.html") - (("Thunderbird") "Icedove"))) - (with-directory-excursion "comm/mail/components/" - (substitute* '("MailGlue.jsm" - "extensions/schemas/addressBook.json" - "extensions/schemas/tabs.json" - "extensions/schemas/cloudFile.json" - "extensions/schemas/chrome_settings_overrides.json" - "extensions/schemas/windows.json" - "extensions/parent/ext-mail.js" - "im/messages/mail/Info.plist" - "enterprisepolicies/moz.build" - "enterprisepolicies/helpers/moz.build" - "enterprisepolicies/schemas/moz.build") - (("Thunderbird") "Icedove"))) - (substitute* '("comm/mailnews/base/prefs/content/accountUtils.js" - "comm/mail/base/content/customizeToolbar.js" - "comm/suite/components/customizeToolbar.js") - (("AppConstants.MOZ_APP_NAME (.)= \"thunderbird" _ e) - (format #f "AppConstants.MOZ_APP_NAME ~a= \"icedove" e))) - - ;; Override addon URLs and settings - (substitute* "comm/mail/app/profile/all-thunderbird.js" - (("(pref\\(\"extensions.webservice.discoverURL\").*" _ m) - (string-append m ", \"https://directory.fsf.org/wiki/Icedove\");")) - (("(pref\\(\"extensions.getAddons.search.url\").*" _ m) - (string-append m ", \"https://guix.gnu.org/packages\");")) - (("(pref\\(\"extensions.update.enabled\").*" _ m) - (string-append m ", false);")) - (("(pref\\(\"extensions.systemAddon.update.enabled\").*" _ m) - (string-append m ", false);")) - (("(pref\\(\"lightweightThemes.update.enabled\").*" _ m) - (string-append m ", false);"))))) (add-after 'build 'neutralize-store-references (lambda _ ;; Mangle the store references to compilers & other build tools in -- 2.39.1