From ad19bb5ff849dfa9af2ad52afda361198391db43 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Mon, 24 Feb 2020 23:08:00 +0100 Subject: [PATCH 1/3] ipmitool: migrate to openssl 1.1 This adds a patch from debian to switch ipmitool to openssl 1.1. Upstream seems to already carry a version of this but that is yet to be part of a release. --- pkgs/tools/system/ipmitool/default.nix | 11 +++++++++-- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index 3105cba5a34..e86dc14b020 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,7 +12,14 @@ stdenv.mkDerivation { sha256 = "0kfh8ny35rvwxwah4yv91a05qwpx74b5slq2lhrh71wz572va93m"; }; - patchPhase = stdenv.lib.optionalString stdenv.isDarwin '' + patches = [ + (fetchpatch { + url = "https://sources.debian.org/data/main/i/ipmitool/1.8.18-6/debian/patches/0120-openssl1.1.patch"; + sha256 = "1xvsjxb782lzy72bnqqnsk3r5h4zl3na95s4pqn2qg7cic2mnbfk"; + }) + ]; + + postPatch = stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace src/plugins/ipmi_intf.c --replace "s6_addr16" "s6_addr" ''; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 17b0779bc90..e71fd37682d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4261,9 +4261,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 {}; From 43ec75d47083ae4e35ebad14e25dd6249c19f44f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Fri, 28 Feb 2020 12:09:54 -0800 Subject: [PATCH 2/3] ipmitool: cleanup expression * remove no-op substitution of s6_addr16 -> s6_addr This string doesn't exist anymore in that file. * clean up configureFlags --- pkgs/tools/system/ipmitool/default.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index e86dc14b020..75bfd712661 100644 --- a/pkgs/tools/system/ipmitool/default.nix +++ b/pkgs/tools/system/ipmitool/default.nix @@ -19,19 +19,19 @@ stdenv.mkDerivation { }) ]; - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' - substituteInPlace src/plugins/ipmi_intf.c --replace "s6_addr16" "s6_addr" - ''; - 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; From 82217553b0e5926bb8f178a31b5511dc0fe895f1 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 1 Mar 2020 08:18:36 -0500 Subject: [PATCH 3/3] ipmitool: fix compile on darwin --- pkgs/tools/system/ipmitool/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index 75bfd712661..2b6479198c9 100644 --- a/pkgs/tools/system/ipmitool/default.nix +++ b/pkgs/tools/system/ipmitool/default.nix @@ -17,6 +17,11 @@ stdenv.mkDerivation { 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 ]; @@ -39,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 ]; }; }