summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Scott <code@humanleg.org.uk>2022-11-05 15:41:40 +0000
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-11-26 18:00:30 +0000
commit29e3539f516ed6379d9f4f12bd251dd2083ed233 (patch)
tree760459596b27bf16940d44b4fcea9faa40ae7969
parentMerge pull request #202916 from NixOS/backport-202742-to-release-22.05 (diff)
downloadnixpkgs-origin/backport-199710-to-release-22.05.tar.gz
multipath-tools: 0.8.3 -> 0.9.3origin/backport-199710-to-release-22.05
enable tests (cherry picked from commit a39a869cac6d40c301affca3b54b3b48ea2a1b19)
-rw-r--r--pkgs/os-specific/linux/multipath-tools/default.nix48
-rw-r--r--pkgs/os-specific/linux/multipath-tools/json-c-0.14.patch21
2 files changed, 29 insertions, 40 deletions
diff --git a/pkgs/os-specific/linux/multipath-tools/default.nix b/pkgs/os-specific/linux/multipath-tools/default.nix
index 437fe9bd1bd9..d39da5fb9d7f 100644
--- a/pkgs/os-specific/linux/multipath-tools/default.nix
+++ b/pkgs/os-specific/linux/multipath-tools/default.nix
@@ -1,27 +1,30 @@
-{ lib, stdenv, fetchurl, fetchpatch, pkg-config, perl, lvm2, libaio, readline, systemd, liburcu, json_c, kmod, nixosTests }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, perl
+, lvm2
+, libaio
+, readline
+, systemd
+, liburcu
+, json_c
+, kmod
+, cmocka
+, nixosTests
+}:
stdenv.mkDerivation rec {
pname = "multipath-tools";
- version = "0.8.3";
+ version = "0.9.3";
- src = fetchurl {
- name = "${pname}-${version}.tar.gz";
- url = "https://git.opensvc.com/gitweb.cgi?p=multipath-tools/.git;a=snapshot;h=refs/tags/${version};sf=tgz";
- sha256 = "1mgjylklh1cx8px8ffgl12kyc0ln3445vbabd2sy8chq31rpiiq8";
+ src = fetchFromGitHub {
+ owner = "opensvc";
+ repo = "multipath-tools";
+ rev = "refs/tags/${version}";
+ sha256 = "sha256-pIGeZ+jB+6GqkfVN83axHIuY/BobQ+zs+tH+MkLIln0=";
};
- patches = [
- # fix build with json-c 0.14 https://www.redhat.com/archives/dm-devel/2020-May/msg00261.html
- ./json-c-0.14.patch
-
- # pull upstream fix for -fno-common toolchains like clang-12
- (fetchpatch {
- name = "fno-common.patch";
- url = "https://github.com/opensvc/multipath-tools/commit/23a9247fa89cd0c84fe7e0f32468fd698b1caa48.patch";
- sha256 = "10hq0g2jfkfbmwhm4x4q5cgsswj30lm34ib153alqzjzsxc1hqjk";
- })
- ];
-
postPatch = ''
substituteInPlace libmultipath/Makefile \
--replace /usr/include/libdevmapper.h ${lib.getDev lvm2}/include/libdevmapper.h
@@ -53,10 +56,17 @@ stdenv.mkDerivation rec {
"SYSTEMDPATH=lib"
];
+ doCheck = true;
+ preCheck = ''
+ # skip test attempting to access /sys/dev/block
+ substituteInPlace tests/Makefile --replace ' devt ' ' '
+ '';
+ checkInputs = [ cmocka ];
+
passthru.tests = { inherit (nixosTests) iscsi-multipath-root; };
meta = with lib; {
- description = "Tools for the Linux multipathing driver";
+ description = "Tools for the Linux multipathing storage driver";
homepage = "http://christophe.varoqui.free.fr/";
license = licenses.gpl2;
platforms = platforms.linux;
diff --git a/pkgs/os-specific/linux/multipath-tools/json-c-0.14.patch b/pkgs/os-specific/linux/multipath-tools/json-c-0.14.patch
deleted file mode 100644
index d5fee4248830..000000000000
--- a/pkgs/os-specific/linux/multipath-tools/json-c-0.14.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h
-index ac85b63f..b1a6ddea 100644
---- a/libdmmp/libdmmp_private.h
-+++ b/libdmmp/libdmmp_private.h
-@@ -30,6 +30,7 @@
- #include <stdint.h>
- #include <string.h>
- #include <assert.h>
-+#include <stdbool.h>
- #include <json.h>
-
- #include "libdmmp/libdmmp.h"
-@@ -82,7 +83,7 @@ static out_type func_name(struct dmmp_context *ctx, const char *var_name) { \
- do { \
- json_type j_type = json_type_null; \
- json_object *j_obj_tmp = NULL; \
-- if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != TRUE) { \
-+ if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != true) { \
- _error(ctx, "Invalid JSON output from multipathd IPC: " \
- "key '%s' not found", key); \
- rc = DMMP_ERR_IPC_ERROR; \