From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iCAEOlez7WO/LQAAbAwnHQ (envelope-from ) for ; Thu, 16 Feb 2023 05:38:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MIVCOlez7WM7VQEA9RJhRA (envelope-from ) for ; Thu, 16 Feb 2023 05:38:47 +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 B432A1E9C1 for ; Thu, 16 Feb 2023 05:38:47 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Q+MlHQEK; 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=1676522327; 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=L7o16M0aRhJYxSYlR8y8xTDQbleRuaMYbVcGXXf9/n8=; b=tlrStp6rf/Mp1IFHIjQUK8ndeQZUSiehjT6zdGdx24mKzPbBMn0laijvcsAcl9hunYY+li Sf9d9awQxc50Y4Nr10mM5boN4hGUO0zrIPykZQ1mTSpKd74Cou9kPhkD7lOHNy+SBckNO3 ZSwuCHu33ulckZhId4CipbhZkcrHl+vM2JVKBoYh55NBU6lyOc3YO+08u2copeRs9aE8ms ZeYwf2v+zYuVjsFqAHYb13JgPlSjdlNVXurWbods6zv3wfMM+LesVSW1qKk1lCrI4p1cnm jEpfrFd01GKnRHwJ86Ihsez+KHEvKgC9FA5QSjMZXwSk7tycCBnB+5UefETk/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=Q+MlHQEK; 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-Seal: i=1; s=key1; d=yhetil.org; t=1676522327; a=rsa-sha256; cv=none; b=bk0XbkviLCQlC8VErJE32Kiy+birc9rmWY/hRBeWChj56Ct8VahD5u0K+9zJBzJaom7tDL zB1/8wpDSniWc2yh6M8WDmwVpu9iE48i0NyvxP0efHDQa0yepdGysuU38rercOh8Oyxnd1 iBvukTQwZ12av+94h7pR+rpCzC7otCgUKlgASsNIfNGsA681r6awaE7slkvPqIj7VmxiC0 0+R6Sc/80QYjCc98zruwMmZ0yUnCAFbGrCPrS+iwie7Pm31WL4N+iLZMyYjyi0XpuL+fzJ CoVn5at3/xDqNus3hL1x4Mv9REVnKSRSO4HTibLJ8hEzqXvM+porqOPFMU7uhA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSW22-0005ym-28; Wed, 15 Feb 2023 23:38:06 -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 1pSW1z-0005xw-R4 for bug-guix@gnu.org; Wed, 15 Feb 2023 23:38: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 1pSW1z-0007gh-IG for bug-guix@gnu.org; Wed, 15 Feb 2023 23:38:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSW1y-0003Nu-Tq for bug-guix@gnu.org; Wed, 15 Feb 2023 23:38: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: Thu, 16 Feb 2023 04:38: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.167652222912815 (code B ref 32026); Thu, 16 Feb 2023 04:38:02 +0000 Received: (at 32026) by debbugs.gnu.org; 16 Feb 2023 04:37:09 +0000 Received: from localhost ([127.0.0.1]:34574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSW16-0003KS-2r for submit@debbugs.gnu.org; Wed, 15 Feb 2023 23:37:09 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:37595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSW14-0003Jq-KF for 32026@debbugs.gnu.org; Wed, 15 Feb 2023 23:37:07 -0500 Received: by mail-qt1-f171.google.com with SMTP id m12so1031331qth.4 for <32026@debbugs.gnu.org>; Wed, 15 Feb 2023 20:37:06 -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=L7o16M0aRhJYxSYlR8y8xTDQbleRuaMYbVcGXXf9/n8=; b=Q+MlHQEKz+93Y1M3aDfgyWfDb3uzo2K9ldYjGszeYaD1T246apG1ZMsoDlMEbdPbez ITjOW0xhyHWycxcchIpIEO0Lfo8pOKmg/P9f0jJbKI+Cu2pN0WEebyOyVUZATnQZdYdI fCdCSEp+jl8mP/OxJBhXDfP5aq2rf+os/ihRrhqsJwcdtEKAtZKA/w7ZqWu8e5GxJEIJ PZOE4X3sYRjyLCiusZjaibMcSPplqICZJqFG/YdbdG3YWydE0YYbYzEzDOOQ5EhnUOdb 0xRsKohOgChRjlYSgSZ9tyJX0SBKZqcQyYgYiE4ZDRF0p5V9ss0GfWuiA0wh5nurEayt b6NQ== 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=L7o16M0aRhJYxSYlR8y8xTDQbleRuaMYbVcGXXf9/n8=; b=kNAw72BpLNvQ9ViqAir2lAth13feZ8Btw6Ip4sM6xES6n3ENVMezw46ANQ4LGKdMhk YC2GL6u6nkJ2751E2g0Nkp5avIWnkIv1kH+tgMT4nagfyhTFyeraT+WF4gcGToKryhyL ldINwXkGIGwV/Paw0ubzJuziiaGG/dK8gAXpCa7pKN/+jUQ/hkPj39YmbTEfJx4tf04s hANwMNwy7MWV/2xy/WlSyfTKRN7itWQc7Mgu3hT4d6oPqll85YApWg3MUhS2T48AfnwI 9AEruTeMjTPFtmNEQqpdgPAWXaHlQEui01U6lu1mbHS6PFm02XQLLRsRGIXgwellDAm6 FVbQ== X-Gm-Message-State: AO0yUKVOHeyvjoaoS1MexY9abTznE102dXlZe9lxdDRxM+LX6OgfoBa+ FaLjfZUfWfu8EXW1V9NFAnEVXdXnfVkBcTui X-Google-Smtp-Source: AK7set+sUH0q5F6sys5nblzigzdgqfrqzXzz3UWqdeyu8q55vfEW608LMRVIKM/l9YpTuRQ2Dw27Xg== X-Received: by 2002:a05:622a:2d5:b0:3b6:30ea:e95 with SMTP id a21-20020a05622a02d500b003b630ea0e95mr7829928qtx.18.1676522220827; Wed, 15 Feb 2023 20:37:00 -0800 (PST) Received: from localhost.localdomain (dsl-155-109.b2b2c.ca. [66.158.155.109]) by smtp.gmail.com with ESMTPSA id t85-20020a374658000000b007186c9e167esm452992qka.52.2023.02.15.20.37.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 20:37:00 -0800 (PST) From: Maxim Cournoyer Date: Wed, 15 Feb 2023 23:36:40 -0500 Message-Id: <20230216043649.32119-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230216043649.32119-1-maxim.cournoyer@gmail.com> References: <20230216043649.32119-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: B432A1E9C1 X-Spam-Score: 7.98 X-Migadu-Spam-Score: 7.98 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: +2OsodGyV0nr 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. --- 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