2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeBinaryWrapper
|
|
|
|
, coreutils
|
|
|
|
, binutils-unwrapped
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "spectre-meltdown-checker";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.46";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "speed47";
|
|
|
|
repo = "spectre-meltdown-checker";
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-M4ngdtp2esZ+CSqZAiAeOnKtaK8Ra+TmQfMsr5q5gkg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace spectre-meltdown-checker.sh \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [ makeBinaryWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
installPhase = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm755 spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker
|
|
|
|
wrapProgram $out/bin/spectre-meltdown-checker \
|
2023-08-04 22:07:22 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ binutils-unwrapped ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
meta = {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Spectre & Meltdown vulnerability/mitigation checker for Linux";
|
|
|
|
homepage = "https://github.com/speed47/spectre-meltdown-checker";
|
2023-08-04 22:07:22 +00:00
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
maintainers = [ lib.maintainers.dotlambda ];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
})
|