2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "spectre-meltdown-checker";
|
2020-11-15 13:44:38 +00:00
|
|
|
version = "0.44";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "speed47";
|
|
|
|
repo = "spectre-meltdown-checker";
|
|
|
|
rev = "v${version}";
|
2020-11-15 13:44:38 +00:00
|
|
|
sha256 = "1b47wlc52jnp2d5c7kbqnxmlm4g3cfbv25q30llv5mlmzs6d7bam";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace spectre-meltdown-checker.sh \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = with stdenv.lib; ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker
|
|
|
|
wrapProgram $out/bin/spectre-meltdown-checker \
|
|
|
|
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|