2018-01-21 15:53:35 +01:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
|
2018-01-14 15:38:36 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "spectre-meltdown-checker-${version}";
|
2018-02-16 14:45:42 +01:00
|
|
|
version = "0.35";
|
2018-01-14 15:38:36 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "speed47";
|
|
|
|
repo = "spectre-meltdown-checker";
|
|
|
|
rev = "v${version}";
|
2018-02-16 14:45:42 +01:00
|
|
|
sha256 = "0pzs6iznrar5zkg92gsh6d0zhdi715zwqcb8hh1aaykx9igjb1xw";
|
2018-01-14 15:38:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace spectre-meltdown-checker.sh \
|
2018-01-14 22:50:42 +01:00
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
2018-01-14 15:38:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = with stdenv.lib; ''
|
|
|
|
install -Dt $out/lib spectre-meltdown-checker.sh
|
|
|
|
makeWrapper $out/lib/spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker \
|
|
|
|
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Spectre & Meltdown vulnerability/mitigation checker for Linux";
|
|
|
|
homepage = https://github.com/speed47/spectre-meltdown-checker;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|