2023-02-02 18:25:31 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, pkg-config
|
|
|
|
, ninja
|
|
|
|
, perl
|
|
|
|
, util-linux
|
|
|
|
, open-isns
|
|
|
|
, openssl
|
|
|
|
, kmod
|
|
|
|
, systemd
|
|
|
|
, runtimeShell
|
|
|
|
, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "open-iscsi";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "2.1.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "open-iscsi";
|
|
|
|
repo = "open-iscsi";
|
|
|
|
rev = version;
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-y0NIb/KsKpCd8byr/SXI7nwTKXP2/bSSoW8QgeL5xdc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
pkg-config
|
|
|
|
ninja
|
|
|
|
perl
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
buildInputs = [
|
|
|
|
kmod
|
|
|
|
(lib.getLib open-isns)
|
|
|
|
openssl
|
|
|
|
systemd
|
|
|
|
util-linux
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace etc/systemd/iscsi-init.service.template \
|
|
|
|
--replace /usr/bin/sh ${runtimeShell}
|
|
|
|
sed -i '/install_dir: db_root/d' meson.build
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Discsi_sbindir=${placeholder "out"}/sbin"
|
|
|
|
"-Drulesdir=${placeholder "out"}/etc/udev/rules.d"
|
|
|
|
"-Dsystemddir=${placeholder "out"}/lib/systemd"
|
|
|
|
"-Ddbroot=/etc/iscsi"
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) iscsi-root; };
|
2022-01-25 03:21:06 +00:00
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|