diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index 3105cba5a344..2b6479198c97 100644 --- a/pkgs/tools/system/ipmitool/default.nix +++ b/pkgs/tools/system/ipmitool/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, openssl, static ? false }: +{ stdenv, lib, fetchurl, openssl, fetchpatch, static ? false }: let pkgname = "ipmitool"; @@ -12,19 +12,31 @@ stdenv.mkDerivation { sha256 = "0kfh8ny35rvwxwah4yv91a05qwpx74b5slq2lhrh71wz572va93m"; }; - patchPhase = stdenv.lib.optionalString stdenv.isDarwin '' - substituteInPlace src/plugins/ipmi_intf.c --replace "s6_addr16" "s6_addr" - ''; + patches = [ + (fetchpatch { + url = "https://sources.debian.org/data/main/i/ipmitool/1.8.18-6/debian/patches/0120-openssl1.1.patch"; + sha256 = "1xvsjxb782lzy72bnqqnsk3r5h4zl3na95s4pqn2qg7cic2mnbfk"; + }) + # Fix build on non-linux systems + (fetchpatch { + url = "https://github.com/ipmitool/ipmitool/commit/5db314f694f75c575cd7c9ffe9ee57aaf3a88866.patch"; + sha256 = "01niwrgajhrdhl441gzmw6v1r1yc3i8kn98db4b6smfn5fwdp1pa"; + }) + ]; buildInputs = [ openssl ]; - preConfigure = '' - configureFlagsArray=( - --infodir=$out/share/info - --mandir=$out/share/man - ${if static then "LDFLAGS=-static --enable-static --disable-shared" else "--enable-shared"} - ) - ''; + configureFlags = [ + "--infodir=${placeholder "out"}/share/info" + "--mandir=${placeholder "out"}/share/man" + ] ++ stdenv.lib.optionals static [ + "LDFLAGS=-static" + "--enable-static" + "--disable-shared" + ] ++ stdenv.lib.optionals (!static) [ + "--enable-shared" + ]; + makeFlags = stdenv.lib.optional static "AM_LDFLAGS=-all-static"; dontDisableStatic = static; @@ -32,7 +44,7 @@ stdenv.mkDerivation { description = ''Command-line interface to IPMI-enabled devices''; license = licenses.bsd3; homepage = https://sourceforge.net/projects/ipmitool/; - platforms = platforms.linux; + platforms = platforms.unix; maintainers = with maintainers; [ fpletz ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c866e84851e0..409a2d9f79fa 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4263,9 +4263,7 @@ in ipget = callPackage ../applications/networking/ipget { }; - ipmitool = callPackage ../tools/system/ipmitool { - openssl = openssl_1_0_2; - }; + ipmitool = callPackage ../tools/system/ipmitool {}; ipmiutil = callPackage ../tools/system/ipmiutil {};