multipath-tools: 0.8.3 -> 0.9.3

enable tests
This commit is contained in:
Robert Scott 2022-11-05 15:41:40 +00:00
parent f23ddc55a6
commit a39a869cac
2 changed files with 29 additions and 40 deletions

View File

@ -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;

View File

@ -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; \