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";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "2.1.4";
|
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;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-HnvLLwxOnu7Oiige6A6zk9NmAI2ImcILp9eCfbdGiyI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
DESTDIR = "$(out)";
|
|
|
|
|
|
|
|
NIX_LDFLAGS = "-lkmod -lsystemd";
|
|
|
|
NIX_CFLAGS_COMPILE = "-DUSE_KMOD";
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i 's|/usr|/|' Makefile
|
|
|
|
'';
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
installFlags = [
|
|
|
|
"install"
|
|
|
|
"install_systemd"
|
|
|
|
];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|