nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
Michael Weiss 3762bb5390
libxkbcommon: Enable libxkbregistry
This also enables the "list" subcommand of xkbcli.

Since libxkbregistry is an optional library we could install it into a
different output. However, doing this properly is quite challenging and
the best approach would likely be to upstream patches that add a Meson
option for installing libxkbregistry under a separate prefix (so that
the pkg-config file is generated correctly, etc.).
But even then the default fixup phase would try to move
$libxkbregistry/include into the $dev output and the $out output would
depend on the $libxkbcommon output because of the xkbcli binary (though
we could move that into a $bin output).
As a result it seems best not to install libxkbregistry into a dedicated
output path.
2021-01-25 15:00:55 +01:00

57 lines
1.8 KiB
Nix

{ lib, stdenv, fetchurl, meson, ninja, pkg-config, yacc, doxygen
, xkeyboard_config, libxcb, libxml2
, python3
, libX11
# To enable the "interactive-wayland" subcommand of xkbcli:
, withWaylandSupport ? false, wayland, wayland-protocols
}:
stdenv.mkDerivation rec {
pname = "libxkbcommon";
version = "1.0.3";
src = fetchurl {
url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
sha256 = "0lmwglj16anhpaq0h830xsl1ivknv75i4lir9bk88aq73s2jy852";
};
patches = [
./fix-cross-compilation.patch
];
outputs = [ "out" "dev" "doc" ];
nativeBuildInputs = [ meson ninja pkg-config yacc doxygen ]
++ lib.optional withWaylandSupport wayland;
buildInputs = [ xkeyboard_config libxcb libxml2 ]
++ lib.optionals withWaylandSupport [ wayland wayland-protocols ];
checkInputs = [ python3 ];
mesonFlags = [
"-Dxkb-config-root=${xkeyboard_config}/etc/X11/xkb"
"-Dxkb-config-extra-path=/etc/xkb" # default=$sysconfdir/xkb ($out/etc)
"-Dx-locale-root=${libX11.out}/share/X11/locale"
"-Denable-wayland=${lib.boolToString withWaylandSupport}"
];
doCheck = true;
preCheck = ''
patchShebangs ../test/
'';
meta = with lib; {
description = "A library to handle keyboard descriptions";
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.
homepage = "https://xkbcommon.org";
changelog = "https://github.com/xkbcommon/libxkbcommon/blob/xkbcommon-${version}/NEWS";
license = licenses.mit;
maintainers = with maintainers; [ primeos ttuegel ];
platforms = with platforms; unix;
};
}