nixpkgs/pkgs/tools/system/smartmontools/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.4 KiB
Nix
Raw Normal View History

2021-08-11 11:14:29 +00:00
{ lib
, stdenv
, fetchurl
, autoreconfHook
, enableMail ? false
, gnused
, hostname
2021-08-11 11:14:29 +00:00
, mailutils
, IOKit
, ApplicationServices
}:
let
dbrev = "5388";
drivedbBranch = "RELEASE_7_3_DRIVEDB";
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";
sha256 = "sha256-0dtLev4JjeHsS259+qOgg19rz4yjkeX4D3ooUgS4RTI=";
2021-08-11 11:14:29 +00:00
name = "smartmontools-drivedb.h";
};
scriptPath = lib.makeBinPath ([ gnused hostname ] ++ lib.optionals enableMail [ mailutils ]);
2021-08-11 11:14:29 +00:00
in
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "smartmontools";
version = "7.3";
src = fetchurl {
2019-08-13 21:52:01 +00:00
url = "mirror://sourceforge/smartmontools/${pname}-${version}.tar.gz";
sha256 = "sha256-pUT4gI0MWM+w50JMoYQcuFipdJIrA11QXU5MJIvjois=";
};
patches = [
# fixes darwin build
./smartmontools.patch
];
2021-08-11 11:14:29 +00:00
postPatch = ''
cp -v ${driverdb} drivedb.h
'';
configureFlags = [ "--with-scriptpath=${scriptPath}" ];
nativeBuildInputs = [ autoreconfHook ];
buildInputs = lib.optionals stdenv.isDarwin [ IOKit ApplicationServices ];
enableParallelBuilding = true;
meta = with lib; {
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;
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";
};
}