summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Benes <nbenes.gh@xandea.de>2022-12-04 11:55:24 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-12-04 17:43:28 +0000
commit3595008c0b397d5980a89708a7145f6002b558bd (patch)
tree06b413defcb6e21e7245db18cff04d49f07df0b4
parentperccli: 7.1910.00 -> 7.2110.00 (diff)
downloadnixpkgs-origin/backport-204473-to-release-22.11.tar.gz
perccli: stylistic rewriteorigin/backport-204473-to-release-22.11
(cherry picked from commit bdd6f483ae280fa0990406fd117dc21bbf407f07)
-rw-r--r--pkgs/tools/misc/perccli/default.nix35
1 files 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" ];
};
}