2021-09-19 15:07:31 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2021-09-28 15:00:15 +00:00
|
|
|
, bash
|
2021-09-19 15:07:31 +00:00
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, which
|
|
|
|
, perl
|
|
|
|
, sensord ? false
|
|
|
|
, rrdtool ? null
|
2017-12-02 15:46:14 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert sensord -> rrdtool != null;
|
2011-12-21 10:28:09 +00:00
|
|
|
|
2009-09-15 22:06:38 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "lm-sensors";
|
2019-10-25 18:21:49 +00:00
|
|
|
version = "3.6.0";
|
2021-09-19 15:07:31 +00:00
|
|
|
dashedVersion = lib.replaceStrings [ "." ] [ "-" ] version;
|
2017-12-02 15:46:14 +00:00
|
|
|
|
2021-09-19 15:07:31 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lm-sensors";
|
|
|
|
repo = "lm-sensors";
|
|
|
|
rev = "V${dashedVersion}";
|
|
|
|
hash = "sha256-9lfHCcODlS7sZMjQhK0yQcCBEoGyZOChx/oM0CU37sY=";
|
2008-09-01 11:42:43 +00:00
|
|
|
};
|
|
|
|
|
2018-12-01 16:02:49 +00:00
|
|
|
nativeBuildInputs = [ bison flex which ];
|
2021-09-28 15:00:15 +00:00
|
|
|
# bash is required for correctly replacing the shebangs in all tools for cross-compilation.
|
|
|
|
buildInputs = [ bash perl ]
|
2021-09-19 15:07:31 +00:00
|
|
|
++ lib.optional sensord rrdtool;
|
2008-09-01 11:42:43 +00:00
|
|
|
|
2020-10-04 17:57:53 +00:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"AR=${stdenv.cc.targetPrefix}ar"
|
2021-01-15 14:45:37 +00:00
|
|
|
] ++ lib.optional sensord "PROG_EXTRA=sensord";
|
2008-09-01 11:42:43 +00:00
|
|
|
|
2021-03-22 05:58:04 +00:00
|
|
|
installFlags = [
|
|
|
|
"ETCDIR=${placeholder "out"}/etc"
|
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-10-25 18:21:49 +00:00
|
|
|
homepage = "https://hwmon.wiki.kernel.org/lm_sensors";
|
|
|
|
changelog = "https://raw.githubusercontent.com/lm-sensors/lm-sensors/V${dashedVersion}/CHANGES";
|
2008-09-01 11:42:43 +00:00
|
|
|
description = "Tools for reading hardware sensors";
|
2019-10-25 18:21:49 +00:00
|
|
|
license = with licenses; [ lgpl21Plus gpl2Plus ];
|
2021-11-21 04:51:05 +00:00
|
|
|
maintainers = with maintainers; [ pmy ];
|
2018-08-30 19:35:57 +00:00
|
|
|
platforms = platforms.linux;
|
2021-04-27 17:25:57 +00:00
|
|
|
mainProgram = "sensors";
|
2008-09-01 11:42:43 +00:00
|
|
|
};
|
|
|
|
}
|