about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libxkbcommon
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libxkbcommon')
-rw-r--r--nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix34
2 files changed, 101 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix b/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
new file mode 100644
index 000000000000..ca7feb996f7e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, bison
+, doxygen
+, xkeyboard_config
+, libxcb
+, libxml2
+, python3
+, libX11
+  # To enable the "interactive-wayland" subcommand of xkbcli. This is the
+  # wayland equivalent of `xev` on X11.
+, withWaylandTools ? stdenv.isLinux
+, wayland
+, wayland-protocols
+, wayland-scanner
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxkbcommon";
+  version = "1.4.1";
+
+  src = fetchurl {
+    url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
+    sha256 = "0fbb2dyjvf71p42y2jmwdcylsvj03w52f5rb23c2d00rwahhfg4l";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [ meson ninja pkg-config bison doxygen ]
+    ++ lib.optional withWaylandTools wayland-scanner;
+  buildInputs = [ xkeyboard_config libxcb libxml2 ]
+    ++ lib.optionals withWaylandTools [ 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 withWaylandTools}"
+  ];
+
+  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 ];
+    mainProgram = "xkbcli";
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix b/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
new file mode 100644
index 000000000000..6578a86e35b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, pkg-config, bison, flex, xkeyboard_config, libxcb, libX11 }:
+
+stdenv.mkDerivation rec {
+  pname = "libxkbcommon";
+  version = "0.7.2";
+
+  src = fetchurl {
+    url = "http://xkbcommon.org/download/libxkbcommon-${version}.tar.xz";
+    sha256 = "1n5rv5n210kjnkyrvbh04gfwaa7zrmzy1393p8nyqfw66lkxr918";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ bison flex xkeyboard_config libxcb ];
+
+  configureFlags = [
+    "--with-xkb-config-root=${xkeyboard_config}/etc/X11/xkb"
+    "--with-x-locale-root=${libX11.out}/share/X11/locale"
+  ];
+
+  preBuild = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/,--version-script=.*$//' Makefile
+  '';
+
+  meta = with lib; {
+    description = "A library to handle keyboard descriptions";
+    homepage = "https://xkbcommon.org";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ttuegel ];
+    mainProgram = "xkbcli";
+    platforms = with platforms; unix;
+  };
+}