From patchwork Sat Jul 1 13:19:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Denys Nykula X-Patchwork-Id: 51488 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2945227BBEA; Sat, 1 Jul 2023 15:18:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8C54F27BBE2 for ; Sat, 1 Jul 2023 15:18:00 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFbQD-00087R-7F; Sat, 01 Jul 2023 10:17:57 -0400 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 1qFaWB-0003kQ-22 for guix-patches@gnu.org; Sat, 01 Jul 2023 09:20:03 -0400 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 1qFaWA-0002Dk-NP for guix-patches@gnu.org; Sat, 01 Jul 2023 09:20:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qFaWA-0001lO-3t for guix-patches@gnu.org; Sat, 01 Jul 2023 09:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64399] [PATCH] installer: Restore LatGrkCyr-8x16 console font depending on language. Resent-From: Denys Nykula Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jul 2023 13:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64399 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64399@debbugs.gnu.org Cc: Denys Nykula X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16882175886749 (code B ref -1); Sat, 01 Jul 2023 13:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jul 2023 13:19:48 +0000 Received: from localhost ([127.0.0.1]:56967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFaVv-0001kn-Gr for submit@debbugs.gnu.org; Sat, 01 Jul 2023 09:19:47 -0400 Received: from lists.gnu.org ([209.51.188.17]:52520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFaVs-0001ke-Px for submit@debbugs.gnu.org; Sat, 01 Jul 2023 09:19:45 -0400 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 1qFaVs-0003jO-5m for guix-patches@gnu.org; Sat, 01 Jul 2023 09:19:44 -0400 Received: from libre.net.ua ([91.234.34.15] helo=fff.org.ua) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFaVo-0002BC-ID for guix-patches@gnu.org; Sat, 01 Jul 2023 09:19:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=libre.net.ua; s=mail; t=1688217574; h=from:from: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; bh=1rhForJg+KCRrqJoXJ/Mbwh8xRtiyRf9fUbNm/XSvsY=; b=Pqbs2Cqr1wipDS8c7Ok+023+FYAm3NPIcg2NxEy4ffNSTet5+9l2vNVTQzOu4aP8rv9vFS fPvr9kjr5jPFDPUE8F7P/yoU+HKahVCMpa/YzNdLhqS8+sxneSv++mg7hvGlvewxQ4ZPVR R/0h88ouosiakCAfrYTAcHXqrVF8C3g= From: Denys Nykula Date: Sat, 1 Jul 2023 16:19:14 +0300 Message-Id: <34ca88bad83d40c14346f18ddbc34e8d2884f88f.1688217377.git.vegan@libre.net.ua> MIME-Version: 1.0 Received-SPF: pass client-ip=91.234.34.15; envelope-from=vegan@libre.net.ua; helo=fff.org.ua X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 01 Jul 2023 10:17:54 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Partially-Fixes: * gnu/installer/services.scm (system-services->configuration): When the LANGUAGE environment variable matches a known native console font, wrap the %desktop-services or %base-services with modify-services, configuring console-font-service-type to set the native console font on every tty instead of the default console font. --- This makes console messages, such as errors and help texts, readable (like they were in Guix System 1.4.0) if the user chooses the Belarusian, Bulgarian, Greek, Esperanto, Kazakh, Kyrgyz, Macedonian, Mongolian, Russian, Serbian, Tajik or Ukrainian language at the beginning of a new installation. For other languages, this keeps the default font, which is Unifont-APL8x16 in the latest development snapshots. Thanks to Florian Pelz and Josselin Poiret for tips about editing the installer and testing it using a virtual machine. gnu/installer/services.scm | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) base-commit: b24a05830d11e3011eee4bc5f60a41e26188cde1 diff --git a/gnu/installer/services.scm b/gnu/installer/services.scm index d08bab47fd..fb66f2248c 100644 --- a/gnu/installer/services.scm +++ b/gnu/installer/services.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Tobias Geerinckx-Rice ;;; Copyright © 2021 Leo Famulari +;;; Copyright © 2023 Denys Nykula ;;; ;;; This file is part of GNU Guix. ;;; @@ -23,6 +24,7 @@ (define-module (gnu installer services) #:use-module (guix records) #:use-module (guix read-print) + #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (system-service? system-service-name @@ -156,9 +158,22 @@ (define (system-services->configuration services) (let* ((snippets (append-map system-service-snippet services)) (packages (append-map system-service-packages services)) (desktop? (find desktop-system-service? services)) - (base (if desktop? - '%desktop-services - '%base-services)) + (base-with-default-console-font (if desktop? + '%desktop-services + '%base-services)) + (native-console-font (match (getenv "LANGUAGE") + ((or "be" "bg" "el" "eo" "kk" "ky" + "mk" "mn" "ru" "sr" "tg" "uk") + "LatGrkCyr-8x16.psfu.gz") + (_ #f))) + (base (if native-console-font + `(modify-services + ,base-with-default-console-font + (console-font-service-type + config => (map (lambda (tty) + (cons (car tty) ,native-console-font)) + config))) + base-with-default-console-font)) (service-heading (list (vertical-space 1) (comment (G_ "\ ;; Below is the list of system services. To search for available