;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019, 2020 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu system keyboard) #:use-module (guix gexp) #:use-module ((gnu packages xorg) #:select (xkeyboard-config console-setup)) #:use-module (srfi srfi-9 gnu) #:use-module (ice-9 match) #:export (keyboard-layout? keyboard-layout keyboard-layout-name keyboard-layout-variant keyboard-layout-model keyboard-layout-options keyboard-layout->console-keymap)) ;;; Commentary: ;;; ;;; This module provides a data structure to represent keyboard layouts ;;; according to the XKB naming and classification (see the 'xkeyboard-config' ;;; package). ;;; ;;; Code: (define-immutable-record-type (%keyboard-layout name variant model options) keyboard-layout? (name keyboard-layout-name) ;string (variant keyboard-layout-variant) ;#f | string (model keyboard-layout-model) ;#f | string (options keyboard-layout-options)) ;list of strings (define* (keyboard-layout name #:optional variant #:key model (options '())) "Return a new keyboard layout with the given NAME and VARIANT. NAME must be a string such as \"fr\"; VARIANT must be a string such as \"bepo\" or \"nodeadkeys\". See the 'xkeyboard-config' package for valid options." (%keyboard-layout name variant model options)) (define* (keyboard-layout->console-keymap layout #:key (xkeyboard-config xkeyboard-config)) "Return a Linux console keymap file for LAYOUT, a record. Layout information is taken from the XKEYBOARD-CONFIG package." (define build (with-imported-modules '((guix build utils)) #~(begin (use-modules (guix build utils) (ice-9 popen) (ice-9 match)) (define pipe (open-pipe* OPEN_READ #+(file-append console-setup "/bin/ckbcomp") (string-append "-I" #+(file-append xkeyboard-config "/share/X11/xkb")) "-rules" "base" #$@(match (keyboard-layout-model layout) (#f '()) (model `("-model" ,model))) #$(keyboard-layout-name layout) #$(or (keyboard-layout-variant layout) "") #$(string-join (keyboard-layout-options layout) ","))) (call-with-output-file #$output (lambda (output) (dump-port pipe output))) ;; Note: ckbcomp errors out when the layout name is unknown, but ;; merely emits a warning when the variant is unknown. (unless (zero? (close-pipe pipe)) (error "failed to create console keymap for keyboard layout" #$(keyboard-layout-name layout)))))) (computed-file (string-append "console-keymap." (string-map (match-lambda (#\, #\-) (chr chr)) (keyboard-layout-name layout))) build)) conf, gnu/packages/aux-files/linux-libre/5.4-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.4-arm.conf, gnu/packages/aux-files/linux-libre/5.4-arm64.conf, gnu/packages/aux-files/linux-libre/5.4-i686.conf, gnu/packages/aux-files/linux-libre/5.4-x86_64.conf: Set CONFIG_FONTS=y, CONFIG_FONT_TER16x32=y, and CONFIG_FONT_6x10=y. Tobias Geerinckx-Rice 2019-12-18gnu: linux-libre: Update to 5.4.5....* gnu/packages/aux-files/linux-libre/5.3-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.3-arm.conf, gnu/packages/aux-files/linux-libre/5.3-arm64.conf, gnu/packages/aux-files/linux-libre/5.3-i686.conf, gnu/packages/aux-files/linux-libre/5.3-x86_64.conf: Delete files. * gnu/packages/aux-files/linux-libre/5.4-arm-veyron.conf, gnu/packages/aux-files/linux-libre/5.4-arm.conf, gnu/packages/aux-files/linux-libre/5.4-arm64.conf, gnu/packages/aux-files/linux-libre/5.4-i686.conf, gnu/packages/aux-files/linux-libre/5.4-x86_64.conf: New files. * Makefile.am (AUX_FILES): Update accordingly. * gnu/packages/patches/linux-libre-active-entropy.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. * gnu/packages/linux.scm (deblob-scripts-5.3, linux-libre-5.3-version) (linux-libre-5.3-pristine-source, linux-libre-5.3-source) (linux-libre-headers-5.3, linux-libre-5.3): Remove variables. (deblob-scripts-5.4, linux-libre-5.4-version) (linux-libre-5.4-pristine-source, linux-libre-5.4-source) (linux-libre-headers-5.4, linux-libre-5.4): New variables. (linux-libre-version, linux-libre-pristine-source) (linux-libre-source, linux-libre): Point to linux-libre-5.4*. Mark H Weaver