1{ lib, stdenv, fetchgit, libX11 }:
2
3stdenv.mkDerivation {
4 pname = "disk-indicator";
5 version = "unstable-2014-05-19";
6
7 src = fetchgit {
8 url = "git://github.com/MeanEYE/Disk-Indicator.git";
9 rev = "51ef4afd8141b8d0659cbc7dc62189c56ae9c2da";
10 sha256 = "10jx6mx9qarn21p2l2jayxkn1gmqhvck1wymgsr4jmbwxl8ra5kd";
11 };
12
13 buildInputs = [ libX11 ];
14
15 patchPhase = ''
16 substituteInPlace ./makefile --replace "COMPILER=c99" "COMPILER=gcc -std=c99"
17 substituteInPlace ./makefile --replace "COMPILE_FLAGS=" "COMPILE_FLAGS=-O2 "
18 '';
19
20 buildPhase = "make -f makefile";
21
22 NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
23
24 hardeningDisable = [ "fortify" ];
25
26 installPhase = ''
27 mkdir -p "$out/bin"
28 cp ./disk_indicator "$out/bin/"
29 '';
30
31 meta = {
32 homepage = "https://github.com/MeanEYE/Disk-Indicator";
33 description = "A program that will turn a LED into a hard disk indicator";
34 longDescription = ''
35 Small program for Linux that will turn your Scroll, Caps or Num Lock LED
36 or LED on your ThinkPad laptop into a hard disk activity indicator.
37 '';
38 license = lib.licenses.gpl3;
39 platforms = lib.platforms.linux;
40 };
41}