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 4BhzJVyz7WMqtAAAbAwnHQ (envelope-from ) for ; Thu, 16 Feb 2023 05:38: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 mp11.migadu.com with LMTPS id SNuxJVyz7WPCEQAA9RJhRA (envelope-from ) for ; Thu, 16 Feb 2023 05:38: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 5EAAB39D6F for ; Thu, 16 Feb 2023 05:38:52 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSW25-00060f-6O; Wed, 15 Feb 2023 23:38:09 -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 1pSW23-0005z2-1K for bug-guix@gnu.org; Wed, 15 Feb 2023 23:38:07 -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 1pSW22-0007hK-Ow for bug-guix@gnu.org; Wed, 15 Feb 2023 23:38:06 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSW22-0003OX-JO for bug-guix@gnu.org; Wed, 15 Feb 2023 23:38:06 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#32026: [PATCH 05/10] gnu: Add icecat-l10n and icedove-l10n. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 16 Feb 2023 04:38:06 +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.167652224012919 (code B ref 32026); Thu, 16 Feb 2023 04:38:06 +0000 Received: (at 32026) by debbugs.gnu.org; 16 Feb 2023 04:37:20 +0000 Received: from localhost ([127.0.0.1]:34592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSW1G-0003MD-Fk for submit@debbugs.gnu.org; Wed, 15 Feb 2023 23:37:19 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:38749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSW18-0003KE-Gx for 32026@debbugs.gnu.org; Wed, 15 Feb 2023 23:37:11 -0500 Received: by mail-qt1-f171.google.com with SMTP id c2so1027758qtw.5 for <32026@debbugs.gnu.org>; Wed, 15 Feb 2023 20:37:10 -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=5lsuQRt1wOPVx/WV2IDx0YOMGSRnaFf7LWvDSKsVmJQ=; b=AvGknYawLj/r7bMIvBnMpEsFWSVIvy6rLLCSE55/SU3BXc/lhjkxUfktczfEQXUlWv aLsMoxvRToT631Kp3Wi/4+FO4EwL271o5QmEKAEf1Shxp5p+kajko+WK4q/WN1vWO4kB 6r27SfVAZm8JQNBxwWdCGBz2nqpexqpmXExHhMjIqsF6zxZlUlEDsHcOck1T2vdciyio fDXqUVN6WEiM3VbnRWn8T8e8X7VDVN+zMxybrSNtjoEUcx1UvIU4AXPSOM96JlZ828q7 3eHQaBhvSSjT78F+ZFBgxNvwc5XdVyHVKBuoHreKVIFyO/tdyPQKeZ2eD5cirj2P+VaQ djTw== 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=5lsuQRt1wOPVx/WV2IDx0YOMGSRnaFf7LWvDSKsVmJQ=; b=erZjVhyZxqHZqu5ienMm2q21UyLmgRqaGRRN3eQWrlDS08M7cevI3pqVqfsuDEBryf RIBKch/r7bIYhPiCHP9owPyzehd7fxjIKPR/AeklCGE7tFWwJq+ZQ3zMKr2JsGucw89T zrGJ73J+Cu2uAMAQfQoiu5hV6/FCiYZCt2jvcMn3Ovh7M/C9gv77cqnubq4Z/f2b+K3k RNNW7bqYkkL8CnWzFSCXIhma//Cumj9zPdhXUVgKuqe1dyzAAMzj4dEGvOOQxKT85MfV 3vcLZKyjVXh/+frUYFs7/xqYfmXDZ66H6XeNu/9OyXy4a8WOa1XoelP4Lcjv+M0JY8xl DsaA== X-Gm-Message-State: AO0yUKUc8X2O7gg1k8fdBmp/tyxoe4FGk/TD9ThgcmCBfdG7EUv5TM1m HC2JtMGgVYImA6sbrx+7TGD9nRXIsOCJOfvy X-Google-Smtp-Source: AK7set/T7a1YMzyatggC9CKaseXVNFZpuc/744Ge82tC6cyMKtP8NkRxXCg15a5U2Wq1U37hMINF7w== X-Received: by 2002:a05:622a:1990:b0:3b8:691f:271 with SMTP id u16-20020a05622a199000b003b8691f0271mr7774782qtc.63.1676522224884; Wed, 15 Feb 2023 20:37:04 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 20:37:04 -0800 (PST) From: Maxim Cournoyer Date: Wed, 15 Feb 2023 23:36:43 -0500 Message-Id: <20230216043649.32119-5-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-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-Seal: i=1; s=key1; d=yhetil.org; t=1676522332; a=rsa-sha256; cv=none; b=FrZXmMyQqVVSB/KqBPxGxi/56YIqLW/9K+aRFguEGxcrfFe+mbhxLYOr8w9lGY5Sswt/81 GOLEJ3ta/n3q436Y70E2ehZ2ARWG/w9pjc//S0FAL86tn9L9QFujQNaE3Fin8C5bMMQPSa GBKi9hU5lg0OfZp2DuAUAPQ9igG64hxVwvzMjlK2DxSPnqBhB/NvukdTOnP6cvYaOQRIsb iyt9vOWifK/XUj4piPaLKcbT1Ahlht5CtIwAkyzEVXPDlB79/K/RizmRglI216aljUBfTM xWeN1JaN4WMKWQaAJkKRob3d5309CyC1MscD+eiQXjpCLyw4qlRGfvEyr03EuQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=AvGknYaw; 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=1676522332; 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=5lsuQRt1wOPVx/WV2IDx0YOMGSRnaFf7LWvDSKsVmJQ=; b=tohzA4GwsURPkzxZtNDy5u0yJPKoCu/bsaqZtqmqlAwSs8/TBC6GXzDfQI4sCm/VHDo8SI tW5Rhgp0Qofddbf4Va/3U6Uhtie5PEkcQ/wjW+ubEmmI9WXiFUcvjFvWRR2Rd0QuW8+59t Zov3vfYYHNf4HDEVncIFPMrKoBWFKlz/yYxMB4dJho7KmgxbRQ9TtQkuSK69V+iuCA4DbW +gQM8QH+ZIJLe/rhiU2fXFZQtcYn/oPrXI+qvQSFA0U7giyFhyY/NW+3cXIFhL14WJ4eLJ M/g61DGU+p8me6BhGoshhDCi6dQa4C49mNl8m6WAU2bu7sUrXJpw8m5lWz7aQw== X-Migadu-Scanner: scn1.migadu.com X-Spam-Score: 0.98 X-Migadu-Queue-Id: 5EAAB39D6F X-Migadu-Spam-Score: 0.98 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=AvGknYaw; 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-TUID: X2KEg220W0iF * gnu/packages/gnuzilla.scm (%icecat-locales, %icedove-locales): New variable. (make-l10n-package): New procedure. (icecat-l10n, icedove-l10n): New variables. --- (no changes since v1) 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 17edb9fa7e..63ea7440e6 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. @@ -1123,6 +1123,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") @@ -1147,6 +1157,15 @@ (define (comm-source->locales+changeset 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 should be released as @@ -1555,6 +1574,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