diff options
author | prlw1 <prlw1@pkgsrc.org> | 2020-02-07 17:05:14 +0000 |
---|---|---|
committer | prlw1 <prlw1@pkgsrc.org> | 2020-02-07 17:05:14 +0000 |
commit | 0063111dd667c18637e86ad6ef4e46ce8590e74b (patch) | |
tree | 52178ed970b9d6bd383b29e3833a9dff54f8c73c /devel/glib2/patches | |
parent | 57bcd5a00a94aade5778a7a1a3abf7754a73a1c0 (diff) | |
download | pkgsrc-0063111dd667c18637e86ad6ef4e46ce8590e74b.tar.gz |
Apply upstream's
Check size_t compatibility with various other types
commit 505c9544247f27cb6ebf749d0902d53c33dac308
which will hopefully fix PR pkg/54909 and not break PR pkg/54298
Diffstat (limited to 'devel/glib2/patches')
-rw-r--r-- | devel/glib2/patches/patch-glib_glibconfig.h.in | 24 | ||||
-rw-r--r-- | devel/glib2/patches/patch-glib_gtypes.h | 26 | ||||
-rw-r--r-- | devel/glib2/patches/patch-meson.build | 112 |
3 files changed, 104 insertions, 58 deletions
diff --git a/devel/glib2/patches/patch-glib_glibconfig.h.in b/devel/glib2/patches/patch-glib_glibconfig.h.in deleted file mode 100644 index 7bcb6eeba9a..00000000000 --- a/devel/glib2/patches/patch-glib_glibconfig.h.in +++ /dev/null @@ -1,24 +0,0 @@ -$NetBSD: patch-glib_glibconfig.h.in,v 1.1 2019/06/25 10:57:28 prlw1 Exp $ - -We insist on C99, so size_t exists => use it. -PR pkg/54298 - ---- glib/glibconfig.h.in.orig 2019-06-10 17:47:20.000000000 +0000 -+++ glib/glibconfig.h.in -@@ -74,12 +74,10 @@ typedef unsigned @gint32@ guint32; - #define GLIB_SIZEOF_SIZE_T @glib_size_t@ - #define GLIB_SIZEOF_SSIZE_T @glib_ssize_t@ - --typedef signed @glib_size_type_define@ gssize; --typedef unsigned @glib_size_type_define@ gsize; --#define G_GSIZE_MODIFIER @gsize_modifier@ --#define G_GSSIZE_MODIFIER @gssize_modifier@ --#define G_GSIZE_FORMAT @gsize_format@ --#define G_GSSIZE_FORMAT @gssize_format@ -+#define G_GSIZE_MODIFIER "z" -+#define G_GSSIZE_MODIFIER "z" -+#define G_GSIZE_FORMAT "zu" -+#define G_GSSIZE_FORMAT "zi" - - #define G_MAXSIZE G_MAXU@glib_msize_type@ - #define G_MINSSIZE G_MIN@glib_msize_type@ diff --git a/devel/glib2/patches/patch-glib_gtypes.h b/devel/glib2/patches/patch-glib_gtypes.h deleted file mode 100644 index d041e6bee75..00000000000 --- a/devel/glib2/patches/patch-glib_gtypes.h +++ /dev/null @@ -1,26 +0,0 @@ -$NetBSD: patch-glib_gtypes.h,v 1.4 2019/12/29 19:40:56 triaxx Exp $ - -We insist on C99, so size_t exists => use it. -PR pkg/54298 -Include <sys/types.h> for ssize_t definition on at least OS X 10.14. - ---- glib/gtypes.h.orig 2019-12-19 16:33:15.000000000 +0000 -+++ glib/gtypes.h -@@ -32,6 +32,7 @@ - #include <glibconfig.h> - #include <glib/gmacros.h> - #include <glib/gversionmacros.h> -+#include <sys/types.h> - #include <time.h> - - G_BEGIN_DECLS -@@ -56,6 +57,9 @@ typedef unsigned int guint; - - typedef float gfloat; - typedef double gdouble; -+ -+typedef size_t gsize; -+typedef ssize_t gssize; - - /* Define min and max constants for the fixed size numerical types */ - /** diff --git a/devel/glib2/patches/patch-meson.build b/devel/glib2/patches/patch-meson.build index c73421d1db4..4db002df9d8 100644 --- a/devel/glib2/patches/patch-meson.build +++ b/devel/glib2/patches/patch-meson.build @@ -1,4 +1,4 @@ -$NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ +$NetBSD: patch-meson.build,v 1.9 2020/02/07 17:05:14 prlw1 Exp $ - On Darwin, optionally use Cocoa (needed for X11 users). @@ -12,7 +12,12 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ - Define a newer POSIX, as we build this package with -std=gnu99 ---- meson.build.orig 2019-11-19 17:51:31.000000000 +0000 +- Check size_t compatibility with various other types + commit 505c9544247f27cb6ebf749d0902d53c33dac308 + glib bug #1777 + c.f., PR pkg/54909 and PR pkg/54298 + +--- meson.build.orig 2020-02-07 11:23:09.221446856 +0000 +++ meson.build @@ -5,7 +5,6 @@ project('glib', 'c', 'cpp', default_options : [ @@ -22,7 +27,7 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ ] ) -@@ -677,6 +676,7 @@ if host_system == 'darwin' +@@ -671,6 +670,7 @@ if host_system == 'darwin' #error "Detected GNUstep, not Cocoa" #endif''', name : 'Mac OS X Cocoa support') @@ -30,7 +35,98 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ if glib_have_cocoa glib_conf.set('HAVE_COCOA', true) -@@ -1838,7 +1838,7 @@ endif +@@ -1314,28 +1314,86 @@ else + glibconfig_conf.set('g_searchpath_separator', ':') + endif + +-if sizet_size == short_size ++g_sizet_compatibility = { ++ 'short': sizet_size == short_size, ++ 'int': sizet_size == int_size, ++ 'long': sizet_size == long_size, ++ 'long long': sizet_size == long_long_size, ++} ++ ++# Do separate checks for gcc/clang (and ignore other compilers for now), since ++# we need to explicitly pass -Werror to the compilers. ++# FIXME: https://github.com/mesonbuild/meson/issues/5399 ++# We can’t simplify these checks using a foreach loop because dictionary keys ++# have to be string literals. ++# FIXME: https://github.com/mesonbuild/meson/issues/5231 ++if cc.get_id() == 'gcc' or cc.get_id() == 'clang' ++ g_sizet_compatibility += { ++ 'short': g_sizet_compatibility['short'] and cc.compiles( ++ '''#include <stddef.h> ++ size_t f (size_t *i) { return *i + 1; } ++ int main (void) { ++ unsigned short i = 0; ++ f (&i); ++ return 0; ++ }''', ++ args: ['-Werror'], ++ name : 'GCC size_t typedef is short'), ++ 'int': g_sizet_compatibility['int'] and cc.compiles( ++ '''#include <stddef.h> ++ size_t f (size_t *i) { return *i + 1; } ++ int main (void) { ++ unsigned int i = 0; ++ f (&i); ++ return 0; ++ }''', ++ args: ['-Werror'], ++ name : 'GCC size_t typedef is int'), ++ 'long': g_sizet_compatibility['long'] and cc.compiles( ++ '''#include <stddef.h> ++ size_t f (size_t *i) { return *i + 1; } ++ int main (void) { ++ unsigned long i = 0; ++ f (&i); ++ return 0; ++ }''', ++ args: ['-Werror'], ++ name : 'GCC size_t typedef is long'), ++ 'long long': g_sizet_compatibility['long long'] and cc.compiles( ++ '''#include <stddef.h> ++ size_t f (size_t *i) { return *i + 1; } ++ int main (void) { ++ unsigned long long i = 0; ++ f (&i); ++ return 0; ++ }''', ++ args: ['-Werror'], ++ name : 'GCC size_t typedef is long long'), ++ } ++endif ++ ++if g_sizet_compatibility['short'] + glibconfig_conf.set('glib_size_type_define', 'short') + glibconfig_conf.set_quoted('gsize_modifier', 'h') + glibconfig_conf.set_quoted('gssize_modifier', 'h') + glibconfig_conf.set_quoted('gsize_format', 'hu') + glibconfig_conf.set_quoted('gssize_format', 'hi') + glibconfig_conf.set('glib_msize_type', 'SHRT') +-elif sizet_size == int_size ++elif g_sizet_compatibility['int'] + glibconfig_conf.set('glib_size_type_define', 'int') + glibconfig_conf.set_quoted('gsize_modifier', '') + glibconfig_conf.set_quoted('gssize_modifier', '') + glibconfig_conf.set_quoted('gsize_format', 'u') + glibconfig_conf.set_quoted('gssize_format', 'i') + glibconfig_conf.set('glib_msize_type', 'INT') +-elif sizet_size == long_size ++elif g_sizet_compatibility['long'] + glibconfig_conf.set('glib_size_type_define', 'long') + glibconfig_conf.set_quoted('gsize_modifier', 'l') + glibconfig_conf.set_quoted('gssize_modifier', 'l') + glibconfig_conf.set_quoted('gsize_format', 'lu') + glibconfig_conf.set_quoted('gssize_format', 'li') + glibconfig_conf.set('glib_msize_type', 'LONG') +-elif sizet_size == long_long_size ++elif g_sizet_compatibility['long long'] + glibconfig_conf.set('glib_size_type_define', 'long long') + glibconfig_conf.set_quoted('gsize_modifier', int64_m) + glibconfig_conf.set_quoted('gssize_modifier', int64_m) +@@ -1832,7 +1890,7 @@ endif # proxy-libintl subproject. # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible # implementations. This could be extended if issues are found in some platforms. @@ -39,7 +135,7 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ libintl = [] have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset') else -@@ -1889,16 +1889,15 @@ if host_system != 'windows' and get_opti +@@ -1883,16 +1941,15 @@ if host_system != 'windows' and get_opti if cc.has_function('getxattr') and cc.has_header('sys/xattr.h') glib_conf.set('HAVE_SYS_XATTR_H', 1) glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_SYS_XATTR_H') @@ -58,7 +154,7 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ if cc.compiles(glib_conf_prefix + ''' #include <stdio.h> #ifdef HAVE_SYS_TYPES_H -@@ -1992,9 +1991,11 @@ endif +@@ -1986,9 +2043,11 @@ endif glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) @@ -73,7 +169,7 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ python_version = python.language_version() python_version_req = '>=3.4' -@@ -2003,7 +2004,7 @@ if not python_version.version_compare(py +@@ -1997,7 +2056,7 @@ if not python_version.version_compare(py endif # Determine which user environment-dependent files that we want to install @@ -82,7 +178,7 @@ $NetBSD: patch-meson.build,v 1.8 2019/11/28 18:11:48 jperkin Exp $ have_sh = find_program('sh', required : false).found() # For glib-gettextize # Some installed tests require a custom environment -@@ -2011,8 +2012,7 @@ env_program = find_program('env', requir +@@ -2005,8 +2064,7 @@ env_program = find_program('env', requir # FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578 if host_system == 'sunos' |