nixpkgs/pkgs/os-specific/linux/open-iscsi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.6 KiB
Nix
Raw Normal View History

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