openiscsi: 2.1.7 -> 2.1.8

autotools -> meson
> support for make/autoconf is still in place but is deprecated
- https://github.com/open-iscsi/open-iscsi/releases/tag/2.1.8
This commit is contained in:
ajs124 2022-10-28 01:17:52 +02:00
parent 163dc39379
commit 33b2ad57c8

View file

@ -1,55 +1,60 @@
{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, gettext
, util-linux, open-isns, openssl, kmod, perl, systemd, pkgconf, nixosTests
}:
{ stdenv
, lib
, fetchFromGitHub
, meson
, pkg-config
, ninja
, perl
, util-linux
, open-isns
, openssl
, kmod
, systemd
, runtimeShell
, nixosTests }:
stdenv.mkDerivation rec {
pname = "open-iscsi";
version = "2.1.7";
nativeBuildInputs = [ autoconf automake gettext libtool perl pkgconf ];
buildInputs = [ kmod open-isns.lib openssl systemd util-linux ];
version = "2.1.8";
src = fetchFromGitHub {
owner = "open-iscsi";
repo = "open-iscsi";
rev = version;
sha256 = "sha256-R1ttHHxVSQ5TGtWVy4I9BAmEJfcRhKRD5jThoeddjUw=";
hash = "sha256-JzSyX9zvUkhCEpNwTMneTZpCRgaYxHZ1wP215YnMI78=";
};
DESTDIR = "$(out)";
NIX_LDFLAGS = "-lkmod -lsystemd";
NIX_CFLAGS_COMPILE = "-DUSE_KMOD";
nativeBuildInputs = [
meson
pkg-config
ninja
perl
];
buildInputs = [
kmod
(lib.getLib open-isns)
openssl
systemd
util-linux
];
preConfigure = ''
# Remove blanket -Werror. Fails for minor error on gcc-11.
substituteInPlace usr/Makefile --replace ' -Werror ' ' '
patchShebangs .
'';
# avoid /usr/bin/install
makeFlags = [
"INSTALL=install"
"SED=sed"
"prefix=/"
"manprefix=/share"
prePatch = ''
substituteInPlace etc/systemd/iscsi-init.service.template \
--replace /usr/bin/sh ${runtimeShell}
sed -i '/install_dir: db_root/d' meson.build
'';
mesonFlags = [
"-Discsi_sbindir=${placeholder "out"}/sbin"
"-Drulesdir=${placeholder "out"}/etc/udev/rules.d"
"-Dsystemddir=${placeholder "out"}/lib/systemd"
"-Ddbroot=/etc/iscsi"
];
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
'';
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; {