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

54 lines
1.4 KiB
Nix
Raw Normal View History

2021-08-11 13:14:29 +02:00
{ lib
, stdenv
, fetchurl
, autoreconfHook
, enableMail ? false
, mailutils
, inetutils
, IOKit
, ApplicationServices
}:
let
dbrev = "5171";
drivedbBranch = "RELEASE_7_2_DRIVEDB";
driverdb = fetchurl {
2021-08-11 13:14:29 +02:00
url = "https://sourceforge.net/p/smartmontools/code/${dbrev}/tree/branches/${drivedbBranch}/smartmontools/drivedb.h?format=raw";
sha256 = "0vncr98xagbcfsxgfgxsip2qrl9q3y8va19qhv6yknlwbdfap4mn";
2021-08-11 13:14:29 +02:00
name = "smartmontools-drivedb.h";
};
2021-08-11 13:14:29 +02:00
in
stdenv.mkDerivation rec {
2019-08-13 23:52:01 +02:00
pname = "smartmontools";
2021-07-14 17:10:11 +02:00
version = "7.2";
src = fetchurl {
2019-08-13 23:52:01 +02:00
url = "mirror://sourceforge/smartmontools/${pname}-${version}.tar.gz";
sha256 = "1mlc25sd5rgj5xmzcllci47inmfdw7cp185fday6hc9rwqkqmnaw";
};
patches = [
# fixes darwin build
./smartmontools.patch
];
2021-08-11 13:14:29 +02:00
postPatch = ''
cp -v ${driverdb} drivedb.h
'';
2021-08-11 13:14:29 +02:00
configureFlags = lib.optional enableMail "--with-scriptpath=${lib.makeBinPath [ inetutils mailutils ]}";
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 13:14:29 +02:00
homepage = "https://www.smartmontools.org/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ peti Frostman ];
2021-08-11 13:14:29 +02:00
platforms = with platforms; linux ++ darwin;
2021-07-18 11:28:33 +02:00
mainProgram = "smartctl";
};
}