Unverified Commit 55db0d0a authored by Franz Pletz's avatar Franz Pletz Committed by GitHub
Browse files

ipmitool: 1.8.19 -> 1.8.19-unstable-2023-01-12 (#394962)

parents 1d09c579 ad5cfc1f
Loading
Loading
Loading
Loading
+24 −17
Original line number Diff line number Diff line
@@ -3,48 +3,55 @@
  lib,
  fetchFromGitHub,
  autoreconfHook,
  pkg-config,
  openssl,
  readline,
  fetchurl,
}:

let

  iana-enterprise-numbers = fetchurl {
    url = "https://web.archive.org/web/20230312103209id_/https://www.iana.org/assignments/enterprise-numbers.txt";
    sha256 = "sha256-3Z5uoOYfbF1o6MSgvnr00w4Z5w4IHc56L1voKDzeH/w=";
    url = "https://web.archive.org/web/20250113140800id_/https://www.iana.org/assignments/enterprise-numbers.txt";
    hash = "sha256-aRgBEfZYwoL6YnU3aD0WYeMnJD5ZCj34S/9aQyzBIO4=";
  };

in
stdenv.mkDerivation rec {
stdenv.mkDerivation {
  pname = "ipmitool";
  version = "1.8.19";
  version = "1.8.19-unstable-2023-01-12";

  src = fetchFromGitHub {
    owner = pname;
    repo = pname;
    rev = "IPMITOOL_${lib.replaceStrings [ "." ] [ "_" ] version}";
    hash = "sha256-VVYvuldRIHhaIUibed9cLX8Avfy760fdBLNO8MoUKCk=";
    owner = "ipmitool";
    repo = "ipmitool";
    rev = "be11d948f89b10be094e28d8a0a5e8fb532c7b60";
    hash = "sha256-5s0F2cTZdmRb/I0rPqX/8KgK/7b5VCl3Hj/ALKpGbMQ=";
  };

  nativeBuildInputs = [ autoreconfHook ];
  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];

  buildInputs = [
    openssl
    readline
  ];

  postPatch = ''
    substituteInPlace configure.ac \
      --replace 'AC_MSG_WARN([** Neither wget nor curl could be found.])' 'AM_CONDITIONAL([DOWNLOAD], [true])'
    # Fixes `ipmi_fru.c:1556:41: error: initialization of 'struct fru_multirec_mgmt *' from incompatible pointer type 'struct fru_multirect_mgmt *' []`
    # Probably fine before GCC14, but this is an error now.
    substituteInPlace lib/ipmi_fru.c \
      --replace-fail fru_multirect_mgmt fru_multirec_mgmt
    cp ${iana-enterprise-numbers} enterprise-numbers
  '';

  meta = with lib; {
  configureFlags = [ "--disable-registry-download" ];

  meta = {
    description = "Command-line interface to IPMI-enabled devices";
    mainProgram = "ipmitool";
    license = licenses.bsd3;
    license = lib.licenses.bsd3;
    homepage = "https://github.com/ipmitool/ipmitool";
    platforms = platforms.unix;
    maintainers = with maintainers; [ fpletz ];
    platforms = lib.platforms.unix;
    maintainers = with lib.maintainers; [ fpletz ];
  };
}