2018-01-21 14:53:35 +00:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
|
2018-01-14 14:38:36 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "spectre-meltdown-checker";
|
2019-12-24 18:41:17 +00:00
|
|
|
version = "0.43";
|
2018-01-14 14:38:36 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "speed47";
|
|
|
|
repo = "spectre-meltdown-checker";
|
|
|
|
rev = "v${version}";
|
2019-12-24 18:41:17 +00:00
|
|
|
sha256 = "1ys5m1yvm26qjlsjpqqd33lwpb880p0ay289hmifxjjawkqddjgg";
|
2018-01-14 14:38:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace spectre-meltdown-checker.sh \
|
2018-01-14 21:50:42 +00:00
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
2018-01-14 14:38:36 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = with stdenv.lib; ''
|
2018-08-16 03:53:31 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker
|
2018-04-19 07:20:40 +01:00
|
|
|
wrapProgram $out/bin/spectre-meltdown-checker \
|
2018-01-14 14:38:36 +00:00
|
|
|
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
|
2018-08-16 03:53:31 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2018-01-14 14:38:36 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Spectre & Meltdown vulnerability/mitigation checker for Linux";
|
|
|
|
homepage = https://github.com/speed47/spectre-meltdown-checker;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2018-08-16 03:53:31 +01:00
|
|
|
platforms = platforms.linux;
|
2018-01-14 14:38:36 +00:00
|
|
|
};
|
|
|
|
}
|