nixpkgs/pkgs/tools/system/thinkfan/default.nix

44 lines
1.2 KiB
Nix
Raw Normal View History

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