1 { lib, stdenv, fetchurl, meson, ninja, pkg-config, bison, doxygen
2 , xkeyboard_config, libxcb, libxml2
5 # To enable the "interactive-wayland" subcommand of xkbcli:
6 , withWaylandSupport ? false, wayland, wayland-protocols
9 stdenv.mkDerivation rec {
10 pname = "libxkbcommon";
14 url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
15 sha256 = "0in2fq2x4yhyjmcn9n5n43zsawsdh12d4sm6l57934kgb75gqb21";
19 ./fix-cross-compilation.patch
22 outputs = [ "out" "dev" "doc" ];
24 nativeBuildInputs = [ meson ninja pkg-config bison doxygen ]
25 ++ lib.optional withWaylandSupport wayland;
26 buildInputs = [ xkeyboard_config libxcb libxml2 ]
27 ++ lib.optionals withWaylandSupport [ wayland wayland-protocols ];
28 checkInputs = [ python3 ];
31 "-Dxkb-config-root=${xkeyboard_config}/etc/X11/xkb"
32 "-Dxkb-config-extra-path=/etc/xkb" # default=$sysconfdir/xkb ($out/etc)
33 "-Dx-locale-root=${libX11.out}/share/X11/locale"
34 "-Denable-wayland=${lib.boolToString withWaylandSupport}"
39 patchShebangs ../test/
43 description = "A library to handle keyboard descriptions";
45 libxkbcommon is a keyboard keymap compiler and support library which
46 processes a reduced subset of keymaps as defined by the XKB (X Keyboard
47 Extension) specification. It also contains a module for handling Compose
49 ''; # and a separate library for listing available keyboard layouts.
50 homepage = "https://xkbcommon.org";
51 changelog = "https://github.com/xkbcommon/libxkbcommon/blob/xkbcommon-${version}/NEWS";
52 license = licenses.mit;
53 maintainers = with maintainers; [ primeos ttuegel ];
54 platforms = with platforms; unix;