From e1c9caa2745a7b1e56d76cd1504b20618b43066f Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Sun, 4 Dec 2022 04:07:45 +0100 Subject: [PATCH 1/4] storcli: 7.2106.00 -> 7.2309.00 --- pkgs/tools/misc/storcli/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/storcli/default.nix b/pkgs/tools/misc/storcli/default.nix index 03300f46f8c0..f09d1c4ff5bb 100644 --- a/pkgs/tools/misc/storcli/default.nix +++ b/pkgs/tools/misc/storcli/default.nix @@ -4,13 +4,14 @@ , rpmextract , unzip }: + stdenvNoCC.mkDerivation rec { pname = "storcli"; - version = "7.2106.00"; + version = "7.2309.00"; src = fetchurl { - url = "https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/00${version}00.0000_Unified_StorCLI.zip"; - sha256 = "sha256-sRMpNXCdcysliVQwRE/1yAeU/cp+y0f2F8BPiWyotxQ="; + 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="; }; nativeBuildInputs = [ rpmextract unzip ]; From 846b4de5b80b1be104fb10ee2bb2f91eaf637f99 Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Sun, 4 Dec 2022 05:18:31 +0100 Subject: [PATCH 2/4] storcli: add support for aarch64-linux --- pkgs/tools/misc/storcli/default.nix | 44 ++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/pkgs/tools/misc/storcli/default.nix b/pkgs/tools/misc/storcli/default.nix index f09d1c4ff5bb..e5f01b6926c2 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 - 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 + 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 + 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" ]; }; } From 846af65f2732c83b03cd656d0ab510751d54f023 Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Sun, 4 Dec 2022 11:40:00 +0100 Subject: [PATCH 3/4] perccli: 7.1910.00 -> 7.2110.00 --- pkgs/tools/misc/perccli/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/perccli/default.nix b/pkgs/tools/misc/perccli/default.nix index 517fffead533..fcb4f2725b84 100644 --- a/pkgs/tools/misc/perccli/default.nix +++ b/pkgs/tools/misc/perccli/default.nix @@ -3,13 +3,16 @@ , fetchurl , rpmextract }: + stdenvNoCC.mkDerivation rec { pname = "perccli"; - version = "7.1910.00"; + version = "7.2110.00"; src = fetchurl { - url = "https://dl.dell.com/FOLDER07815522M/1/PERCCLI_${version}_A12_Linux.tar.gz"; - sha256 = "sha256-Gt/kr5schR/IzFmnhXO57gjZpOJ9NSnPX/Sj7zo8Qjk="; + # On pkg update: manually adjust the version in the URL because of the different format. + url = "https://dl.dell.com/FOLDER09074160M/1/PERCCLI_7.211.0_Linux.tar.gz"; + sha256 = "sha256-FQasejMVm80uliXOg/riGGwcsK0fSDGh1KYz9r34wBQ="; + # Dell seems to block "uncommon" user-agents, such as Nixpkgs's custom one. # Sending no user-agent at all seems to be fine though. curlOptsList = [ "--user-agent" "" ]; @@ -19,7 +22,7 @@ stdenvNoCC.mkDerivation rec { buildCommand = '' tar xf $src - rpmextract PERCCLI_*_Linux/perccli-*.noarch.rpm + rpmextract perccli-00${version}00.0000-1.noarch.rpm install -D ./opt/MegaRAID/perccli/perccli64 $out/bin/perccli64 ln -s perccli64 $out/bin/perccli From bdd6f483ae280fa0990406fd117dc21bbf407f07 Mon Sep 17 00:00:00 2001 From: Nicolas Benes Date: Sun, 4 Dec 2022 11:55:24 +0100 Subject: [PATCH 4/4] perccli: stylistic rewrite --- pkgs/tools/misc/perccli/default.nix | 35 +++++++++++++++++++---------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/misc/perccli/default.nix b/pkgs/tools/misc/perccli/default.nix index fcb4f2725b84..aca382d50462 100644 --- a/pkgs/tools/misc/perccli/default.nix +++ b/pkgs/tools/misc/perccli/default.nix @@ -1,6 +1,6 @@ { lib , stdenvNoCC -, fetchurl +, fetchzip , rpmextract }: @@ -8,10 +8,10 @@ stdenvNoCC.mkDerivation rec { pname = "perccli"; version = "7.2110.00"; - src = fetchurl { + src = fetchzip { # On pkg update: manually adjust the version in the URL because of the different format. url = "https://dl.dell.com/FOLDER09074160M/1/PERCCLI_7.211.0_Linux.tar.gz"; - sha256 = "sha256-FQasejMVm80uliXOg/riGGwcsK0fSDGh1KYz9r34wBQ="; + sha256 = "sha256-8gk+0CrgeisfN2hNpaO1oFey57y7KuNy2i6PWTikDls="; # Dell seems to block "uncommon" user-agents, such as Nixpkgs's custom one. # Sending no user-agent at all seems to be fine though. @@ -20,21 +20,32 @@ stdenvNoCC.mkDerivation rec { nativeBuildInputs = [ rpmextract ]; - buildCommand = '' - tar xf $src - rpmextract perccli-00${version}00.0000-1.noarch.rpm - install -D ./opt/MegaRAID/perccli/perccli64 $out/bin/perccli64 - ln -s perccli64 $out/bin/perccli - - # Not needed because the binary is statically linked - #eval fixupPhase + unpackPhase = '' + rpmextract $src/perccli-00${version}00.0000-1.noarch.rpm ''; + dontPatch = true; + dontConfigure = true; + dontBuild = true; + + installPhase = let + inherit (stdenvNoCC.hostPlatform) system; + platforms = { + x86_64-linux = '' + install -D ./opt/MegaRAID/perccli/perccli64 $out/bin/perccli64 + ln -s perccli64 $out/bin/perccli + ''; + }; + in platforms.${system} or (throw "unsupported system: ${system}"); + + # Not needed because the binary is statically linked + dontFixup = true; + meta = with lib; { description = "Perccli Support for PERC RAID controllers"; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; maintainers = with maintainers; [ panicgh ]; - platforms = with platforms; intersectLists x86_64 linux; + platforms = [ "x86_64-linux" ]; }; }