libdbiDrivers: fix compile errors in tests, backport patches

authored by Yongun Seong and committed by Pascal Bach e8ef3a06 7bd3a283

+84 -1
+23
pkgs/by-name/li/libdbiDrivers/libdbi-drivers-0.9.0-470b58e15-wait-include.patch
··· 1 + commit 470b58e15dc6f406899b1695aec7fc98986b8f14 2 + Author: Jan Engelhardt <jengelh@inai.de> 3 + Date: Fri Jan 27 09:56:44 2017 +0100 4 + 5 + build: resolve compiler warning for wait(2) 6 + 7 + src/unit.c: In function "wait_for_child_process": 8 + src/unit.c:229:5: warning: implicit declaration of function "wait" [-Wimplicit-function-declaration] 9 + wait(&status); 10 + 11 + diff --git a/tests/cgreen/src/unit.c b/tests/cgreen/src/unit.c 12 + index 7753ff1..bdd236f 100644 13 + --- a/tests/cgreen/src/unit.c 14 + +++ b/tests/cgreen/src/unit.c 15 + @@ -9,6 +9,7 @@ 16 + #include <stdarg.h> 17 + #include <unistd.h> 18 + #include <signal.h> 19 + +#include <sys/wait.h> 20 + 21 + enum {test_function, test_suite}; 22 + 23 +
+22
pkgs/by-name/li/libdbiDrivers/libdbi-drivers-0.9.0-9f378826-compare-type.patch
··· 1 + commit 9f3788269befd2e4290eef1df4b014bc2385d801 2 + Author: Jan Engelhardt <jengelh@inai.de> 3 + Date: Sat Sep 7 22:51:05 2013 +0200 4 + 5 + build: resolve rpmlint aborting due to bad code 6 + 7 + diff --git a/tests/cgreen/src/constraint.c b/tests/cgreen/src/constraint.c 8 + index c19c0dd..b0fbfb8 100644 9 + --- a/tests/cgreen/src/constraint.c 10 + +++ b/tests/cgreen/src/constraint.c 11 + @@ -164,8 +164,8 @@ static void test_want_double(Constraint *constraint, const char *function, intpt 12 + } 13 + 14 + static int compare_using_matcher(Constraint *constraint, intptr_t actual) { 15 + - int (*matches)(const void*) = constraint->expected; 16 + - return matches(actual); 17 + + int (*matches)(const void*) = (void *)(intptr_t)constraint->expected; 18 + + return matches((void *)actual); 19 + } 20 + 21 + static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) { 22 +
+32
pkgs/by-name/li/libdbiDrivers/libdbi-drivers-0.9.0-function-types.patch
··· 1 + diff --git a/tests/cgreen/src/constraint.c b/tests/cgreen/src/constraint.c 2 + index 56c3625..d8972bb 100644 3 + --- a/tests/cgreen/src/constraint.c 4 + +++ b/tests/cgreen/src/constraint.c 5 + @@ -22,7 +22,7 @@ static double unbox_double(intptr_t box); 6 + static double as_double(intptr_t box); 7 + 8 + static int compare_using_matcher(Constraint *constraint, intptr_t actual); 9 + -static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t actual, const char *test_file, int test_line, TestReporter *reporter); 10 + +static void test_with_matcher(Constraint *constraint, const char *function, intptr_t actual, const char *test_file, int test_line, TestReporter *reporter); 11 + 12 + 13 + void destroy_constraint(void *abstract) { 14 + @@ -168,15 +168,14 @@ static int compare_using_matcher(Constraint *constraint, intptr_t actual) { 15 + return matches((void *)actual); 16 + } 17 + 18 + -static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) { 19 + +static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) { 20 + (*reporter->assert_true)( 21 + reporter, 22 + test_file, 23 + test_line, 24 + (*constraint->compare)(constraint, matcher_function), 25 + - "Wanted parameter [%s] to match [%s] in function [%s]", 26 + + "Wanted parameter [%s] to match [nil] in function [%s]", 27 + constraint->parameter, 28 + - matcher_name, 29 + function); 30 + } 31 + 32 +
+7 -1
pkgs/by-name/li/libdbiDrivers/package.nix
··· 15 15 16 16 src = fetchurl { 17 17 url = "mirror://sourceforge/libdbi-drivers/libdbi-drivers-${version}.tar.gz"; 18 - sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3"; 18 + hash = "sha256-Q9LqzVc6T6/ylvqSXdl/vyrtvxrjXGJjR4IQxhAEyFQ="; 19 19 }; 20 20 21 21 buildInputs = [ ··· 27 27 patches = [ 28 28 # https://sourceforge.net/p/libdbi-drivers/libdbi-drivers/ci/24f48b86c8988ee3aaebc5f303d71e9d789f77b6 29 29 ./libdbi-drivers-0.9.0-buffer_overflow.patch 30 + # https://sourceforge.net/p/libdbi-drivers/libdbi-drivers/ci/470b58e15dc6f406899b1695aec7fc98986b8f14 31 + ./libdbi-drivers-0.9.0-470b58e15-wait-include.patch 32 + # https://sourceforge.net/p/libdbi-drivers/libdbi-drivers/ci/9f3788269befd2e4290eef1df4b014bc2385d801 33 + ./libdbi-drivers-0.9.0-9f378826-compare-type.patch 34 + # fix function pointer type mismatches in tests 35 + ./libdbi-drivers-0.9.0-function-types.patch 30 36 ]; 31 37 32 38 postPatch = ''