aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.

(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>
  (%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 <keyboard-layout> 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))
s/syndication.scm?id=d631d901d8afe5fcf326c91203d73a34b99dde0f'>build: cargo-build-system: Disable tests by default....* guix/build-system/cargo.scm (cargo-build): Disable tests by default. * gnu/packages/admin.scm (greetd, wlgreet, du-dust), * gnu/packages/bioinformatics.scm (circtools, python-gseapy), * gnu/packages/crypto.scm (rust-minisign, b3sum), * gnu/packages/gnome.scm (librsvg), * gnu/packages/python-crypto.scm (python-blake3, python-cryptography-rust), * gnu/packages/python-xyz.scm (python-orjson), * gnu/packages/rust-apps.scm (agate, alfis, bat, diffr, drill, dutree, exa, fd, hexyl, hyperfine, i3status-rust, just, maturin, ripgrep, rot8, rust-swc, rust-cargo-edit, git-interactive-rebase-tool, rust-cbindgen, rust-cbindgen-0.24, rust-cbindgen-0.19, sniffglue, tectonic, treefmt, hex, tokei, vivid, watchexec, rbw, rust-analyzer, rust-cargo-c, rtss, skim, skim-0.7, svd2rust, swayhide, tealdeer, git-absorb, zoxide, htmlq), * gnu/packages/sequoia.scm (sequoia-sqv), * gnu/packages/syndication.scm (newsboat), * gnu/packages/terminals.scm (alacritty), * gnu/packages/text-editors.scm (kak-lsp, parinfer-rust), * gnu/packages/tree-sitter.scm (tree-sitter-cli), * gnu/packages/video.scm (rav1e), * gnu/packages/web.scm (monolith, castor) [arguments]: Enable tests. Efraim Flashner 2023-10-18gnu: newsboat: Update to 2.33....* gnu/packages/syndication.scm (newsboat): Update to 2.33. [arguments]: Don't override vendor-dir. [cargo-inputs]: Replace rust-fastrand-1 with 2. Efraim Flashner 2023-08-14gnu: newsboat: Update to 2.32....* gnu/packages/syndication.scm (newsboat): Update to 2.32. [native-inputs]: Use 'supported-package?'. Efraim Flashner 2023-05-14gnu: Add morss....* gnu/packages/syndication.scm (morss): New variable. Vinicius Monego 2023-05-07gnu: newsboat: Update to 2.31....* gnu/packages/syndication.scm (newsboat): Update to 2.31. [cargo-inputs]: Replace rust-bitflags-1 with 2, rust-lexopt-0.2 with 0.3. Efraim Flashner 2023-04-25gnu: gfeeds: Add missing gettext-minimal....* gnu/packages/syndication.scm (gfeeds)[inputs]: Add gettext-minimal. Liliana Marie Prikler 2023-04-25gnu: syndication-domination: Update to 1.0-1-7592032....* gnu/packages/syndication.scm (syndication-domination): Update to 1.0-1-7592032. Liliana Marie Prikler 2023-04-19gnu: gfeeds: Update to 2.2.0....* gnu/packages/syndication.scm (gfeeds): Update to 2.2.0. [phases]: Fix skip-icon-cache phase. Use search-input-file in wrap-gfeeds. Maxim Cournoyer 2023-04-14Merge branch 'master' into core-updates....Conflicts: gnu/local.mk gnu/packages/build-tools.scm gnu/packages/certs.scm gnu/packages/check.scm gnu/packages/compression.scm gnu/packages/cups.scm gnu/packages/fontutils.scm gnu/packages/gnuzilla.scm gnu/packages/guile.scm gnu/packages/ibus.scm gnu/packages/image-processing.scm gnu/packages/linux.scm gnu/packages/music.scm gnu/packages/nss.scm gnu/packages/pdf.scm gnu/packages/python-xyz.scm gnu/packages/qt.scm gnu/packages/ruby.scm gnu/packages/shells.scm gnu/packages/tex.scm gnu/packages/video.scm gnu/packages/vulkan.scm gnu/packages/web.scm gnu/packages/webkit.scm gnu/packages/wm.scm Maxim Cournoyer 2023-04-09gnu: Remove extraneous #:meson build arguments....* gnu/packages/build-tools.scm (meson-python) [propagated-inputs]: Replace meson-0.63 with meson. * gnu/packages/freedesktop.scm (appstream) [arguments]: Remove #:meson argument. * gnu/packages/gnome.scm (raider): Likewise. (komikku): Likewise. * gnu/packages/syndication.scm (syndication-domination): Likewise. * gnu/packages/virtualization.scm (qemu): Likewise. * gnu/packages/xdisorg.scm (tofi): Likewise. Maxim Cournoyer 2023-03-23Merge remote-tracking branch 'origin/master' into staging....With resolved conflicts in: gnu/packages/ibus.scm gnu/packages/image.scm gnu/packages/lisp.scm gnu/packages/virtualization.scm Maxim Cournoyer 2023-02-16gnu: Remove unneeded module imports....* gnu/packages/abiword.scm, * gnu/packages/ada.scm, * gnu/packages/agda.scm, * gnu/packages/backup.scm, * gnu/packages/barrier.scm, * gnu/packages/bioinformatics.scm, * gnu/packages/bootstrap.scm, * gnu/packages/bqn.scm, * gnu/packages/c.scm, * gnu/packages/chemistry.scm, * gnu/packages/coq.scm, * gnu/packages/cross-base.scm, * gnu/packages/databases.scm, * gnu/packages/emacs-xyz.scm, * gnu/packages/enlightenment.scm, * gnu/packages/games.scm, * gnu/packages/geo.scm, * gnu/packages/ghostscript.scm, * gnu/packages/gl.scm, * gnu/packages/golang.scm, * gnu/packages/jami.scm, * gnu/packages/java-maths.scm, * gnu/packages/kde-frameworks.scm, * gnu/packages/kde-plasma.scm, * gnu/packages/language.scm, * gnu/packages/libreoffice.scm, * gnu/packages/linphone.scm, * gnu/packages/lisp.scm, * gnu/packages/llvm.scm, * gnu/packages/machine-learning.scm, * gnu/packages/minetest.scm, * gnu/packages/monitoring.scm, * gnu/packages/nfs.scm, * gnu/packages/ocr.scm, * gnu/packages/opencl.scm, * gnu/packages/pdf.scm, * gnu/packages/python-xyz.scm, * gnu/packages/racket.scm, * gnu/packages/rust.scm, * gnu/packages/syncthing.scm, * gnu/packages/syndication.scm, * gnu/packages/telegram.scm, * gnu/packages/vulkan.scm, * gnu/packages/web-browsers.scm, * gnu/packages/web.scm, * gnu/packages/webkit.scm: Remove some unecessary module imports. Efraim Flashner 2023-01-12gnu: newsboat: Update to 2.30.1....* gnu/packages/syndication.scm (newsboat): Update to 2.30.1. Efraim Flashner 2022-11-17gnu: giara: Remove input labels....* gnu/packages/syndication.scm (giara)[inputs]: Remove input labels. [native-inputs]: Same. Efraim Flashner 2022-11-17gnu: giara: Update to 1.0.1....* gnu/packages/syndication.scm (giara): Update to 1.0.1. [source]: Remove patch. [arguments]: Add phase to skip meson post-install script. [native-inputs]: Remove libxml2. Replace gtk+:bin with gtk:bin. [inputs]: Remove python-pycairo, webkitgtk-with-libsoup2. Add blueprint-compiler. Replace libhandy with libadwaita, gtk+ with gtk, python-mistune with python-mistune-next. [description]: Update. * gnu/packages/patches/giara-fix-login.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. Efraim Flashner 2022-11-14gnu: gfeeds: Add source file-name....* gnu/packages/syndication.scm (gfeeds)[source]: Add file-name field. Efraim Flashner 2022-11-06gnu: newsboat: Only build documentation on supported systems....* gnu/packages/syndication.scm (newsboat)[inputs]: Only use asciidoctor on supported platforms. [arguments]: When asciidoctor isn't present add a phase to skip building the documentation. Efraim Flashner 2022-10-01gnu: gfeeds: Update to 1.0.3....* gnu/packages/syndication.scm (gfeeds): Update to 1.0.3. [arguments]<#:phases>: Add ‘skip-icon-cache’. [native-inputs]: Remove gtk+:bin. Add blueprint-compiler. [inputs]: Replace gtk+ with gtk. Replace libhandy with libadwaita. Replace python-readability with python-readability-lxml. Replace webkitgtk with webkitgtk-next. Add python-humanize, python-magic, python-pygobject, and syndication-domination. Liliana Marie Prikler 2022-10-01gnu: gfeeds: Modernize package description....* gnu/packages/syndication.scm (gfeeds)[arguments]: Convert to list of G-Expressions. Drop trailing #t. [native-inputs]: Drop labels. [inputs]: Add bash-minimal. Liliana Marie Prikler 2022-10-01gnu: gfeeds: Use git origin....* gnu/packages/syndication.scm (gfeeds)[origin]: Use git-fetch and git-reference. Liliana Marie Prikler 2022-10-01gnu: Add syndication-domination....* gnu/packages/syndication.scm (syndication-domination): New variable. Liliana Marie Prikler 2022-09-30gnu: newsboat: Update to 2.29....* gnu/packages/syndication.scm (newsboat): Update to 2.29. [cargo-development-inputs]: Move rust-cxx-build-1 ... [cargo-inputs]: ... to here. Efraim Flashner 2022-05-31gnu: Remove rawdog....* gnu/packages/syndication.scm (rawdog): Delete variable. Maxim Cournoyer 2022-04-26gnu: gfeeds: Make it start....This change patches the version of WebKit required by the program to a version available in Guix, so that the program actually starts. * gnu/packages/syndication.scm (gfeeds)[arguments]: Require WebKit2 4.1 instead of 4.0, which is not available. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Luis Felipe 2022-03-18gnu: feh, newsboat: Inline top-level reference to 'curl'....These references introduced top-level circular dependencies. Furthermore, they were inaccurate since only CURL_CA_BUNDLE is honored. * gnu/packages/image-viewers.scm (feh)[native-search-paths]: Remove top-level reference to 'curl'; inline "CURL_CA_BUNDLE" spec. * gnu/packages/syndication.scm (newsboat)[native-search-paths]: Likewise. Ludovic Courtès 2022-02-16gnu: Remove QuiteRSS due to dependency on QtWebKit....According to the upstream developers, "Unfortunately, qtwebkit won't work without it. Everything is very much tied to qtwebkit." https://github.com/QuiteRSS/quiterss/issues/1470 Additionally, there is no work being done to remove this dependency: https://github.com/QuiteRSS/quiterss/issues/909 Other distros are removing this package as part of the effort to remove QtWebKit: https://bugzilla.redhat.com/show_bug.cgi?id=1872819 https://bugs.gentoo.org/687840 See <https://issues.guix.gnu.org/53289> for more information about this change. * gnu/packages/syndication.scm (quiterss): Remove variable. Leo Famulari