summary refs log tree commit diff
path: root/pkgs/os-specific/linux/i7z/default.nix
blob: 48d28036aa4fda8e718d0fa01cd03aaee45613de (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
50
51
52
53
54
{ stdenv, lib, fetchurl, ncurses
, withGui ? false, qt4 ? null }:

stdenv.mkDerivation rec {
  name = "i7z-0.27.2";

  src = fetchurl {
    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/i7z/${name}.tar.gz";
    sha256 = "1wa7ix6m75wl3k2n88sz0x8cckvlzqklja2gvzqfw5rcfdjjvxx7";
  };

  buildInputs = [ ncurses ] ++ lib.optional withGui qt4;

  enableParallelBuilding = true;

  buildPhase = ''
    runHook preBuild

    make
    ${lib.optionalString withGui ''
      cd GUI
      qmake
      make clean
      make
      cd ..
    ''}

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    mkdir -p $out/{bin,sbin}
    make install prefix=$out
    ${lib.optionalString withGui ''
      install -Dm755 GUI/i7z_GUI $out/bin/i7z-gui
    ''}
    mv $out/sbin/* $out/bin/
    rmdir $out/sbin

    runHook postInstall
  '';

  meta = with lib; {
    description = "A better i7 (and now i3, i5) reporting tool for Linux";
    homepage = https://github.com/ajaiantilal/i7z;
    repositories.git = https://github.com/ajaiantilal/i7z.git;
    license = licenses.gpl2;
    maintainers = with maintainers; [ bluescreen303 ];
    # broken on ARM
    platforms = [ "x86_64-linux" ];
  };
}