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.
|
2024-07-27 06:49:29 +00:00
|
|
|
, xorg
|
2021-05-20 23:08:51 +00:00
|
|
|
, withWaylandTools ? stdenv.isLinux
|
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
2021-07-21 07:28:18 +00:00
|
|
|
, wayland-scanner
|
2024-02-29 20:09:43 +00:00
|
|
|
, testers
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "libxkbcommon";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.7.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-02-29 20:09:43 +00:00
|
|
|
url = with finalAttrs; "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-ZXgvChCktFWvnGuqtwQOL1N1IMqi7CCSgFzf02hjskc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [
|
|
|
|
# Disable one Xvfb test as it fails for permission checks.
|
|
|
|
./disable-x11com.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
outputs = [ "out" "dev" "doc" ];
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
2024-07-27 06:49:29 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config bison doxygen xorg.xvfb ]
|
2021-07-21 07:28:18 +00:00
|
|
|
++ lib.optional withWaylandTools wayland-scanner;
|
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 ];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ 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"
|
2024-05-15 15:35:15 +00:00
|
|
|
"-Denable-docs=true"
|
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
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru = {
|
|
|
|
tests.pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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";
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/xkbcommon/libxkbcommon/blob/xkbcommon-${finalAttrs.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 ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "xkbcli";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; unix;
|
2023-08-10 07:59:29 +00:00
|
|
|
pkgConfigModules = [
|
|
|
|
"xkbcommon"
|
|
|
|
"xkbcommon-x11"
|
|
|
|
"xkbregistry"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|