2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, bison
|
|
|
|
, doxygen
|
|
|
|
, xkeyboard_config
|
|
|
|
, libxcb
|
|
|
|
, libxml2
|
2021-02-05 17:12:51 +00:00
|
|
|
, python3
|
|
|
|
, libX11
|
2021-05-20 23:08:51 +00:00
|
|
|
# To enable the "interactive-wayland" subcommand of xkbcli. This is the
|
|
|
|
# wayland equivalent of `xev` on X11.
|
|
|
|
, withWaylandTools ? stdenv.isLinux
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libxkbcommon";
|
2021-05-20 23:08:51 +00:00
|
|
|
version = "1.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
|
2021-05-20 23:08:51 +00:00
|
|
|
sha256 = "0ysynzzgzd9jdrh1321r4bgw8wd5zljrlyn5y1a31g39xacf02bv";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
2021-04-05 15:23:46 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config bison doxygen ]
|
2021-05-20 23:08:51 +00:00
|
|
|
++ lib.optional withWaylandTools wayland;
|
2021-02-19 19:06:45 +00:00
|
|
|
buildInputs = [ xkeyboard_config libxcb libxml2 ]
|
2021-05-20 23:08:51 +00:00
|
|
|
++ lib.optionals withWaylandTools [ wayland wayland-protocols ];
|
2021-02-05 17:12:51 +00:00
|
|
|
checkInputs = [ python3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dxkb-config-root=${xkeyboard_config}/etc/X11/xkb"
|
2021-02-05 17:12:51 +00:00
|
|
|
"-Dxkb-config-extra-path=/etc/xkb" # default=$sysconfdir/xkb ($out/etc)
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Dx-locale-root=${libX11.out}/share/X11/locale"
|
2021-05-20 23:08:51 +00:00
|
|
|
"-Denable-wayland=${lib.boolToString withWaylandTools}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
doCheck = true;
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs ../test/
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library to handle keyboard descriptions";
|
2021-02-05 17:12:51 +00:00
|
|
|
longDescription = ''
|
|
|
|
libxkbcommon is a keyboard keymap compiler and support library which
|
|
|
|
processes a reduced subset of keymaps as defined by the XKB (X Keyboard
|
|
|
|
Extension) specification. It also contains a module for handling Compose
|
|
|
|
and dead keys.
|
|
|
|
''; # and a separate library for listing available keyboard layouts.
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://xkbcommon.org";
|
2021-02-05 17:12:51 +00:00
|
|
|
changelog = "https://github.com/xkbcommon/libxkbcommon/blob/xkbcommon-${version}/NEWS";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ primeos ttuegel ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|