2021-08-11 11:14:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, autoreconfHook
|
|
|
|
, enableMail ? false
|
2022-08-15 15:32:40 +00:00
|
|
|
, gnused
|
2022-11-29 14:27:47 +00:00
|
|
|
, hostname
|
2021-08-11 11:14:29 +00:00
|
|
|
, mailutils
|
|
|
|
, IOKit
|
|
|
|
, ApplicationServices
|
|
|
|
}:
|
2017-02-22 23:17:51 +00:00
|
|
|
|
|
|
|
let
|
2022-06-23 01:57:04 +00:00
|
|
|
dbrev = "5388";
|
|
|
|
drivedbBranch = "RELEASE_7_3_DRIVEDB";
|
2017-02-22 23:17:51 +00:00
|
|
|
driverdb = fetchurl {
|
2021-08-11 11:14:29 +00:00
|
|
|
url = "https://sourceforge.net/p/smartmontools/code/${dbrev}/tree/branches/${drivedbBranch}/smartmontools/drivedb.h?format=raw";
|
2022-06-23 01:57:04 +00:00
|
|
|
sha256 = "sha256-0dtLev4JjeHsS259+qOgg19rz4yjkeX4D3ooUgS4RTI=";
|
2021-08-11 11:14:29 +00:00
|
|
|
name = "smartmontools-drivedb.h";
|
2017-02-22 23:17:51 +00:00
|
|
|
};
|
2022-11-29 14:33:02 +00:00
|
|
|
scriptPath = lib.makeBinPath ([ gnused hostname ] ++ lib.optionals enableMail [ mailutils ]);
|
2017-02-22 23:17:51 +00:00
|
|
|
|
2021-08-11 11:14:29 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "smartmontools";
|
2022-06-23 01:57:04 +00:00
|
|
|
version = "7.3";
|
2011-07-08 10:51:18 +00:00
|
|
|
|
2007-10-18 13:05:43 +00:00
|
|
|
src = fetchurl {
|
2019-08-13 21:52:01 +00:00
|
|
|
url = "mirror://sourceforge/smartmontools/${pname}-${version}.tar.gz";
|
2022-06-23 01:57:04 +00:00
|
|
|
sha256 = "sha256-pUT4gI0MWM+w50JMoYQcuFipdJIrA11QXU5MJIvjois=";
|
2007-10-18 13:05:43 +00:00
|
|
|
};
|
|
|
|
|
2021-02-16 12:26:59 +00:00
|
|
|
patches = [
|
|
|
|
# fixes darwin build
|
|
|
|
./smartmontools.patch
|
|
|
|
];
|
2021-08-11 11:14:29 +00:00
|
|
|
postPatch = ''
|
|
|
|
cp -v ${driverdb} drivedb.h
|
|
|
|
'';
|
2012-09-18 17:33:12 +00:00
|
|
|
|
2022-08-23 15:48:41 +00:00
|
|
|
configureFlags = [ "--with-scriptpath=${scriptPath}" ];
|
2020-08-16 18:48:03 +00:00
|
|
|
|
2017-07-31 06:14:50 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2021-02-16 12:26:59 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ IOKit ApplicationServices ];
|
2017-07-31 06:14:50 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-05-15 16:41:33 +00:00
|
|
|
description = "Tools for monitoring the health of hard drives";
|
2021-08-11 11:14:29 +00:00
|
|
|
homepage = "https://www.smartmontools.org/";
|
|
|
|
license = licenses.gpl2Plus;
|
2021-10-14 08:59:33 +00:00
|
|
|
maintainers = with maintainers; [ Frostman ];
|
2021-08-11 11:14:29 +00:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2021-07-18 09:28:33 +00:00
|
|
|
mainProgram = "smartctl";
|
2007-10-18 13:05:43 +00:00
|
|
|
};
|
|
|
|
}
|