1{ lib, stdenv, fetchFromGitHub, fetchpatch
2, meson, ninja, pkg-config, unixtools
3, dbus, libcap, polkit, systemd
4}:
5
6stdenv.mkDerivation rec {
7 pname = "rtkit";
8 version = "0.13";
9
10 src = fetchFromGitHub {
11 owner = "heftig";
12 repo = "rtkit";
13 rev = "c295fa849f52b487be6433e69e08b46251950399";
14 sha256 = "0yfsgi3pvg6dkizrww1jxpkvcbhzyw9110n1dypmzq0c5hlzjxcd";
15 };
16
17 patches = [
18 (fetchpatch {
19 url = "https://github.com/heftig/rtkit/commit/7d62095b94f8df3891c984a1535026d2658bb177.patch";
20 sha256 = "17acv549zqcgh7sgprfagbf6drqsr0zdwvf1dsqda7wlqc2h9zn7";
21 })
22
23 (fetchpatch {
24 url = "https://github.com/heftig/rtkit/commit/98f70edd8f534c371cb4308b9720739c5178918d.patch";
25 sha256 = "18mnjjsdjfr184nkzi01xyphpdngi31ry4bmkv9ysjxf9wilv4nl";
26 })
27 ];
28
29 nativeBuildInputs = [ meson ninja pkg-config unixtools.xxd ];
30 buildInputs = [ dbus libcap polkit systemd ];
31
32 mesonFlags = [
33 "-Dinstalled_tests=false"
34
35 "-Ddbus_systemservicedir=${placeholder "out"}/share/dbus-1/system-services"
36 "-Ddbus_interfacedir=${placeholder "out"}/share/dbus-1/interfaces"
37 "-Ddbus_rulesdir=${placeholder "out"}/etc/dbus-1/system.d"
38 "-Dpolkit_actiondir=${placeholder "out"}/share/polkit-1/actions"
39 "-Dsystemd_systemunitdir=${placeholder "out"}/etc/systemd/system"
40 ];
41
42 meta = with lib; {
43 homepage = "https://github.com/heftig/rtkit";
44 description = "A daemon that hands out real-time priority to processes";
45 license = with licenses; [ gpl3 bsd0 ]; # lib is bsd license
46 platforms = platforms.linux;
47 };
48}