3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/system/thinkfan/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake, libyamlcpp, pkgconfig
, smartSupport ? false, libatasmart }:
2013-04-05 23:34:50 +01:00
2015-12-27 20:21:43 +00:00
stdenv.mkDerivation rec {
pname = "thinkfan";
2019-09-24 20:22:55 +01:00
version = "1.0.2";
2013-04-05 23:34:50 +01:00
2019-02-16 10:51:59 +00:00
src = fetchFromGitHub {
owner = "vmatare";
repo = "thinkfan";
rev = version;
2019-09-24 20:22:55 +01:00
sha256 = "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr";
2013-04-05 23:34:50 +01:00
};
2015-12-27 20:21:43 +00:00
cmakeFlags = [
"-DCMAKE_INSTALL_DOCDIR=share/doc/${pname}"
2019-02-16 10:51:59 +00:00
"-DUSE_NVML=OFF"
] ++ stdenv.lib.optional smartSupport "-DUSE_ATASMART=ON";
2015-12-27 20:21:43 +00:00
nativeBuildInputs = [ cmake pkgconfig ];
2019-02-16 10:51:59 +00:00
buildInputs = [ libyamlcpp ] ++ stdenv.lib.optional smartSupport libatasmart;
2013-04-05 23:34:50 +01:00
installPhase = ''
runHook preInstall
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
runHook postInstall
2013-04-05 23:34:50 +01:00
'';
meta = with stdenv.lib; {
description = "A minimalist fan control program. Originally designed
specifically for IBM/Lenovo Thinkpads, it now supports any kind of system via
the sysfs hwmon interface (/sys/class/hwmon).";
license = licenses.gpl3;
homepage = "https://github.com/vmatare/thinkfan";
maintainers = with maintainers; [ domenkozar ];
platforms = platforms.linux;
2013-04-05 23:34:50 +01:00
};
}