{ stdenv, lib, # deps meson, pkg-config, ninja, wayland-scanner, wayland, hidapi, }: stdenv.mkDerivation { pname = "qmk-unicode-type"; version = "1.0.0"; src = lib.cleanSourceWith { src = lib.cleanSource ./.; filter = name: type: (type == "directory") || (builtins.elem (builtins.baseNameOf name) [ "virtual-keyboard-unstable-v1.xml" "099-allow-hid.rules" ]) || (lib.strings.hasSuffix ".c" (builtins.baseNameOf name)) || (lib.strings.hasSuffix ".h" (builtins.baseNameOf name)) || (lib.strings.hasSuffix ".build" (builtins.baseNameOf name)); }; env = { }; mesonFlags = lib.mapAttrsToList lib.mesonOption { debug = "false"; optimization = "3"; strip = "true"; warning_level = "everything"; werror = "true"; b_lundef = "true"; b_lto = "true"; b_ndebug = "false"; b_pgo = "generate"; b_staticpic = "true"; b_pie = "false"; c_std = "gnu2x"; }; # ar with gcc plugins for lto objects preConfigure = '' CC="gcc"; AR="gcc-ar"; RANLIB="gcc-ranlib" ; export CC AR RANLIB ''; postInstall = '' install --mode=644 -D $src/contrib/lib/udev/rules.d/099-allow-hid.rules "$out/lib/udev/rules.d/19-allow-hid.rules" ''; strictDeps = true; nativeBuildInputs = [ meson pkg-config ninja wayland-scanner ]; buildInputs = [ wayland hidapi ]; }