Files
nixpkgs/pkgs/by-name/st/storcli2/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

74 lines
2.1 KiB
Nix

{
lib,
stdenvNoCC,
fetchzip,
rpmextract,
testers,
}:
stdenvNoCC.mkDerivation (
finalAttrs:
let
majVer = "8";
minVer = "11";
relPhs = "14";
verCode = "00" + majVer + ".00" + minVer + ".0000.00" + relPhs;
in
{
pname = "storcli";
version = majVer + "." + minVer;
src = fetchzip {
url = "https://docs.broadcom.com/docs-and-downloads/host-bus-adapters/host-bus-adapters-common-files/sas_sata_nvme_24g_p${finalAttrs.version}/StorCLI_Avenger_${finalAttrs.version}-${verCode}.zip";
hash = "sha256-vztV+Jp+p6nU4q7q8QQIkuL30QsoGj2tyIZp87luhH8=";
};
nativeBuildInputs = [ rpmextract ];
unpackPhase =
let
inherit (stdenvNoCC.hostPlatform) system;
platforms = {
x86_64-linux = "Linux";
aarch64-linux = "ARM/Linux";
};
platform = platforms.${system} or (throw "unsupported system: ${system}");
in
''
rpmextract $src/Avenger_StorCLI/${platform}/storcli2-${verCode}-1.*.rpm
'';
dontPatch = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
install -D ./opt/MegaRAID/storcli2/storcli2 $out/bin/storcli2
'';
# Not needed because the binary is statically linked
dontFixup = false;
passthru.tests = testers.testVersion {
package = finalAttrs.finalPackage;
command = "${finalAttrs.meta.mainProgram} v";
version = verCode;
};
meta = with lib; {
# Unfortunately there is no better page for this.
# Filter for downloads, set 100 items per page. Sort by newest does not work.
# Then search manually for the latest version.
homepage = "https://www.broadcom.com/support/download-search?pg=&pf=Host+Bus+Adapters&pn=&pa=&po=&dk=storcli2&pl=&l=false";
description = "Storage Command Line Tool";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ edwtjo ];
mainProgram = "storcli2";
platforms = [
"x86_64-linux"
"aarch64-linux"
];
};
}
)