pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/glib2 Apply upstream's



details:   https://anonhg.NetBSD.org/pkgsrc/rev/682bf5071300
branches:  trunk
changeset: 422971:682bf5071300
user:      prlw1 <prlw1%pkgsrc.org@localhost>
date:      Fri Feb 07 17:05:14 2020 +0000

description:
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:

 devel/glib2/Makefile                           |    3 +-
 devel/glib2/distinfo                           |    6 +-
 devel/glib2/patches/patch-glib_glibconfig.h.in |   24 -----
 devel/glib2/patches/patch-glib_gtypes.h        |   26 -----
 devel/glib2/patches/patch-meson.build          |  112 +++++++++++++++++++++++-
 5 files changed, 108 insertions(+), 63 deletions(-)

diffs (267 lines):

diff -r 6b6025e10961 -r 682bf5071300 devel/glib2/Makefile
--- a/devel/glib2/Makefile      Fri Feb 07 13:44:26 2020 +0000
+++ b/devel/glib2/Makefile      Fri Feb 07 17:05:14 2020 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.266 2019/12/29 19:40:56 triaxx Exp $
+# $NetBSD: Makefile,v 1.267 2020/02/07 17:05:14 prlw1 Exp $
 
 .include "Makefile.common"
 
+PKGREVISION=   1
 CATEGORIES=    devel gnome
 COMMENT=       Some useful routines for C programming (glib2)
 
diff -r 6b6025e10961 -r 682bf5071300 devel/glib2/distinfo
--- a/devel/glib2/distinfo      Fri Feb 07 13:44:26 2020 +0000
+++ b/devel/glib2/distinfo      Fri Feb 07 17:05:14 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.266 2020/01/23 23:54:22 sevan Exp $
+$NetBSD: distinfo,v 1.267 2020/02/07 17:05:14 prlw1 Exp $
 
 SHA1 (glib-2.62.4.tar.xz) = f9a493c86f98482f13c6ed742c19487e6fa8f34b
 RMD160 (glib-2.62.4.tar.xz) = 4cac1bc54a690b007c859db2e9d65c33dc97395c
@@ -17,11 +17,9 @@
 SHA1 (patch-glib_gatomic.c) = 875ad9c828dcf2add356d4988d14fb4f1985aef8
 SHA1 (patch-glib_gatomic.h) = 21294cac483c3379198283c54fe6e24af3e630b1
 SHA1 (patch-glib_genviron.c) = 7182f5ef2ebc7f17d8d4fb892e946c52c8c0ad1d
-SHA1 (patch-glib_glibconfig.h.in) = 1964b5fb15317e681dad426d4862e3f48c4274f7
 SHA1 (patch-glib_gmacros.h) = b2737b6b089556ca9bb54176a41371042e329b9c
 SHA1 (patch-glib_gmain.c) = 4c834b3cb35b1e64b77dfe15f4b3aa01d4d5daa1
 SHA1 (patch-glib_gspawn.c) = 17a6f1b38660123eafd6fb66966eb240dee26db7
-SHA1 (patch-glib_gtypes.h) = ad193e4a991a9df84b0c38f5464d58d8025ee44c
 SHA1 (patch-glib_meson.build) = cafd7c607407208408be46c44ce2f238a2b56fd2
 SHA1 (patch-glib_tests_hash.c) = bb1535fbd3910d45aa2f70bd6e188692e8d02358
 SHA1 (patch-glib_tests_include.c) = 12d98caebfb87c1146821d518c37c45f97fc7be0
@@ -33,5 +31,5 @@
 SHA1 (patch-gmodule_gmodule.c) = 55c5f9d16e3517f3fdc04d40922f50d9c66b0b9a
 SHA1 (patch-gobject_glib-mkenums.in) = c177cf9b1ea81542665240678f47f68351a3760d
 SHA1 (patch-gobject_meson.build) = 412b65558aa4cf9648ee84a57ad6dfcc988b1a1d
-SHA1 (patch-meson.build) = 40b8da0debfefd3643d339ea171b76921dd03403
+SHA1 (patch-meson.build) = 3265900b1e44f139ddbf0e4cbbe61328f9c8bd34
 SHA1 (patch-meson_options.txt) = 7f633fbbfa9d9b2d958365891ffb9e4094d7dd54
diff -r 6b6025e10961 -r 682bf5071300 devel/glib2/patches/patch-glib_glibconfig.h.in
--- a/devel/glib2/patches/patch-glib_glibconfig.h.in    Fri Feb 07 13:44:26 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -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 -r 6b6025e10961 -r 682bf5071300 devel/glib2/patches/patch-glib_gtypes.h
--- a/devel/glib2/patches/patch-glib_gtypes.h   Fri Feb 07 13:44:26 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -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 -r 6b6025e10961 -r 682bf5071300 devel/glib2/patches/patch-meson.build
--- a/devel/glib2/patches/patch-meson.build     Fri Feb 07 13:44:26 2020 +0000
+++ b/devel/glib2/patches/patch-meson.build     Fri Feb 07 17:05:14 2020 +0000
@@ -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 @@
 
 - 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 @@
    ]
  )
  
-@@ -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 @@
  
    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 @@
    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 @@
    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 @@
  
  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 @@
  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'



Home | Main Index | Thread Index | Old Index