1{ lib, stdenv, fetchFromGitHub, libX11 }:
2
3stdenv.mkDerivation {
4 pname = "disk-indicator";
5 version = "unstable-2018-12-18";
6
7 src = fetchFromGitHub {
8 owner = "MeanEYE";
9 repo = "Disk-Indicator";
10 rev = "ec2d2f6833f038f07a72d15e2d52625c23e10b12";
11 sha256 = "sha256-cRqgIxF6H1WyJs5hhaAXVdWAlv6t22BZLp3p/qRlCSM=";
12 };
13
14 buildInputs = [ libX11 ];
15
16 postPatch = ''
17 # avoid -Werror
18 substituteInPlace Makefile --replace "-Werror" ""
19 # avoid host-specific options
20 substituteInPlace Makefile --replace "-march=native" ""
21 '';
22
23 postConfigure = ''
24 patchShebangs ./configure.sh
25 ./configure.sh --all
26 '';
27
28 makeFlags = [
29 "COMPILER=${stdenv.cc.targetPrefix}cc"
30 ];
31
32 installPhase = ''
33 runHook preInstall
34
35 mkdir -p "$out/bin"
36 cp ./disk_indicator "$out/bin/"
37
38 runHook postInstall
39 '';
40
41 meta = {
42 homepage = "https://github.com/MeanEYE/Disk-Indicator";
43 description = "A program that will turn a LED into a hard disk indicator";
44 longDescription = ''
45 Small program for Linux that will turn your Scroll, Caps or Num Lock LED
46 or LED on your ThinkPad laptop into a hard disk activity indicator.
47 '';
48 license = lib.licenses.gpl3;
49 platforms = lib.platforms.linux;
50 };
51}