diff options
author | Nicolas Benes <nbenes.gh@xandea.de> | 2022-12-04 05:18:31 +0100 |
---|---|---|
committer | Nicolas Benes <nbenes.gh@xandea.de> | 2022-12-04 11:59:55 +0100 |
commit | 846b4de5b80b1be104fb10ee2bb2f91eaf637f99 (patch) | |
tree | a2fc819d29b1e69c1c0b79cb634e595e5c96ce01 /pkgs/tools/misc/storcli | |
parent | e1c9caa2745a7b1e56d76cd1504b20618b43066f (diff) |
storcli: add support for aarch64-linux
Diffstat (limited to 'pkgs/tools/misc/storcli')
-rw-r--r-- | pkgs/tools/misc/storcli/default.nix | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/pkgs/tools/misc/storcli/default.nix b/pkgs/tools/misc/storcli/default.nix index f09d1c4ff5bb5..e5f01b6926c26 100644 --- a/pkgs/tools/misc/storcli/default.nix +++ b/pkgs/tools/misc/storcli/default.nix @@ -1,36 +1,52 @@ { lib , stdenvNoCC -, fetchurl +, fetchzip , rpmextract -, unzip }: stdenvNoCC.mkDerivation rec { pname = "storcli"; version = "7.2309.00"; - src = fetchurl { + src = fetchzip { url = "https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/Unified_storcli_all_os_${version}00.0000.zip"; - sha256 = "sha256-b98+drI83ddXMOpo6HnTDf75jr83JVIpAwEGjLesmVo="; + sha256 = "sha256-n2MzT2LHLHWMWhshWXJ/Q28w9EnLrW6t7hLNveltxLo="; }; - nativeBuildInputs = [ rpmextract unzip ]; + nativeBuildInputs = [ rpmextract ]; - buildCommand = '' - unzip $src - rpmextract Unified_storcli_all_os/Linux/storcli-*.noarch.rpm + 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 = '' install -D ./opt/MegaRAID/storcli/storcli64 $out/bin/storcli64 ln -s storcli64 $out/bin/storcli - - # Not needed because the binary is statically linked - #eval fixupPhase ''; + # Not needed because the binary is statically linked + dontFixup = true; + 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/site-search?q=storcli"; description = "Storage Command Line Tool"; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; maintainers = with maintainers; [ panicgh ]; - platforms = with platforms; intersectLists x86_64 linux; + platforms = [ "x86_64-linux" "aarch64-linux" ]; }; } |