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 GGx8BL7q6mN4OAAAbAwnHQ (envelope-from ) for ; Tue, 14 Feb 2023 02:58:22 +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 UGl0BL7q6mNArAAA9RJhRA (envelope-from ) for ; Tue, 14 Feb 2023 02:58:22 +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 BDAB430E30 for ; Tue, 14 Feb 2023 02:58:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRkZF-00028Y-M4; Mon, 13 Feb 2023 20:57:13 -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 1pRkZC-00025u-08 for bug-guix@gnu.org; Mon, 13 Feb 2023 20:57:10 -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 1pRkZ6-0003F4-S1 for bug-guix@gnu.org; Mon, 13 Feb 2023 20:57:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRkZ6-0007YI-O3 for bug-guix@gnu.org; Mon, 13 Feb 2023 20:57:04 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#32026: [PATCH 06/10] gnu: Add icecat-l10n and icedove-l10n. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 14 Feb 2023 01:57:04 +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.167633979828904 (code B ref 32026); Tue, 14 Feb 2023 01:57:04 +0000 Received: (at 32026) by debbugs.gnu.org; 14 Feb 2023 01:56:38 +0000 Received: from localhost ([127.0.0.1]:52065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRkYf-0007W2-BG for submit@debbugs.gnu.org; Mon, 13 Feb 2023 20:56:38 -0500 Received: from mail-qt1-f169.google.com ([209.85.160.169]:43004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRkYb-0007Uy-9k for 32026@debbugs.gnu.org; Mon, 13 Feb 2023 20:56:34 -0500 Received: by mail-qt1-f169.google.com with SMTP id 5so16073334qtp.9 for <32026@debbugs.gnu.org>; Mon, 13 Feb 2023 17:56:33 -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=32sjDwXvy22m8tQDs7s+aN1UxuNe4MMt7+OlOANAi54=; b=JoL+m7vQCeGc40aVEpWFhW4OH78i9GIKh1IfNl8GKt5ShTULnPtrP13sFhHcaz9kiq 4XkMSn/v78zmYfyKHZhvR4shWXxRg1rbAOPsSo2RoNIpByjyvYKYsO4CHQfD7l2ibnaD Zop83b48sFppiyoRrkAXcYUqAHIANNeruBsuDSV+jIz4SDABAvdsapcI66xEMQSQQVPh G1MIeVJDoZgVP306vGbxQE1jjn3M+oZx+HPX+a53/9S2draGHf4vMVBX5/wnxmHzHwRl RrMUh1xnahg84zfvi2myOffSkaHL5rwhY5Ql1EhY9QCFoWO9EVpz2TZ25GZE7w0EDFdB lU4w== 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=32sjDwXvy22m8tQDs7s+aN1UxuNe4MMt7+OlOANAi54=; b=n+4V1qj52KUuRUMFyo7+4YLOPkr5K8VjjbKubXCARo3h+PhdpWQtIcOnhvZszdo4Ny KFZsd7qlpTjf+chwslPXTw2mOZzo0m3KuDl+32YydFe31OPyRVuI7p7H3E8biiCgN69x 7OFV++XTfOT3nqE7hI2nJ9CDx396yZW/THPaLE7TJsokFhgGt0VnGIHWZspg3fCP1FB1 prGjEhScpHgpV+7X5COCUIWUCWBlZitgJ+NiuqxNxINvjUpE7EVQBJBNKfCyOubP+px7 C3u7ntLlSgw045Yonm2vKDQ/VhiCifuzTXwhfcO2UQumfDAvUewqtzy+oTMQn6eGuTIU UzxA== X-Gm-Message-State: AO0yUKVO3uOVcgFSwj3hRP+cBZWlTpSawHpvDt86TK2BhWDpsWh1viwR 5NM99vYxseDTrZwYMIcrDWw1aFWd6yyrC5aS X-Google-Smtp-Source: AK7set9NowKesR1zOKqIx/+XtHJoo+vu+7KsdJ6rimj+XvqBvkPLpmyU3i43TzIr/xMiYbWO9ptmyQ== X-Received: by 2002:a05:622a:1cf:b0:3b6:30ac:e887 with SMTP id t15-20020a05622a01cf00b003b630ace887mr968007qtw.64.1676339787552; Mon, 13 Feb 2023 17:56:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 17:56:27 -0800 (PST) From: Maxim Cournoyer Date: Mon, 13 Feb 2023 20:55:51 -0500 Message-Id: <20230214015555.8643-7-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-Type: text/plain; charset=utf-8 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676339901; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=32sjDwXvy22m8tQDs7s+aN1UxuNe4MMt7+OlOANAi54=; b=aPTUL0PzDIUNW4DlfmtqeP+M8VwkEvbKfcGmShDdRlbJlsqrPnOO5He+DIYtxo7eVbR0v0 fBZFitDpmgYTJpo1hMraxzFNQXrCtxJTfa+P1pe/OQbnTNyGZwm34AZbGaRHOei0CP8Itd AHQ1/nQBgZWStoVlfMZEywx0OwEmq+4pZUz84Zsorvfk6LZ8RoCaceM81JHE/a0nAVmLLH Miq0x/O+iDX/9kSoJ2B9wu39S161NLnuAUdLw/PFva4toOjjT+BEcXcySSSzjjfl61iAZM wG3z38C9s0DfbCiwHFdV7ITf2ACpG3enwDEJh+Z5MbKleTqSvdQi311v9N94YA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JoL+m7vQ; 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=1676339901; a=rsa-sha256; cv=none; b=GjihuEZB4DH57cHVSs9E1+v5pWy+kLkAl2L+667BfDMUzRpwP/OdAJz9tNuSqWKNT0B4Ff SptpQt5VeyHq7M7g6zhEj9VrQCg4rcvCby0wxX3Esw/1a2gYiyAHPQNK//IyOzDSg45vm0 p53tEalKSXIZHlz+kkU4aXA745ByiSsAseojQFO1fmk4mLS9Pw2cg1D1hqcYpE1DU8Pj6r wNO9fGV2D7lCL1VGm/G1wA5GclTQ2WzD4bPwaPj4odtDQ4mT3lOB3YGU2Q27byiPQS/q6V qACsH+siOa9dMyR6mUrq+dOOeDO3eWXpymYkMexbOuXWUN643N5ace6YvNWHPw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.52 X-Spam-Score: -0.52 X-Migadu-Queue-Id: BDAB430E30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JoL+m7vQ; 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: YFSaJg7UP5lP * gnu/packages/gnuzilla.scm (%icecat-locales, %icedove-locales): New variable. (make-l10n-package): New procedure. (icecat-l10n, icedove-l10n): New variables. --- gnu/packages/gnuzilla.scm | 146 +++++++++++++++++++++++++++++++++++++- 1 file changed, 145 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index db7ca5ceb2..d7c4d6013c 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -17,7 +17,7 @@ ;;; Copyright © 2020, 2022 Marius Bakke ;;; Copyright © 2021 Brice Waegeneire ;;; Copyright © 2021 Maxime Devos -;;; Copyright © 2021, 2022 Maxim Cournoyer +;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer ;;; Copyright © 2021 Baptiste Strazzul ;;; ;;; This file is part of GNU Guix. @@ -1124,6 +1124,16 @@ (define (runpaths-of-input label) (cpe-name . "firefox_esr") (cpe-version . ,(first (string-split version #\-))))))) +(define %icecat-locales + '("ach" "af" "an" "ar" "ast" "az" "be" "bg" "bn" "br" "bs" "ca" "cak" + "ca-valencia" "cs" "cy" "da" "de" "dsb" "el" "en-CA" "en-GB" "eo" "es-AR" + "es-CL" "es-ES" "es-MX" "et" "eu" "fa" "ff" "fi" "fr" "fy-NL" "ga-IE" "gd" + "gl" "gn" "gu-IN" "he" "hi-IN" "hr" "hsb" "hu" "hy-AM" "ia" "id" "is" "it" + "ja" "ja-JP-mac" "ka" "kab" "kk" "km" "kn" "ko" "lij" "lt" "lv" "mk" "mr" "ms" + "my" "nb-NO" "ne-NP" "nl" "nn-NO" "oc" "pa-IN" "pl" "pt-BR" "pt-PT" "rm" "ro" + "ru" "sco" "si" "sk" "sl" "son" "sq" "sr" "sv-SE" "szl" "ta" "te" "th" "tl" + "tr" "trs" "uk" "ur" "uz" "vi" "xh" "zh-CN" "zh-TW")) + (define %icedove-build-id "20230207000000") ;must be of the form YYYYMMDDhhmmss (define %icedove-version "102.7.2") @@ -1148,6 +1158,15 @@ (define (comm-source->locales+changset source) (((_ changeset locale) ...) (values locale (first changeset))))) +;;; Generated with comm-source->locales+changeset. +(define %icedove-locales + '("af" "ar" "ast" "be" "bg" "br" "ca" "cak" "cs" "cy" "da" "de" "dsb" "el" + "en-CA" "en-GB" "es-AR" "es-ES" "es-MX" "et" "eu" "fi" "fr" "fy-NL" "ga-IE" + "gd" "gl" "he" "hr" "hsb" "hu" "hy-AM" "id" "is" "it" "ja" "ja-JP-mac" "ka" + "kab" "kk" "ko" "lt" "lv" "ms" "nb-NO" "nl" "nn-NO" "pa-IN" "pl" "pt-BR" + "pt-PT" "rm" "ro" "ru" "sk" "sl" "sq" "sr" "sv-SE" "th" "tr" "uk" "uz" "vi" + "zh-CN" "zh-TW")) + ;;; 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 @@ -1556,6 +1575,131 @@ (define-public icedove/wayland (native-inputs '()) (inputs '()))) +(define (make-l10n-package project) + "Return a package for PROJECT, a symbol (either icecat or icedove). +It assumes the %PROJECT-VERSION, PROJECT-SOURCE and %PROJECT-LOCALES variables +already exist." + (unless (member project '(icecat icedove)) + (error "only icecat or icedove components are currently supported")) + + (let ((name (if (eq? 'icecat project) + "IceCat" + "Icedove"))) + + (package + (name (format #f "~a-l10n" project)) + (version (module-ref (current-module) + (symbol-append '% project '-version))) + (source (module-ref (current-module) + (symbol-append project '-source))) + (outputs (cons "out" (module-ref (current-module) + (symbol-append '% project '-locales)))) + (build-system gnu-build-system) + (arguments + (list + #:modules '((guix build gnu-build-system) + (guix build utils) + (ice-9 format) + (ice-9 ftw) + (srfi srfi-1) + (srfi srfi-26)) + #:tests? #f ;no tests, this is data + #:phases + #~(modify-phases %standard-phases + (delete 'bootstrap) + (delete 'install) + (replace 'configure + (lambda _ + ;; The following configuration is inspired by guidance at + ;; https://firefox-source-docs.mozilla.org/build/buildsystem/locales.html. + (call-with-output-file ".mozconfig" + (lambda (p) + (format p "~{~a~%~}" + (list (if (eq? 'icecat '#$project) + "ac_add_options --enable-project=browser" + "ac_add_options --enable-project=comm/mail") + "ac_add_options --disable-compile-environment" + (string-append + "ac_add_options --with-l10n-base=" + (getcwd) "/l10n") + ;; Hack, otherwise the build system throws: + ;; 'RuntimeError: File "brand.dtd" not found'. + "ac_add_options --enable-official-branding" + "mk_add_options MOZ_OBJDIR=obj")))) + (setenv "CONFIG_SHELL" (which "bash")) + (setenv "MOZBUILD_STATE_PATH" + (string-append (getcwd) "/mach_state")) + (setenv "MOZCONFIG" (string-append (getcwd) "/.mozconfig")) + (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system") + (setenv "BUILD_BACKENDS" "FasterMake,RecursiveMake"))) + (replace 'build ;build and install data files + (lambda* (#:key outputs #:allow-other-keys) + (define (find-file dir name) + (let ((files (find-files dir name))) + (when (null? files) + (error "could not find file in dir" name dir)) + (car files))) + + (for-each + (lambda (l) + (let* ((out (assoc-ref outputs l)) + ;; The older lib/$project/distribution/extensions + ;; directory is deprecated. Use the newer app-global + ;; directory, which is lib/$project/extensions. + (ext-dir-prefix + (format + #f "lib/~a/~:[~;browser/~]extensions" + '#$project (eq? 'icecat '#$project))) + (all-ext (string-append #$output "/" ext-dir-prefix)) + (ext-dir (string-append out "/" ext-dir-prefix)) + ;; XXX: Because Icedove doesn't have a makeicedove + ;; script that substitutes all the Thunderbird + ;; references to Icedove, the MOZ_LANGPACK_EID + ;; defined in comm/mail/locales/Makefile.in uses + ;; 'thunderbird' in its ID extension rather than + ;; 'icedove'. + (name (format #f "langpack-~a@~a.mozilla.org.xpi" + l (if (eq? 'icedove '#$project) + 'thunderbird + '#$project)))) + (format #t "processing locale `~a'...~%" l) + (if (eq? 'icecat '#$project) + ;; XXX: For some reasons, for IceCat, there are some + ;; parsing errors that cause the build system to + ;; return an unclean exit code; use system* to ignore + ;; errors. + (system* "./mach" "build" (string-append "langpack-" l)) + (invoke "./mach" "build" (string-append "langpack-" l))) + (mkdir-p ext-dir) + (let ((xpi (find-file "obj" (string-append + "\\." l "\\.langpack\\.xpi$")))) + (copy-file xpi (string-append ext-dir "/" name)) + ;; Symlink to the main output so that a user can + ;; install all of the language packs at once. + (mkdir-p all-ext) + (symlink (string-append ext-dir "/" name) + (string-append all-ext "/" name))))) + (if (eq? 'icedove '#$project) + '#$%icedove-locales + '#$%icecat-locales))))))) + (native-inputs + (list m4 + perl + python-wrapper + node + unzip)) + (home-page "https://www.mozilla.org/") + (synopsis (string-append "Language localization data for " name)) + (description (string-append "This package contains the various language +localization data files (language pack extensions) for " name ". The +individual localization packages can be installed by using the output +associated with their name.")) + (license license:mpl2.0)))) + +(define-public icecat-l10n (make-l10n-package 'icecat)) + +(define-public icedove-l10n (make-l10n-package 'icedove)) + (define-public firefox-decrypt (package (name "firefox-decrypt") -- 2.39.1