summary refs log tree commit diff
path: root/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
blob: 3997ceb623f38c48a8dcebb32141bd8e5a6cba8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ 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"
  ];

  NIX_CFLAGS_COMPILE = [
    # Needed with GCC 12
    "-Wno-error=array-bounds"
  ];

  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;
  };
}