Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, lib, fetchurl, openssl, fetchpatch, static ? false }:
2
3let
4 pkgname = "ipmitool";
5 version = "1.8.18";
6in
7stdenv.mkDerivation {
8 name = "${pkgname}-${version}";
9
10 src = fetchurl {
11 url = "mirror://sourceforge/${pkgname}/${pkgname}-${version}.tar.gz";
12 sha256 = "0kfh8ny35rvwxwah4yv91a05qwpx74b5slq2lhrh71wz572va93m";
13 };
14
15 patches = [
16 (fetchpatch {
17 url = "https://sources.debian.org/data/main/i/ipmitool/1.8.18-6/debian/patches/0120-openssl1.1.patch";
18 sha256 = "1xvsjxb782lzy72bnqqnsk3r5h4zl3na95s4pqn2qg7cic2mnbfk";
19 })
20 # Fix build on non-linux systems
21 (fetchpatch {
22 url = "https://github.com/ipmitool/ipmitool/commit/5db314f694f75c575cd7c9ffe9ee57aaf3a88866.patch";
23 sha256 = "01niwrgajhrdhl441gzmw6v1r1yc3i8kn98db4b6smfn5fwdp1pa";
24 })
25 ];
26
27 buildInputs = [ openssl ];
28
29 configureFlags = [
30 "--infodir=${placeholder "out"}/share/info"
31 "--mandir=${placeholder "out"}/share/man"
32 ] ++ stdenv.lib.optionals static [
33 "LDFLAGS=-static"
34 "--enable-static"
35 "--disable-shared"
36 ] ++ stdenv.lib.optionals (!static) [
37 "--enable-shared"
38 ];
39
40 makeFlags = stdenv.lib.optional static "AM_LDFLAGS=-all-static";
41 dontDisableStatic = static;
42
43 meta = with lib; {
44 description = ''Command-line interface to IPMI-enabled devices'';
45 license = licenses.bsd3;
46 homepage = "https://sourceforge.net/projects/ipmitool/";
47 platforms = platforms.unix;
48 maintainers = with maintainers; [ fpletz ];
49 };
50}