@@ -0,0 +1,36 @@
1+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig
2+, glib, systemd, udev, libevdev, gitMinimal, check, valgrind, swig, python3 }:
3+
4+stdenv.mkDerivation rec {
5+ name = "libratbag-${version}";
6+ version = "0.9.903";
7+
8+ src = fetchFromGitHub {
9+ owner = "libratbag";
10+ repo = "libratbag";
11+ rev = "v${version}";
12+ sha256 = "0cr5skrb7a5mgj7dkm647ib8336hb88bf11blaf6xldafi8b0jlj";
13+ };
14+
15+
16+ # todo: python should be in buildInputs, but right now meson propagates
17+ # its own python. see: https://github.com/NixOS/nixpkgs/pull/46020
18+ nativeBuildInputs = [
19+ (python3.withPackages (ps: with ps; [ evdev pygobject3 ]))
20+ meson ninja pkgconfig gitMinimal swig check valgrind
21+ ];
22+
23+ buildInputs = [ glib systemd udev libevdev ];
24+
25+ mesonFlags = [
26+ "-Dsystemd-unit-dir=./lib/systemd/system/"
27+ ];
28+
29+ meta = with stdenv.lib; {
30+ description = "Configuration library for gaming mice";
31+ homepage = https://github.com/libratbag/libratbag;
32+ license = licenses.mit;
33+ maintainers = with maintainers; [ mvnetbiz ];
34+ platforms = platforms.linux;
35+ };
36+}