spectre-meltdown-checker: use finalAttrs pattern

This commit is contained in:
Pol Dellaiera 2023-07-29 22:45:43 +02:00
parent 8d17c20151
commit 703b264b07
No known key found for this signature in database
GPG key ID: D476DFE9C67467CA

View file

@ -1,14 +1,20 @@
{ lib, stdenv, fetchFromGitHub, makeWrapper, coreutils, binutils-unwrapped }:
{ lib
, stdenv
, fetchFromGitHub
, makeBinaryWrapper
, coreutils
, binutils-unwrapped
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "spectre-meltdown-checker";
version = "0.46";
src = fetchFromGitHub {
owner = "speed47";
repo = "spectre-meltdown-checker";
rev = "v${version}";
sha256 = "sha256-M4ngdtp2esZ+CSqZAiAeOnKtaK8Ra+TmQfMsr5q5gkg=";
rev = "v${finalAttrs.version}";
hash = "sha256-M4ngdtp2esZ+CSqZAiAeOnKtaK8Ra+TmQfMsr5q5gkg=";
};
prePatch = ''
@ -16,23 +22,23 @@ stdenv.mkDerivation rec {
--replace /bin/echo ${coreutils}/bin/echo
'';
nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeBinaryWrapper ];
installPhase = with lib; ''
installPhase = ''
runHook preInstall
install -Dm755 spectre-meltdown-checker.sh $out/bin/spectre-meltdown-checker
wrapProgram $out/bin/spectre-meltdown-checker \
--prefix PATH : ${makeBinPath [ binutils-unwrapped ]}
--prefix PATH : ${lib.makeBinPath [ binutils-unwrapped ]}
runHook postInstall
'';
meta = with lib; {
meta = {
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;
license = lib.licenses.gpl3;
maintainers = [ lib.maintainers.dotlambda ];
platforms = lib.platforms.linux;
};
}
})