2022-11-05 15:41:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-05-22 13:26:56 +00:00
|
|
|
, fetchpatch
|
2023-01-02 20:34:35 +00:00
|
|
|
, coreutils
|
2023-09-16 08:42:34 +00:00
|
|
|
|
2022-11-05 15:41:40 +00:00
|
|
|
, perl
|
2023-09-16 08:42:34 +00:00
|
|
|
, pkg-config
|
|
|
|
|
|
|
|
, json_c
|
2022-11-05 15:41:40 +00:00
|
|
|
, libaio
|
|
|
|
, liburcu
|
2023-01-02 20:34:35 +00:00
|
|
|
, linuxHeaders
|
2023-09-16 08:42:34 +00:00
|
|
|
, lvm2
|
|
|
|
, readline
|
|
|
|
, systemd
|
|
|
|
, util-linuxMinimal
|
|
|
|
|
2022-11-05 15:41:40 +00:00
|
|
|
, cmocka
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2011-04-06 14:57:31 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "multipath-tools";
|
2024-05-22 13:34:54 +00:00
|
|
|
version = "0.9.8";
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2022-11-05 15:41:40 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "opensvc";
|
|
|
|
repo = "multipath-tools";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-05-22 13:34:54 +00:00
|
|
|
sha256 = "sha256-4cby19BjgnmWf7klK1sBgtZnyvo7q3L1uyVPlVoS+uk=";
|
2011-04-06 14:57:31 +00:00
|
|
|
};
|
|
|
|
|
2024-05-22 13:26:56 +00:00
|
|
|
patches = [
|
|
|
|
# Backport build fix for musl libc 1.2.5
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/openSUSE/multipath-tools/commit/e5004de8296cd596aeeac0a61b901e98cf7a69d2.patch";
|
2024-06-12 04:57:36 +00:00
|
|
|
hash = "sha256-3Qt8zfrWi9aOdqMObZQaNAaXDmjhvSYrXK7qycC9L1Q=";
|
2024-05-22 13:26:56 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2016-01-21 14:29:02 +00:00
|
|
|
postPatch = ''
|
2023-01-02 20:34:35 +00:00
|
|
|
substituteInPlace create-config.mk \
|
2024-05-23 09:02:45 +00:00
|
|
|
--replace-fail /bin/echo ${coreutils}/bin/echo
|
2021-03-11 15:31:32 +00:00
|
|
|
|
2024-05-22 13:34:54 +00:00
|
|
|
substituteInPlace multipathd/multipathd.service.in \
|
2024-05-23 09:02:45 +00:00
|
|
|
--replace-fail /sbin/multipathd "$out/bin/multipathd"
|
2016-01-21 14:29:02 +00:00
|
|
|
'';
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2023-09-16 08:42:34 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
json_c
|
|
|
|
libaio
|
|
|
|
liburcu
|
|
|
|
linuxHeaders
|
|
|
|
lvm2
|
|
|
|
readline
|
|
|
|
systemd
|
|
|
|
util-linuxMinimal # for libmount
|
|
|
|
];
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2016-01-21 14:29:02 +00:00
|
|
|
makeFlags = [
|
|
|
|
"LIB=lib"
|
|
|
|
"prefix=$(out)"
|
2023-01-02 20:34:35 +00:00
|
|
|
"systemd_prefix=$(out)"
|
|
|
|
"kernel_incdir=${linuxHeaders}/include/"
|
2019-11-06 18:12:52 +00:00
|
|
|
"man8dir=$(out)/share/man/man8"
|
2016-01-21 14:29:02 +00:00
|
|
|
"man5dir=$(out)/share/man/man5"
|
|
|
|
"man3dir=$(out)/share/man/man3"
|
|
|
|
];
|
2011-04-06 14:57:31 +00:00
|
|
|
|
2022-11-05 15:41:40 +00:00
|
|
|
doCheck = true;
|
|
|
|
preCheck = ''
|
|
|
|
# skip test attempting to access /sys/dev/block
|
2024-05-23 09:02:45 +00:00
|
|
|
substituteInPlace tests/Makefile --replace-fail ' devt ' ' '
|
2022-11-05 15:41:40 +00:00
|
|
|
'';
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ cmocka ];
|
2022-11-05 15:41:40 +00:00
|
|
|
|
2022-01-23 20:08:10 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) iscsi-multipath-root; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-11-05 15:41:40 +00:00
|
|
|
description = "Tools for the Linux multipathing storage driver";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://christophe.varoqui.free.fr/";
|
2024-05-26 12:16:07 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2018-08-30 19:37:57 +00:00
|
|
|
platforms = platforms.linux;
|
2011-04-06 14:57:31 +00:00
|
|
|
};
|
|
|
|
}
|