2021-04-05 15:23:46 +00:00
|
|
|
{ lib, stdenv, fetchurl, meson, ninja, pkg-config, bison, doxygen
|
2021-02-05 17:12:51 +00:00
|
|
|
, xkeyboard_config, libxcb, libxml2
|
|
|
|
, python3
|
|
|
|
, libX11
|
2021-02-19 19:06:45 +00:00
|
|
|
# To enable the "interactive-wayland" subcommand of xkbcli:
|
|
|
|
, withWaylandSupport ? false, 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-04-26 19:14:03 +00:00
|
|
|
version = "1.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
|
2021-04-26 19:14:03 +00:00
|
|
|
sha256 = "1cqzd4vd5jw3ghibmdqvy90mb1h8vvazc81bxgavk6sc0b9sfcz8";
|
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-02-19 19:06:45 +00:00
|
|
|
++ lib.optional withWaylandSupport wayland;
|
|
|
|
buildInputs = [ xkeyboard_config libxcb libxml2 ]
|
|
|
|
++ lib.optionals withWaylandSupport [ 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-02-19 19:06:45 +00:00
|
|
|
"-Denable-wayland=${lib.boolToString withWaylandSupport}"
|
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;
|
|
|
|
};
|
|
|
|
}
|