depot/third_party/nixpkgs/pkgs/tools/security/spectre-meltdown-checker/default.nix
Default email 510ba8c3d9 Project import generated by Copybara.
GitOrigin-RevId: 069f183f16c3ea5d4b6e7625433b92eba77534f7
2020-11-15 05:44:38 -08:00

38 lines
1.1 KiB
Nix

{ stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
stdenv.mkDerivation rec {
pname = "spectre-meltdown-checker";
version = "0.44";
src = fetchFromGitHub {
owner = "speed47";
repo = "spectre-meltdown-checker";
rev = "v${version}";
sha256 = "1b47wlc52jnp2d5c7kbqnxmlm4g3cfbv25q30llv5mlmzs6d7bam";
};
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;
};
}