From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iBPVGyd48mMLNQEAbAwnHQ (envelope-from ) for ; Sun, 19 Feb 2023 20:27:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oGjhGid48mMDPAEAG6o9tA (envelope-from ) for ; Sun, 19 Feb 2023 20:27:35 +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 EE9DFFB7F for ; Sun, 19 Feb 2023 20:27:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTpJz-0005qQ-IY; Sun, 19 Feb 2023 14:26:03 -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 1pTpJy-0005oO-4c for bug-guix@gnu.org; Sun, 19 Feb 2023 14:26:02 -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 1pTpJx-0007E7-S1 for bug-guix@gnu.org; Sun, 19 Feb 2023 14:26:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTpJx-0000qK-OW for bug-guix@gnu.org; Sun, 19 Feb 2023 14:26:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#32026: [PATCH v4 2/9] gnu: icedove: Compute a self-contained source. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 19 Feb 2023 19:26:01 +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.16768347103079 (code B ref 32026); Sun, 19 Feb 2023 19:26:01 +0000 Received: (at 32026) by debbugs.gnu.org; 19 Feb 2023 19:25:10 +0000 Received: from localhost ([127.0.0.1]:49687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTpJ7-0000na-Ti for submit@debbugs.gnu.org; Sun, 19 Feb 2023 14:25:10 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:38738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTpJ6-0000nK-4X for 32026@debbugs.gnu.org; Sun, 19 Feb 2023 14:25:08 -0500 Received: by mail-qt1-f171.google.com with SMTP id f1so637511qtb.5 for <32026@debbugs.gnu.org>; Sun, 19 Feb 2023 11:25:08 -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=gAERYfHw10sPYX0GMXYoSVJ9W45vsWrwebio7nV/gCY=; b=V/jQyIsnR7QglF/Rj1rc0irCChAgibZInErv1Jv9z0cdphu4/iEtDWYpnxjfhKeudH xKw4JP/ICJDe6Q+TOdjmVjvp5KCztRpXi+8wRQ7a5tF/RHW89DF2wEHUzWmGxjnGwOhr aqJ5gtpMaGULOFc1RM+Tk/BH9XnQ34Yr/NK6AW3QOmp32K5+/2eyXFdX3wEISI/cUOJv N9p+NYPqhOjckqYFGMf8nqrHmZWwMwb+cdtI1ckRsdWMKDKZkzCpuLjrmmRMunVZhZMr 0W3tOnYilr44LQYcMg772xknYVJa8W8oIPNqIWqEJ63N7Q28eSeOmXgpk9P8N3Uatfxq gb/w== 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=gAERYfHw10sPYX0GMXYoSVJ9W45vsWrwebio7nV/gCY=; b=MTcdxXLr1JhQCf+Dsm/xY6dk9KwVGE8m1KiloK2Fm/Ah/VnhlXWjQ19n51BQvQGx4d 1wyvID+TYZQHLY6O76RDvYlMyr/v1eoUj40Pprc4ayREncGp2Q2gnbXuh3YqITGKGWAO HCR7S1Kw4DIfIJv5jIhcYAGg19g2t15fmXqHQEyLOlfkKdp4jzkcezjP5yuVtf+V84dE RsajruRZSJ8Bjau8xalOTqC9O7oS7R1p53GL6bt3+48G2uq93n+M2FnEKCUg2TYooeV4 2WZbKvSLWYsayVmDVT6lpqLGQVT4Aka6pMvA2ttC+Pa0TZHzUNMK44x4P6Yq3isRVG5g 3fYg== X-Gm-Message-State: AO0yUKWfDFRzCywhZCzjl0bU/yxp4hJ37THDDe7ib5DLhpxBa8pczHD9 cg7Ab9pFGn5YO7ssr3DhWmNfrKQfxco3Ug== X-Google-Smtp-Source: AK7set93vYwLGTX0eZjRlPbPfvCe7vIkSfXHpfotgC2SJRTzX7ZEV216tunipzibc/f9HzOUxy2UHw== X-Received: by 2002:a05:622a:1906:b0:3ba:3ac7:ccf1 with SMTP id w6-20020a05622a190600b003ba3ac7ccf1mr13643995qtc.58.1676834702445; Sun, 19 Feb 2023 11:25:02 -0800 (PST) Received: from localhost.localdomain (dsl-158-213.b2b2c.ca. [66.158.158.213]) by smtp.gmail.com with ESMTPSA id bz18-20020a05622a1e9200b003be56bdd3b1sm3288914qtb.92.2023.02.19.11.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Feb 2023 11:25:02 -0800 (PST) From: Maxim Cournoyer Date: Sun, 19 Feb 2023 14:23:58 -0500 Message-Id: <20230219192405.26549-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230219192405.26549-1-maxim.cournoyer@gmail.com> References: <20230219192405.26549-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: 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 ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="V/jQyIsn"; 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=1676834855; a=rsa-sha256; cv=none; b=aMJMbmn7h/h27E5b64qTJjrJtYBR3Op1nMTYrBtzBH7afWh2r4bGRTuJhoQ4uBnUhz0xIN MpxOctmmnkVnDW36C9y/zt6A7yN584jwFi4BPhr/Ywl+gPCzkybNUB+1pGpOljDsnSTRtQ NWF07GaeiIIOhhNekss0pMEYuiEwnntBR0ZTnPT5tN1kt+IK9OiaW7ZhSSNPUajwtFXm3u 2AVKVY+6kAuekmfvjD5mas4TJ/aiCl2M7AA/quL6AdNVAjNem/ei+6sJagdlXwGSG5wIXx QTyVMpmjNFouD332+k1ICBe+R2Gu2UgDn+FXU+0MtVAJQuXD8BKibwrviRcHTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676834855; 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=gAERYfHw10sPYX0GMXYoSVJ9W45vsWrwebio7nV/gCY=; b=sdwTdUQoBJDdiOqqYFUmFTgRxMjPWHsErtXI4cv+oGyQFQJwiC2c8wInUEUrHmSQ4W92BB 7tuDXxIG35+0ZWNSI9ndK6Sv3jn7BA4SZW20oKs/vHsDEPUVn6SvgFw4+/1tycT4hKS5aR x2tC4ixf5iGwL5pAgpBVt0OJNqgShShR82K0AnU3S+/VgMuhFbjbCpC8CzKUpsS4GzwSMm hH/ViOm4NuDlJbj6gmsl+W8llHp+JtASfTZuMs+F5+rQJ1k2J7IRaSqfK6/KCRK4L2SAoJ e9FsOXdtWPzEcEfVK8HtTN6MifEix4UDoSWcTRfx4nJcSEC3H5sfMuZnlfnJeQ== X-Migadu-Spam-Score: -0.04 X-Spam-Score: -0.04 X-Migadu-Queue-Id: EE9DFFB7F X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="V/jQyIsn"; 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) X-TUID: GWO1Z/co+WmB 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. --- (no changes since v2) Changes in v2: - Fix typo in comm-source->locales+changset - Reword comment 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 16e2208426..3a742d06c6 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) @@ -1119,7 +1120,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 @@ -1130,11 +1131,148 @@ (define thunderbird-source (base32 "071q0pcfvfpzx741ly1sl8anlmzx02h17w4ylfnrkwrpaclq3p6p")))) +(define (comm-source->locales+changeset 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 should be released as +;;; a tarball in the next release (see: +;;; https://bugzilla.mozilla.org/show_bug.cgi?id=1817086). 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) @@ -1148,11 +1286,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)) @@ -1182,69 +1315,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