nixpkgs/pkgs/tools/misc/storcli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.5 KiB
Nix
Raw Normal View History

2022-08-03 11:10:59 +00:00
{ lib
, stdenvNoCC
2022-12-04 04:18:31 +00:00
, fetchzip
2022-08-03 11:10:59 +00:00
, rpmextract
}:
2022-12-04 03:07:45 +00:00
2022-08-03 11:10:59 +00:00
stdenvNoCC.mkDerivation rec {
pname = "storcli";
2022-12-04 03:07:45 +00:00
version = "7.2309.00";
2022-08-03 11:10:59 +00:00
2022-12-04 04:18:31 +00:00
src = fetchzip {
2022-12-04 03:07:45 +00:00
url = "https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/Unified_storcli_all_os_${version}00.0000.zip";
2022-12-04 04:18:31 +00:00
sha256 = "sha256-n2MzT2LHLHWMWhshWXJ/Q28w9EnLrW6t7hLNveltxLo=";
2022-08-03 11:10:59 +00:00
};
2022-12-04 04:18:31 +00:00
nativeBuildInputs = [ rpmextract ];
2022-08-03 11:10:59 +00:00
2022-12-04 04:18:31 +00:00
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/${platform}/storcli-00${version}00.0000-1.*.rpm
'';
dontPatch = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
2022-08-03 11:10:59 +00:00
install -D ./opt/MegaRAID/storcli/storcli64 $out/bin/storcli64
ln -s storcli64 $out/bin/storcli
'';
2022-12-04 04:18:31 +00:00
# Not needed because the binary is statically linked
dontFixup = true;
2022-08-03 11:10:59 +00:00
meta = with lib; {
2022-12-04 04:18:31 +00:00
# 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/site-search?q=storcli";
2022-08-03 11:10:59 +00:00
description = "Storage Command Line Tool";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ panicgh ];
2022-12-04 04:18:31 +00:00
platforms = [ "x86_64-linux" "aarch64-linux" ];
2022-08-03 11:10:59 +00:00
};
}