2019-09-24 23:33:22 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, libyamlcpp, pkgconfig
|
2019-02-03 21:34:41 +00:00
|
|
|
, smartSupport ? false, libatasmart }:
|
2013-04-05 23:34:50 +01:00
|
|
|
|
2015-12-27 20:21:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "thinkfan";
|
2020-04-05 07:33:21 +01:00
|
|
|
version = "1.1";
|
2013-04-05 23:34:50 +01:00
|
|
|
|
2019-02-16 10:51:59 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vmatare";
|
|
|
|
repo = "thinkfan";
|
2019-09-24 20:00:03 +01:00
|
|
|
rev = version;
|
2020-04-05 07:33:21 +01:00
|
|
|
sha256 = "1fxd1w3z65glw6y04myn7ihgswkx6sqnkky159mik4n96pfrsvr5";
|
2013-04-05 23:34:50 +01:00
|
|
|
};
|
2015-12-27 20:21:43 +00:00
|
|
|
|
2019-09-24 23:33:22 +01:00
|
|
|
cmakeFlags = [
|
2019-09-24 20:00:03 +01:00
|
|
|
"-DCMAKE_INSTALL_DOCDIR=share/doc/${pname}"
|
2019-02-16 10:51:59 +00:00
|
|
|
"-DUSE_NVML=OFF"
|
2019-09-24 23:33:22 +01:00
|
|
|
] ++ stdenv.lib.optional smartSupport "-DUSE_ATASMART=ON";
|
2015-12-27 20:21:43 +00:00
|
|
|
|
2019-09-24 23:33:22 +01:00
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
2019-02-16 10:51:59 +00:00
|
|
|
|
2019-09-24 23:33:22 +01:00
|
|
|
buildInputs = [ libyamlcpp ] ++ stdenv.lib.optional smartSupport libatasmart;
|
2019-02-03 21:34:41 +00:00
|
|
|
|
2013-04-05 23:34:50 +01:00
|
|
|
installPhase = ''
|
2019-09-29 22:59:13 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2016-05-03 23:33:27 +01:00
|
|
|
install -Dm755 {.,$out/bin}/thinkfan
|
|
|
|
|
2016-05-07 15:41:09 +01:00
|
|
|
cd "$NIX_BUILD_TOP"; cd "$sourceRoot" # attempt to be a bit robust
|
2016-05-03 23:33:27 +01:00
|
|
|
install -Dm644 {.,$out/share/doc/thinkfan}/README
|
|
|
|
cp -R examples $out/share/doc/thinkfan
|
2016-05-07 15:41:09 +01:00
|
|
|
install -Dm644 {src,$out/share/man/man1}/thinkfan.1
|
2019-09-29 22:59:13 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2013-04-05 23:34:50 +01:00
|
|
|
'';
|
|
|
|
|
2019-09-24 23:33:22 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-10-25 13:13:18 +00:00
|
|
|
description = "A minimalist fan control program";
|
|
|
|
longDescription = "A minimalist fan control program. Originally designed
|
2019-09-25 07:57:10 +01:00
|
|
|
specifically for IBM/Lenovo Thinkpads, it now supports any kind of system via
|
|
|
|
the sysfs hwmon interface (/sys/class/hwmon).";
|
2019-09-24 23:33:22 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
homepage = "https://github.com/vmatare/thinkfan";
|
|
|
|
maintainers = with maintainers; [ domenkozar ];
|
|
|
|
platforms = platforms.linux;
|
2013-04-05 23:34:50 +01:00
|
|
|
};
|
|
|
|
}
|