nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

40 lines
1.1 KiB
Nix

{ 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"
];
env.NIX_CFLAGS_COMPILE = toString [
# 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;
};
}