2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, gettext
|
2022-01-25 03:21:06 +00:00
|
|
|
, util-linux, open-isns, openssl, kmod, perl, systemd, pkgconf, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "open-iscsi";
|
2022-06-26 10:26:21 +00:00
|
|
|
version = "2.1.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf automake gettext libtool perl pkgconf ];
|
2021-02-05 17:12:51 +00:00
|
|
|
buildInputs = [ kmod open-isns.lib openssl systemd util-linux ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-iscsi";
|
|
|
|
repo = "open-iscsi";
|
|
|
|
rev = version;
|
2022-06-26 10:26:21 +00:00
|
|
|
sha256 = "sha256-R1ttHHxVSQ5TGtWVy4I9BAmEJfcRhKRD5jThoeddjUw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DESTDIR = "$(out)";
|
|
|
|
|
|
|
|
NIX_LDFLAGS = "-lkmod -lsystemd";
|
|
|
|
NIX_CFLAGS_COMPILE = "-DUSE_KMOD";
|
|
|
|
|
|
|
|
preConfigure = ''
|
2022-06-26 10:26:21 +00:00
|
|
|
# Remove blanket -Werror. Fails for minor error on gcc-11.
|
|
|
|
substituteInPlace usr/Makefile --replace ' -Werror ' ' '
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
# avoid /usr/bin/install
|
|
|
|
makeFlags = [
|
|
|
|
"INSTALL=install"
|
|
|
|
"SED=sed"
|
2022-07-14 12:49:19 +00:00
|
|
|
"prefix=/"
|
|
|
|
"manprefix=/share"
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
installFlags = [
|
|
|
|
"install"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
cp usr/iscsistart $out/sbin/
|
2020-11-06 00:33:48 +00:00
|
|
|
for f in $out/lib/systemd/system/*; do
|
|
|
|
substituteInPlace $f --replace /sbin $out/bin
|
|
|
|
done
|
2020-04-24 23:36:52 +00:00
|
|
|
$out/sbin/iscsistart -v
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
sed -i "s|/sbin/iscsiadm|$out/bin/iscsiadm|" $out/bin/iscsi_fw_login
|
|
|
|
'';
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) iscsi-root iscsi-multipath-root; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A high performance, transport independent, multi-platform implementation of RFC3720";
|
2021-01-09 10:05:03 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.open-iscsi.com";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ cleverca22 zaninime ];
|
|
|
|
};
|
|
|
|
}
|