From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 8BsHOJR572OBWAEAbAwnHQ (envelope-from ) for ; Fri, 17 Feb 2023 13:56:52 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ADPgN5R572NgGwAAauVa8A (envelope-from ) for ; Fri, 17 Feb 2023 13:56:52 +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 84BCF160A3 for ; Fri, 17 Feb 2023 13:56:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pT0Hb-0001z1-GV; Fri, 17 Feb 2023 07:56: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 1pT0HT-0001sT-Gd for bug-guix@gnu.org; Fri, 17 Feb 2023 07:56:03 -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 1pT0HT-0007eH-7g for bug-guix@gnu.org; Fri, 17 Feb 2023 07:56:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pT0HT-0001q1-3J for bug-guix@gnu.org; Fri, 17 Feb 2023 07:56:03 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#32026: [PATCH v3 02/11] gnu: icedove: Compute a self-contained source. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 17 Feb 2023 12:56: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.16766385617040 (code B ref 32026); Fri, 17 Feb 2023 12:56:02 +0000 Received: (at 32026) by debbugs.gnu.org; 17 Feb 2023 12:56:01 +0000 Received: from localhost ([127.0.0.1]:38767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT0HQ-0001pK-Eg for submit@debbugs.gnu.org; Fri, 17 Feb 2023 07:56:01 -0500 Received: from mail-qt1-f180.google.com ([209.85.160.180]:33676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pT0HL-0001oW-Pp for 32026@debbugs.gnu.org; Fri, 17 Feb 2023 07:55:56 -0500 Received: by mail-qt1-f180.google.com with SMTP id bc7so574845qtb.0 for <32026@debbugs.gnu.org>; Fri, 17 Feb 2023 04:55:55 -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=6g/cR+RCp1qZ63oDvkDwMVTm9niVT+ahcKo+DlCLf+Y=; b=e5Z+SFtW/oTnDcegmWNlYtJd0rNWWstkO+4EmbKwtgItiJvEJs/IfdLkaHtT8oFsPt P0wj1iXm6EKheh5E2UWUwmMhh+7QZQXDoues3Z21zeXh1sbUOEgzPSheEbL5l3+Xv8T7 ex0bc222JdG3sdC19VQtKN0rwdK9bG6XekbTvJrvqv6wzaemjTAcZQeIFsTjvqPoltgh kqS7sfczBBYpyR3BdCtUW0vrv/uAIBd0+E5B/gm+IadUQl+EWD0ei4F98etGwSI+Otgz ZENolEDzZgLV/NuFniqeMI0xs3y5NhJOA+npVJjF0mwyEUDFkOPTT41HO1pSw8RGSjyu vKDA== 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=6g/cR+RCp1qZ63oDvkDwMVTm9niVT+ahcKo+DlCLf+Y=; b=3k54KK7RS5DlhWKiWef9ON96kVX4P9cgWnENDYht/EC2VayAmkusAcBVioYNCnKSkT gyQ5Ag345teMHqAeJIjAgefb1Uw/kMZl1PGR6ECveN9kjy72VGEGTghFm525O0ZwA4Xd zPjAIgbk12gtSsDzAjyIskxctqRx9FXkm13M9kaSPzJPBrigp0RyhnPcI/ux7jduv1Wi GP3WJNLMaqR9+isWms4lQaEAFphq2KxKI1kII4dP4ScCYrtYHkWWMWeQif3hpRtdQaCL Gv8BXU+m3uUrZnKcONORjrvycf0soyYN46x2yhI764ZwLjJI80EcMYhVyZOZDFMRx0h5 W/4Q== X-Gm-Message-State: AO0yUKWBlBH9MX8jO6ig1E/L2+pP/R/7SiFniGnzjOA9G0gaNcA0wU+g ErJeo3UQdXzIsVoNSyCNQarGMOnBc/lJn+3S X-Google-Smtp-Source: AK7set+ORXec/PdebXSknDPQ0YlBuNXxnWx/EM0OyRhZcn2ccaaDecCVUDpYZemd1sajREQuSmeA0Q== X-Received: by 2002:a05:622a:28b:b0:3b8:5ad9:3fe8 with SMTP id z11-20020a05622a028b00b003b85ad93fe8mr17092011qtw.48.1676638549965; Fri, 17 Feb 2023 04:55:49 -0800 (PST) Received: from localhost.localdomain (dsl-157-123.b2b2c.ca. [66.158.157.123]) by smtp.gmail.com with ESMTPSA id f17-20020ac80691000000b003b9b48cdbe8sm3176026qth.58.2023.02.17.04.55.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 04:55:49 -0800 (PST) From: Maxim Cournoyer Date: Fri, 17 Feb 2023 07:55:29 -0500 Message-Id: <20230217125539.24467-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230217125539.24467-1-maxim.cournoyer@gmail.com> References: <20230217125539.24467-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-Seal: i=1; s=key1; d=yhetil.org; t=1676638612; a=rsa-sha256; cv=none; b=Pk0vjLG6aC+9tIII4hFfc2/5sH2NkqKPDA+nASm0mzefN6Z0jBkKag6z4FCH2A9vjRQlv8 tINf6hezDSr1qR+ZYQ0+JKhy4RLBo9XMdDD+siDot7Cduk5VXNBY4wTjrT7rJzYXsk/7q3 zdXOMFYmwh4jGo0gNNXo07KV1HcdbX0QipG2rzBXyS56OG0dXszRAt83cw9pcwp/Ea3/Zn hxqJGZx+ERbcSuJAepQtAokumzjIOhx0xLH+7zYTgRYMcSoKD12AVJfdUVC/TQf2tL8csA m0/ttOU1ulPfmQGdy10YMWcklru3T5YKKpZRdhJ0A+6upwi/Q4YsmxpKB30lsw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=e5Z+SFtW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676638612; 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=6g/cR+RCp1qZ63oDvkDwMVTm9niVT+ahcKo+DlCLf+Y=; b=LimKFsvdYwK/TQpf9akPF2cvgmBfoSJtwK9bPr2G6mPY4qlyE/VpASxFhk7B/RP/AWXUxW /PscP1sMNwl48vjUuIzd1WuQ7eHpBuHpAevHL6lSU/fWr/Q9IWTM/ZuTG5saoxWMhOl7Wf DjxPvRTSVOOGv/orKstImkQ4zWZUw/+YYhhuEHtXwEswMh4BpHvQJUGBk++ShOS09AiF0f 1gE/lNZw/3rq7Vq4093qnJlJ+ZbwPp7dR5gYTIPX9kCmn9RQ8Yq/fFwos1ZeFk1gnvB6cP of68vJM5MpTo7ceBT+BaoWv0mLkceaj+Ahb9wRVBD7UyKMXTay8WeQPOPw0TIA== X-Migadu-Spam-Score: -0.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=e5Z+SFtW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: 84BCF160A3 X-Migadu-Scanner: scn1.migadu.com X-Spam-Score: -0.03 X-TUID: 1jcgXEIuawm+ 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 2011555d47..1ed52c68e9 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) @@ -1128,7 +1129,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 @@ -1139,11 +1140,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) @@ -1157,11 +1295,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)) @@ -1191,69 +1324,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