about summary refs log tree commit diff
path: root/pkgs/tools/system/stacer/default.nix
blob: 75068148bd74cb6e30c51ed2f3e965af6d9d8a70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, stdenv
, fetchFromGitHub
, cmake
, qtcharts
, qttools
, wrapQtAppsHook
}:

stdenv.mkDerivation rec {
  pname = "stacer";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "oguzhaninan";
    repo = pname;
    rev = "v${version}";
    sha256 = "0qndzzkbq6abapvwq202kva8j619jdn9977sbqmmfs9zkjz4mbsd";
  };

  postPatch = ''
    substituteInPlace stacer/Managers/app_manager.cpp \
      --replace 'qApp->applicationDirPath() + "/translations"' \
                'QStandardPaths::locate(QStandardPaths::AppDataLocation, "translations", QStandardPaths::LocateDirectory)'
  '';

  buildInputs = [
    qtcharts
    qttools
  ];

  nativeBuildInputs = [ cmake wrapQtAppsHook ];

  preConfigure = ''
    lrelease stacer/stacer.pro
  '';

  postInstall = ''
    install -Dm644 ../translations/*.qm -t $out/share/stacer/translations
  '';

  meta = with lib; {
    description = "Linux System Optimizer and Monitoring";
    homepage = "https://github.com/oguzhaninan/stacer";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ dit7ya ];
    platforms = platforms.linux;
  };
}