diff options
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/giflib-make-reallocarray-private.patch | 120 | ||||
-rw-r--r-- | gnu/packages/patches/gnome-todo-libical-compat.patch | 17 | ||||
-rw-r--r-- | gnu/packages/patches/gtk2-fix-failing-test.patch | 39 | ||||
-rw-r--r-- | gnu/packages/patches/json-glib-fix-tests-32bit.patch | 174 |
4 files changed, 311 insertions, 39 deletions
diff --git a/gnu/packages/patches/giflib-make-reallocarray-private.patch b/gnu/packages/patches/giflib-make-reallocarray-private.patch new file mode 100644 index 0000000000..69228c5be8 --- /dev/null +++ b/gnu/packages/patches/giflib-make-reallocarray-private.patch @@ -0,0 +1,120 @@ +Move the declaration from gif_lib.h to gif_lib_private.h to solve +conflicts when some .c-file #includes both stdlib.h and gif_lib.h. +See also https://sourceforge.net/p/giflib/bugs/110/ + +diff -ur giflib-5.1.4.orig/lib/dgif_lib.c giflib-5.1.4/lib/dgif_lib.c +--- giflib-5.1.4.orig/lib/dgif_lib.c 2018-02-28 20:31:02.294682673 +0100 ++++ giflib-5.1.4/lib/dgif_lib.c 2018-02-28 22:38:11.659126414 +0100 +@@ -396,7 +396,7 @@ + + if (GifFile->SavedImages) { + SavedImage* new_saved_images = +- (SavedImage *)reallocarray(GifFile->SavedImages, ++ (SavedImage *)giflib_private_reallocarray(GifFile->SavedImages, + (GifFile->ImageCount + 1), sizeof(SavedImage)); + if (new_saved_images == NULL) { + GifFile->Error = D_GIF_ERR_NOT_ENOUGH_MEM; +@@ -1108,7 +1108,7 @@ + if (ImageSize > (SIZE_MAX / sizeof(GifPixelType))) { + return GIF_ERROR; + } +- sp->RasterBits = (unsigned char *)reallocarray(NULL, ImageSize, ++ sp->RasterBits = (unsigned char *)giflib_private_reallocarray(NULL, ImageSize, + sizeof(GifPixelType)); + + if (sp->RasterBits == NULL) { +diff -ur giflib-5.1.4.orig/lib/gifalloc.c giflib-5.1.4/lib/gifalloc.c +--- giflib-5.1.4.orig/lib/gifalloc.c 2018-02-28 20:31:02.294682673 +0100 ++++ giflib-5.1.4/lib/gifalloc.c 2018-02-28 22:38:11.657126423 +0100 +@@ -8,7 +8,7 @@ + #include <stdio.h> + #include <string.h> + +-#include "gif_lib.h" ++#include "gif_lib_private.h" + + #define MAX(x, y) (((x) > (y)) ? (x) : (y)) + +@@ -188,7 +188,7 @@ + + /* perhaps we can shrink the map? */ + if (RoundUpTo < ColorUnion->ColorCount) { +- GifColorType *new_map = (GifColorType *)reallocarray(Map, ++ GifColorType *new_map = (GifColorType *)giflib_private_reallocarray(Map, + RoundUpTo, sizeof(GifColorType)); + if( new_map == NULL ) { + GifFreeMapObject(ColorUnion); +@@ -232,7 +232,7 @@ + if (*ExtensionBlocks == NULL) + *ExtensionBlocks=(ExtensionBlock *)malloc(sizeof(ExtensionBlock)); + else { +- ExtensionBlock* ep_new = (ExtensionBlock *)reallocarray ++ ExtensionBlock* ep_new = (ExtensionBlock *)giflib_private_reallocarray + (*ExtensionBlocks, (*ExtensionBlockCount + 1), + sizeof(ExtensionBlock)); + if( ep_new == NULL ) +@@ -325,7 +325,7 @@ + if (GifFile->SavedImages == NULL) + GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage)); + else +- GifFile->SavedImages = (SavedImage *)reallocarray(GifFile->SavedImages, ++ GifFile->SavedImages = (SavedImage *)giflib_private_reallocarray(GifFile->SavedImages, + (GifFile->ImageCount + 1), sizeof(SavedImage)); + + if (GifFile->SavedImages == NULL) +@@ -355,7 +355,7 @@ + } + + /* next, the raster */ +- sp->RasterBits = (unsigned char *)reallocarray(NULL, ++ sp->RasterBits = (unsigned char *)giflib_private_reallocarray(NULL, + (CopyFrom->ImageDesc.Height * + CopyFrom->ImageDesc.Width), + sizeof(GifPixelType)); +@@ -369,7 +369,7 @@ + + /* finally, the extension blocks */ + if (sp->ExtensionBlocks != NULL) { +- sp->ExtensionBlocks = (ExtensionBlock *)reallocarray(NULL, ++ sp->ExtensionBlocks = (ExtensionBlock *)giflib_private_reallocarray(NULL, + CopyFrom->ExtensionBlockCount, + sizeof(ExtensionBlock)); + if (sp->ExtensionBlocks == NULL) { +diff -ur giflib-5.1.4.orig/lib/gif_lib.h giflib-5.1.4/lib/gif_lib.h +--- giflib-5.1.4.orig/lib/gif_lib.h 2018-02-28 20:31:02.294682673 +0100 ++++ giflib-5.1.4/lib/gif_lib.h 2018-02-28 20:31:43.135716712 +0100 +@@ -244,9 +244,6 @@ + GifPixelType ColorTransIn2[]); + extern int GifBitSize(int n); + +-extern void * +-reallocarray(void *optr, size_t nmemb, size_t size); +- + /****************************************************************************** + Support for the in-core structures allocation (slurp mode). + ******************************************************************************/ +diff -ur giflib-5.1.4.orig/lib/gif_lib_private.h giflib-5.1.4/lib/gif_lib_private.h +--- giflib-5.1.4.orig/lib/gif_lib_private.h 2018-02-28 20:31:02.294682673 +0100 ++++ giflib-5.1.4/lib/gif_lib_private.h 2018-02-28 22:38:11.657126423 +0100 +@@ -54,6 +54,9 @@ + bool gif89; + } GifFilePrivateType; + ++extern void * ++giflib_private_reallocarray(void *optr, size_t nmemb, size_t size); ++ + #endif /* _GIF_LIB_PRIVATE_H */ + + /* end */ +diff -ur giflib-5.1.4.orig/lib/openbsd-reallocarray.c giflib-5.1.4/lib/openbsd-reallocarray.c +--- giflib-5.1.4.orig/lib/openbsd-reallocarray.c 2018-02-28 20:31:02.295682659 +0100 ++++ giflib-5.1.4/lib/openbsd-reallocarray.c 2018-02-28 22:38:11.656126428 +0100 +@@ -27,7 +27,7 @@ + #define MUL_NO_OVERFLOW ((size_t)1 << (sizeof(size_t) * 4)) + + void * +-reallocarray(void *optr, size_t nmemb, size_t size) ++giflib_private_reallocarray(void *optr, size_t nmemb, size_t size) + { + if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && + nmemb > 0 && SIZE_MAX / nmemb < size) { diff --git a/gnu/packages/patches/gnome-todo-libical-compat.patch b/gnu/packages/patches/gnome-todo-libical-compat.patch new file mode 100644 index 0000000000..34f2e254b2 --- /dev/null +++ b/gnu/packages/patches/gnome-todo-libical-compat.patch @@ -0,0 +1,17 @@ +Fix compatibility with libical 3.0. + +Patch copied from Arch Linux: +https://git.archlinux.org/svntogit/packages.git/tree/trunk/gnome-todo-3.26.2-libical-3.0.patch?h=packages/gnome-todo + +diff -up gnome-todo-3.26.2/src/gtd-task.c.libical-3.0 gnome-todo-3.26.2/src/gtd-task.c +--- gnome-todo-3.26.2/src/gtd-task.c.libical-3.0 2017-11-08 14:53:53.484294926 +0100 ++++ gnome-todo-3.26.2/src/gtd-task.c 2017-11-08 14:53:57.208294874 +0100 +@@ -778,7 +778,7 @@ gtd_task_set_complete (GtdTask *task, + dt->minute = g_date_time_get_minute (now); + dt->second = g_date_time_get_seconds (now); + dt->is_date = 0; +- dt->is_utc = 1; ++ dt->zone = icaltimezone_get_utc_timezone (); + + /* convert timezone + * diff --git a/gnu/packages/patches/gtk2-fix-failing-test.patch b/gnu/packages/patches/gtk2-fix-failing-test.patch deleted file mode 100644 index 721dc012c7..0000000000 --- a/gnu/packages/patches/gtk2-fix-failing-test.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 12d8b4e8f2f9c9a7707d1d3fccba382732212e3c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com> -Date: Tue, 5 Dec 2017 20:06:36 +0100 -Subject: [PATCH] Fix test failing on new GLib versions. - -This test fails on newer GLib version, because GLib exports a new public marshaller. -The additional symbol making the test fail is: -g_cclosure_marshal_BOOLEAN__BOXED_BOXED - -The fix makes the test ignore non-gtk related abi. -This ensures if future marshallers are added to glib those will not pose a problem. - -The fix also ensures that the test still checks the gtk abi for identity, and -that the library provides a superset of the required abi. - -Upstream reponse to this problem was: - -GLib added a new marshaller in its public API -And the `abicheck.sh`in GTK+ 2.24 hasn't been updated because GTK+ 2.24 is in deep -maintenance mode and very few people test it against newer versions of GLib - ---- - gtk/abicheck.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gtk/abicheck.sh b/gtk/abicheck.sh -index 0d033fb..53b7bfe 100755 ---- a/gtk/abicheck.sh -+++ b/gtk/abicheck.sh -@@ -1,5 +1,5 @@ - #! /bin/sh - - cpp -DINCLUDE_VARIABLES -P -DG_OS_UNIX -DGTK_WINDOWING_X11 -DALL_FILES ${srcdir:-.}/gtk.symbols | sed -e '/^$/d' -e 's/ G_GNUC.*$//' -e 's/ PRIVATE//' | sort > expected-abi --nm -D -g --defined-only .libs/libgtk-x11-2.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | sort > actual-abi -+nm -D -g --defined-only .libs/libgtk-x11-2.0.so | cut -d ' ' -f 3 | egrep -v '^(__bss_start|_edata|_end)' | egrep '^gtk_' | sort > actual-abi - diff -u expected-abi actual-abi && rm -f expected-abi actual-abi --- -2.15.0 - diff --git a/gnu/packages/patches/json-glib-fix-tests-32bit.patch b/gnu/packages/patches/json-glib-fix-tests-32bit.patch new file mode 100644 index 0000000000..77ea134915 --- /dev/null +++ b/gnu/packages/patches/json-glib-fix-tests-32bit.patch @@ -0,0 +1,174 @@ +Fix floating point issues on 32-bit platforms: + +https://gitlab.gnome.org/GNOME/json-glib/issues/27 + +This is an amalgamation of the following upstream commits: +https://gitlab.gnome.org/GNOME/json-glib/commit/70e2648e02232c1a439a7418388f18fee9afb3fe +https://gitlab.gnome.org/GNOME/json-glib/commit/675e27505776a1d77fa1ffd1974284890caec1f4 + +diff --git a/json-glib/tests/json-test-utils.h b/json-glib/tests/json-test-utils.h +new file mode 100644 +index 0000000..83a02c6 +--- /dev/null ++++ b/json-glib/tests/json-test-utils.h +@@ -0,0 +1,21 @@ ++#include <string.h> ++#include <math.h> ++#include <float.h> ++#include <glib.h> ++#include <json-glib/json-glib.h> ++ ++#define json_fuzzy_equals(n1,n2,epsilon) \ ++ (((n1) > (n2) ? ((n1) - (n2)) : ((n2) - (n1))) < (epsilon)) ++ ++#define json_assert_fuzzy_equals(n1,n2,epsilon) \ ++ G_STMT_START { \ ++ double __n1 = (n1), __n2 = (n2), __epsilon = (epsilon); \ ++ if (json_fuzzy_equals (__n1, __n2, __epsilon)) ; else { \ ++ g_assertion_message_cmpnum (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \ ++ #n1 " == " #n2 " (+/- " #epsilon ")", \ ++ __n1, "==", __n2, 'f'); \ ++ } \ ++ } G_STMT_END ++ ++#define json_assert_almost_equals(n1,n2) \ ++ json_assert_fuzzy_equals (n1, n2, DBL_EPSILON) +diff --git a/json-glib/tests/array.c b/json-glib/tests/array.c +index 98afeab..426cd72 100644 +--- a/json-glib/tests/array.c ++++ b/json-glib/tests/array.c +@@ -1,9 +1,4 @@ +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +- +-#include <glib.h> +-#include <json-glib/json-glib.h> ++#include "json-test-utils.h" + + static void + test_empty_array (void) +@@ -37,7 +32,7 @@ test_add_element (void) + + json_array_add_double_element (array, 3.14); + g_assert_cmpint (json_array_get_length (array), ==, 3); +- g_assert_cmpfloat (json_array_get_double_element (array, 2), ==, 3.14); ++ json_assert_fuzzy_equals (json_array_get_double_element (array, 2), 3.14, 0.001); + + json_array_add_boolean_element (array, TRUE); + g_assert_cmpint (json_array_get_length (array), ==, 4); +diff --git a/json-glib/tests/node.c b/json-glib/tests/node.c +index 23bda63..80beb78 100644 +--- a/json-glib/tests/node.c ++++ b/json-glib/tests/node.c +@@ -1,6 +1,4 @@ +-#include <glib.h> +-#include <json-glib/json-glib.h> +-#include <string.h> ++#include "json-test-utils.h" + + static void + test_init_int (void) +@@ -19,7 +17,7 @@ test_init_double (void) + JsonNode *node = json_node_new (JSON_NODE_VALUE); + + json_node_set_double (node, 3.14159); +- g_assert_cmpfloat (json_node_get_double (node), ==, 3.14159); ++ json_assert_fuzzy_equals (json_node_get_double (node), 3.14159, 0.00001); + + json_node_free (node); + } +@@ -119,13 +117,13 @@ test_get_int (void) + + json_node_set_int (node, 0); + g_assert_cmpint (json_node_get_int (node), ==, 0); +- g_assert_cmpfloat (json_node_get_double (node), ==, 0.0); ++ json_assert_almost_equals (json_node_get_double (node), 0.0); + g_assert (!json_node_get_boolean (node)); + g_assert (!json_node_is_null (node)); + + json_node_set_int (node, 42); + g_assert_cmpint (json_node_get_int (node), ==, 42); +- g_assert_cmpfloat (json_node_get_double (node), ==, 42.0); ++ json_assert_almost_equals (json_node_get_double (node), 42.0); + g_assert (json_node_get_boolean (node)); + g_assert (!json_node_is_null (node)); + +@@ -138,7 +136,7 @@ test_get_double (void) + JsonNode *node = json_node_new (JSON_NODE_VALUE); + + json_node_set_double (node, 3.14); +- g_assert_cmpfloat (json_node_get_double (node), ==, 3.14); ++ json_assert_fuzzy_equals (json_node_get_double (node), 3.14, 0.001); + g_assert_cmpint (json_node_get_int (node), ==, 3); + g_assert (json_node_get_boolean (node)); + +@@ -232,9 +230,9 @@ test_gvalue_autopromotion (void) + g_print ("Expecting a gdouble, got a %s\n", g_type_name (G_VALUE_TYPE (&check))); + + g_assert_cmpint (G_VALUE_TYPE (&check), ==, G_TYPE_DOUBLE); +- g_assert_cmpfloat ((float) g_value_get_double (&check), ==, 3.14159f); ++ json_assert_fuzzy_equals (g_value_get_double (&check), 3.14159, 0.00001); + g_assert_cmpint (G_VALUE_TYPE (&value), !=, G_VALUE_TYPE (&check)); +- g_assert_cmpfloat ((gdouble) g_value_get_float (&value), ==, g_value_get_double (&check)); ++ json_assert_almost_equals (g_value_get_float (&value), g_value_get_double (&check)); + + g_value_unset (&value); + g_value_unset (&check); +diff --git a/json-glib/tests/parser.c b/json-glib/tests/parser.c +index f71584a..8c52a1d 100644 +--- a/json-glib/tests/parser.c ++++ b/json-glib/tests/parser.c +@@ -1,11 +1,5 @@ +-#include "config.h" +- ++#include "json-test-utils.h" + #include <stdlib.h> +-#include <stdio.h> +- +-#include <glib.h> +- +-#include <json-glib/json-glib.h> + + static const gchar *test_empty_string = ""; + static const gchar *test_empty_array_string = "[ ]"; +@@ -38,13 +32,13 @@ verify_string_value (JsonNode *node) + static void + verify_double_value (JsonNode *node) + { +- g_assert_cmpfloat (10.2e3, ==, json_node_get_double (node)); ++ json_assert_fuzzy_equals (10.2e3, json_node_get_double (node), 0.1); + } + + static void + verify_negative_double_value (JsonNode *node) + { +- g_assert_cmpfloat (-3.14, ==, json_node_get_double (node)); ++ json_assert_fuzzy_equals (-3.14, json_node_get_double (node), 0.01); + } + + static const struct { +diff --git a/json-glib/tests/reader.c b/json-glib/tests/reader.c +index 43a6aac..9bab312 100644 +--- a/json-glib/tests/reader.c ++++ b/json-glib/tests/reader.c +@@ -1,9 +1,4 @@ +-#include <stdlib.h> +-#include <stdio.h> +- +-#include <glib.h> +- +-#include <json-glib/json-glib.h> ++#include "json-test-utils.h" + + static const gchar *test_base_array_data = + "[ 0, true, null, \"foo\", 3.14, [ false ], { \"bar\" : 42 } ]"; +@@ -78,7 +73,7 @@ test_base_object (void) + g_assert (json_reader_get_error (reader) == NULL); + + json_reader_read_member (reader, "double"); +- g_assert_cmpfloat (json_reader_get_double_value (reader), ==, 42.47); ++ json_assert_fuzzy_equals (json_reader_get_double_value (reader), 42.47, 0.01); + json_reader_end_element (reader); + + g_object_unref (reader); |