1{ lib
2, stdenv
3, fetchFromGitHub
4, fetchFromGitLab
5, libevdev
6, libxkbcommon
7, meson
8, ninja
9, pkg-config
10, protobuf
11, protobufc
12, systemd
13, buildPackages
14}:
15let
16 munit = fetchFromGitHub {
17 owner = "nemequ";
18 repo = "munit";
19 rev = "fbbdf1467eb0d04a6ee465def2e529e4c87f2118";
20 hash = "sha256-qm30C++rpLtxBhOABBzo+6WILSpKz2ibvUvoe8ku4ow=";
21 };
22in
23stdenv.mkDerivation rec {
24 pname = "libei";
25 version = "1.2.1";
26
27 src = fetchFromGitLab {
28 domain = "gitlab.freedesktop.org";
29 owner = "libinput";
30 repo = "libei";
31 rev = version;
32 hash = "sha256-8n/C0rBlyhY8SaxkwU+tDskwSQObLRrR+utk4Ktgb7U=";
33 };
34
35 buildInputs = [
36 libevdev
37 libxkbcommon
38 protobuf
39 protobufc
40 systemd
41 ];
42 nativeBuildInputs = [
43 meson
44 ninja
45 pkg-config
46 (buildPackages.python3.withPackages (ps: with ps; [
47 attrs
48 jinja2
49 pytest
50 python-dbusmock
51 strenum
52 structlog
53 ]))
54 ];
55
56 postPatch = ''
57 ln -s "${munit}" ./subprojects/munit
58 patchShebangs ./proto/ei-scanner
59 '';
60
61 meta = with lib; {
62 description = "Library for Emulated Input";
63 mainProgram = "ei-debug-events";
64 homepage = "https://gitlab.freedesktop.org/libinput/libei";
65 license = licenses.mit;
66 maintainers = [ maintainers.pedrohlc ];
67 platforms = platforms.linux;
68 };
69}