1{ lib
2, stdenv
3, fetchFromGitHub
4, gitUpdater
5, meson
6, ninja
7, vala
8, pkg-config
9, pantheon
10, python3
11, curl
12, gettext
13, glib
14, gtk3
15, json-glib
16, libwnck
17, libgee
18, libgtop
19, libhandy
20, sassc
21, udisks2
22, wrapGAppsHook
23, libX11
24, libXext
25, libXNVCtrl
26}:
27
28stdenv.mkDerivation rec {
29 pname = "monitor";
30 version = "0.16.1";
31
32 src = fetchFromGitHub {
33 owner = "stsdc";
34 repo = "monitor";
35 rev = version;
36 sha256 = "sha256-ZTsb1xcJ7eeCEPebZW0anmG1SUPAzZakw4WzJql9VTQ=";
37 fetchSubmodules = true;
38 };
39
40 nativeBuildInputs = [
41 gettext
42 meson
43 ninja
44 vala
45 pkg-config
46 python3
47 wrapGAppsHook
48 ];
49
50 buildInputs = [
51 curl
52 glib
53 gtk3
54 json-glib
55 pantheon.granite
56 pantheon.wingpanel
57 libgee
58 libgtop
59 libhandy
60 libwnck
61 sassc
62 udisks2
63 libX11
64 libXext
65 libXNVCtrl
66 ];
67
68 # Force link against Xext, otherwise build fails with:
69 # ld: /nix/store/...-libXNVCtrl-495.46/lib/libXNVCtrl.a(NVCtrl.o): undefined reference to symbol 'XextAddDisplay'
70 # ld: /nix/store/...-libXext-1.3.4/lib/libXext.so.6: error adding symbols: DSO missing from command line
71 # https://github.com/stsdc/monitor/issues/292
72 NIX_LDFLAGS = "-lXext";
73
74 mesonFlags = [ "-Dindicator-wingpanel=enabled" ];
75
76 postPatch = ''
77 chmod +x meson/post_install.py
78 patchShebangs meson/post_install.py
79
80 # Alternatively, using pkg-config here should just work.
81 substituteInPlace meson.build --replace \
82 "meson.get_compiler('c').find_library('libcurl', dirs: vapidir)" \
83 "meson.get_compiler('c').find_library('libcurl', dirs: '${curl.out}/lib')"
84 '';
85
86 passthru = {
87 updateScript = gitUpdater {
88 ignoredVersions = "ci.*";
89 };
90 };
91
92 meta = with lib; {
93 description = "Manage processes and monitor system resources";
94 longDescription = ''
95 Manage processes and monitor system resources.
96 To use the wingpanel indicator in this application, see the Pantheon
97 section in the NixOS manual.
98 '';
99 homepage = "https://github.com/stsdc/monitor";
100 maintainers = with maintainers; [ xiorcale ] ++ teams.pantheon.members;
101 platforms = platforms.linux;
102 license = licenses.gpl3Plus;
103 mainProgram = "com.github.stsdc.monitor";
104 };
105}