summary refs log tree commit diff
path: root/pkgs/os-specific/linux/disk-indicator/default.nix
blob: b2ae930f193c73319d5fc81eec39ca74adf701f1 (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
{ stdenv, fetchgit, libX11 }:

stdenv.mkDerivation {
  name = "disk-indicator-2014-05-19";

  src = fetchgit {
    url = "git://github.com/MeanEYE/Disk-Indicator.git";
    rev = "51ef4afd8141b8d0659cbc7dc62189c56ae9c2da";
    sha256 = "10jx6mx9qarn21p2l2jayxkn1gmqhvck1wymgsr4jmbwxl8ra5kd";
  };

  buildInputs = [ libX11 ];

  patchPhase = ''
    substituteInPlace ./makefile --replace "COMPILER=c99" "COMPILER=gcc -std=c99"
    substituteInPlace ./makefile --replace "COMPILE_FLAGS=" "COMPILE_FLAGS=-O2 "
  '';

  buildPhase = "make -f makefile";

  NIX_CFLAGS_COMPILE = "-Wno-error=cpp";

  hardeningDisable = [ "fortify" ];

  installPhase = ''
    mkdir -p "$out/bin"
    cp ./disk_indicator "$out/bin/"
  '';

  meta = {
    homepage = "https://github.com/MeanEYE/Disk-Indicator";
    description = "A program that will turn a LED into a hard disk indicator";
    longDescription = ''
      Small program for Linux that will turn your Scroll, Caps or Num Lock LED
      or LED on your ThinkPad laptop into a hard disk activity indicator.
    '';
    license = stdenv.lib.licenses.gpl3;
    platforms = stdenv.lib.platforms.linux;
  };
}