2019-02-16 02:51:59 -08:00
|
|
|
{ stdenv, fetchFromGitHub, cmakeCurses, libyamlcpp, pkgconfig
|
2019-02-03 13:34:41 -08:00
|
|
|
, smartSupport ? false, libatasmart }:
|
2013-04-05 15:34:50 -07:00
|
|
|
|
2015-12-27 12:21:43 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "thinkfan";
|
2019-09-24 12:22:55 -07:00
|
|
|
version = "1.0.2";
|
2013-04-05 15:34:50 -07:00
|
|
|
|
2019-02-16 02:51:59 -08:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vmatare";
|
|
|
|
repo = "thinkfan";
|
2019-09-24 12:00:03 -07:00
|
|
|
rev = version;
|
2019-09-24 12:22:55 -07:00
|
|
|
sha256 = "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr";
|
2013-04-05 15:34:50 -07:00
|
|
|
};
|
2015-12-27 12:21:43 -08:00
|
|
|
|
2019-02-16 02:51:59 -08:00
|
|
|
configureFlags = [
|
2019-09-24 12:00:03 -07:00
|
|
|
"-DCMAKE_INSTALL_DOCDIR=share/doc/${pname}"
|
2019-02-16 02:51:59 -08:00
|
|
|
"-DUSE_NVML=OFF"
|
|
|
|
"-DUSE_ATASMART=ON"
|
|
|
|
"-DUSE_YAML=ON"
|
|
|
|
];
|
2015-12-27 12:21:43 -08:00
|
|
|
|
2019-02-16 02:51:59 -08:00
|
|
|
nativeBuildInputs = [ cmakeCurses pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [libyamlcpp] ++ stdenv.lib.optional smartSupport libatasmart;
|
2019-02-03 13:34:41 -08:00
|
|
|
|
|
|
|
cmakeFlags = stdenv.lib.optional smartSupport "-DUSE_ATASMART=ON";
|
|
|
|
|
2013-04-05 15:34:50 -07:00
|
|
|
installPhase = ''
|
2016-05-03 15:33:27 -07:00
|
|
|
install -Dm755 {.,$out/bin}/thinkfan
|
|
|
|
|
2016-05-07 07:41:09 -07:00
|
|
|
cd "$NIX_BUILD_TOP"; cd "$sourceRoot" # attempt to be a bit robust
|
2016-05-03 15:33:27 -07:00
|
|
|
install -Dm644 {.,$out/share/doc/thinkfan}/README
|
|
|
|
cp -R examples $out/share/doc/thinkfan
|
2016-05-07 07:41:09 -07:00
|
|
|
install -Dm644 {src,$out/share/man/man1}/thinkfan.1
|
2013-04-05 15:34:50 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-04-05 23:19:57 -07:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2019-02-16 02:51:59 -08:00
|
|
|
homepage = https://github.com/vmatare/thinkfan;
|
2018-01-16 13:59:13 -08:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ domenkozar ];
|
2013-04-05 15:34:50 -07:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|