{ lib, runCommandCC, libxkbcommon }:

runCommandCC "xkbvalidate" {
  buildInputs = [ libxkbcommon ];
  meta = {
    description = "NixOS tool to validate X keyboard configuration";
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    maintainers = [ lib.maintainers.aszlig ];
  };
} ''
  mkdir -p "$out/bin"
  gcc -std=gnu11 -Wall -pedantic -lxkbcommon ${./xkbvalidate.c} \
    -o "$out/bin/validate"
''

{ lib, runCommandCC, libxkbcommon }:

runCommandCC "xkbvalidate" {
  buildInputs = [ libxkbcommon ];
  meta = {
    description = "NixOS tool to validate X keyboard configuration";
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    maintainers = [ lib.maintainers.aszlig ];
  };
} ''
  mkdir -p "$out/bin"
  $CC -std=gnu11 -Wall -pedantic -lxkbcommon ${./xkbvalidate.c} \
    -o "$out/bin/validate"
''

Use $CC instead of hardcoded gcc
xkbvalidate: Use $CC instead of hardcoded gcc

I initially didn't use $CC because I thought this would be GCC specific,
but it turns out that Clang actually accepts -std=gnu11.

So using $CC here might not work on compilers other than Clang or GCC,
but at the moment those are the compilers we typically use in nixpkgs,
so even if we'd use some other compiler it *might* even work there.

I've tested this by compiling against clangStdenv with both $CC and
clang hardcoded and it works.

This was reported by @dkudriavtsev on IRC.

Signed-off-by: aszlig <ee1aa092358634f9c53f01b5a783726c9e21b35a@nix.build>
