2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoreconfHook
|
2021-08-10 14:31:46 +00:00
|
|
|
, enableMail ? false, mailutils, inetutils
|
2021-02-05 17:12:51 +00:00
|
|
|
, IOKit, ApplicationServices }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-02-22 21:28:39 +00:00
|
|
|
dbrev = "5171";
|
2021-02-05 17:12:51 +00:00
|
|
|
drivedbBranch = "RELEASE_7_2_DRIVEDB";
|
2020-04-24 23:36:52 +00:00
|
|
|
driverdb = fetchurl {
|
|
|
|
url = "https://sourceforge.net/p/smartmontools/code/${dbrev}/tree/branches/${drivedbBranch}/smartmontools/drivedb.h?format=raw";
|
2021-02-22 21:28:39 +00:00
|
|
|
sha256 = "0vncr98xagbcfsxgfgxsip2qrl9q3y8va19qhv6yknlwbdfap4mn";
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "smartmontools-drivedb.h";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "smartmontools";
|
2021-07-17 21:14:59 +00:00
|
|
|
version = "7.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/smartmontools/${pname}-${version}.tar.gz";
|
2021-02-05 17:12:51 +00:00
|
|
|
sha256 = "1mlc25sd5rgj5xmzcllci47inmfdw7cp185fday6hc9rwqkqmnaw";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
patches = [
|
|
|
|
# fixes darwin build
|
|
|
|
./smartmontools.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = "cp -v ${driverdb} drivedb.h";
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
configureFlags = lib.optional enableMail
|
|
|
|
"--with-scriptpath=${lib.makeBinPath [ inetutils mailutils ]}";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2021-08-10 14:31:46 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ IOKit ApplicationServices ];
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tools for monitoring the health of hard drives";
|
|
|
|
homepage = "https://www.smartmontools.org/";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ peti Frostman ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2021-07-18 21:22:44 +00:00
|
|
|
mainProgram = "smartctl";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|