1{ lib
2, stdenv
3, fetchFromGitLab
4, glib
5, cmake
6, libxml2
7, meson
8, ninja
9, pkg-config
10, libgudev
11, systemd
12, polkit
13}:
14
15stdenv.mkDerivation rec {
16 pname = "iio-sensor-proxy";
17 version = "3.5";
18
19 src = fetchFromGitLab {
20 domain = "gitlab.freedesktop.org";
21 owner = "hadess";
22 repo = pname;
23 rev = version;
24 hash = "sha256-pFu+nJzj45s7yIKoLWLeiv2AT5vLf6JpdWWQ0JZfnvY=";
25 };
26
27 postPatch = ''
28 # upstream meson.build currently doesn't have an option to change the default polkit dir
29 substituteInPlace data/meson.build \
30 --replace 'polkit_policy_directory' "'$out/share/polkit-1/actions'"
31 '';
32
33 buildInputs = [
34 libgudev
35 systemd
36 polkit
37 ];
38
39 nativeBuildInputs = [
40 meson
41 cmake
42 glib
43 libxml2
44 ninja
45 pkg-config
46 ];
47
48 mesonFlags = [
49 (lib.mesonOption "udevrulesdir" "${placeholder "out"}/lib/udev/rules.d")
50 (lib.mesonOption "systemdsystemunitdir" "${placeholder "out"}/lib/systemd/system")
51 ];
52
53 meta = with lib; {
54 description = "Proxy for sending IIO sensor data to D-Bus";
55 homepage = "https://gitlab.freedesktop.org/hadess/iio-sensor-proxy";
56 license = licenses.gpl3;
57 maintainers = with maintainers; [ _999eagle ];
58 platforms = platforms.linux;
59 };
60}