pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/dbus - Fix support for NetBSD's atomic ops.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b64a51963896
branches:  trunk
changeset: 543459:b64a51963896
user:      bjs <bjs%pkgsrc.org@localhost>
date:      Thu Jun 19 01:56:44 2008 +0000

description:
- Fix support for NetBSD's atomic ops.
- Fix up some inconsistent handing of CONFIGURE_ARGS (mostly related
  to the debug option).
- Add test target (commented out, see Makefile).
- Add some patches from freedesktop.org git (see comments atop new patches).
- Remove trailing comma from an enum in tools/dbus-monitor.c.

Passes all tests on NetBSD/amd64 4.99.65, save for spawn test, which seems
to hang (?).  I'm also running GNOME now and everything seems to be in order.

diffstat:

 sysutils/dbus/Makefile         |  14 +++++-
 sysutils/dbus/distinfo         |  11 +++--
 sysutils/dbus/options.mk       |   4 +-
 sysutils/dbus/patches/patch-ab |  27 ++++++++-----
 sysutils/dbus/patches/patch-ad |  82 ++++++++++++++++++++++++++++++++++++++++++
 sysutils/dbus/patches/patch-ag |  13 +++++-
 sysutils/dbus/patches/patch-ah |  15 +++++++
 sysutils/dbus/patches/patch-ai |   4 +-
 sysutils/dbus/patches/patch-aj |  15 +++++++
 9 files changed, 163 insertions(+), 22 deletions(-)

diffs (truncated from 305 to 300 lines):

diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/Makefile
--- a/sysutils/dbus/Makefile    Thu Jun 19 01:13:32 2008 +0000
+++ b/sysutils/dbus/Makefile    Thu Jun 19 01:56:44 2008 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.29 2008/06/13 11:28:35 drochner Exp $
+# $NetBSD: Makefile,v 1.30 2008/06/19 01:56:44 bjs Exp $
 #
 
 DISTNAME=      dbus-1.2.1
+PKGREVISION=   1
 CATEGORIES=    sysutils
 MASTER_SITES=  http://dbus.freedesktop.org/releases/dbus/
 
@@ -34,10 +35,17 @@
 CONFIGURE_ARGS.Linux=  abstract-sockets dnotify selinux
 CONFIGURE_ARGS.docs=   doxygen-docs xml-docs
 
-CONFIGURE_ARGS.disable=                ansi asserts gcov tests
-CONFIGURE_ARGS.disable+=       console-owner-file verbose-mode
+CONFIGURE_ARGS.disable=                ansi gcov
+CONFIGURE_ARGS.disable+=       console-owner-file
 CONFIGURE_ARGS.disable+=       ${CONFIGURE_ARGS.docs}
 CONFIGURE_ARGS.enable=         checks static
+###
+### XXX the spawn test hangs, and some of these tests may be bogus
+###
+#.if !empty(PKGSRC_RUN_TEST:M[Yy][Ee][Ss])
+#PKG_OPTIONS.dbus+=            debug
+#TEST_TARGET=                  check
+#.endif
 
 CONFIGURE_ARGS.with=   dbus-user=${DBUS_USER}
 CONFIGURE_ARGS.with+=  test-socket-dir=${WRKDIR:Q}
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/distinfo
--- a/sysutils/dbus/distinfo    Thu Jun 19 01:13:32 2008 +0000
+++ b/sysutils/dbus/distinfo    Thu Jun 19 01:56:44 2008 +0000
@@ -1,10 +1,13 @@
-$NetBSD: distinfo,v 1.22 2008/06/14 10:24:52 tnn Exp $
+$NetBSD: distinfo,v 1.23 2008/06/19 01:56:44 bjs Exp $
 
 SHA1 (dbus-1.2.1.tar.gz) = 2c5b38d51b486e0143faf7749d298e07a8c71223
 RMD160 (dbus-1.2.1.tar.gz) = 88b20e16251e10e205fece57e6b434a7aa43b615
 Size (dbus-1.2.1.tar.gz) = 1406833 bytes
 SHA1 (patch-aa) = e527a1a1f937781ce4204a325e3ff7f31fd6afa8
-SHA1 (patch-ab) = 586c1c459fd194ba5e26bd74caac1c26f890ec42
+SHA1 (patch-ab) = a6204676083ab962df12c7860b1facc8ccbd3d96
 SHA1 (patch-ac) = afec419973f339e846dc109866148529f80998b3
-SHA1 (patch-ag) = 9539b91fb496681b03854ebdc698b53ae43e6ba6
-SHA1 (patch-ai) = 046f3a78c465b28595abf278aac942f7f0d0a297
+SHA1 (patch-ad) = 8f5c8a8a21cf16c8951764f3b5aafc229a5abbc0
+SHA1 (patch-ag) = a96fa42f2635675a7522a2782e949622288dca92
+SHA1 (patch-ah) = 2663883ca34c6d52f520e67b93840661aa9b6537
+SHA1 (patch-ai) = a45bd8d29955e9c14a4d8b3f44b42242d70c1cd8
+SHA1 (patch-aj) = a354b0fe5fda70114ff1c0bd717c127663c49085
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/options.mk
--- a/sysutils/dbus/options.mk  Thu Jun 19 01:13:32 2008 +0000
+++ b/sysutils/dbus/options.mk  Thu Jun 19 01:56:44 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.1 2008/06/13 11:28:35 drochner Exp $
+# $NetBSD: options.mk,v 1.2 2008/06/19 01:56:44 bjs Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.dbus
 PKG_SUPPORTED_OPTIONS+=        debug kqueue nox11
@@ -14,6 +14,8 @@
 
 .if !empty(PKG_OPTIONS:Mdebug)
 CONFIGURE_ARGS.enable+=        asserts tests verbose-mode
+.else
+CONFIGURE_ARGS.disable+= asserts tests verbose-mode
 .endif
 
 .if !empty(PKG_OPTIONS:Mkqueue)
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/patches/patch-ab
--- a/sysutils/dbus/patches/patch-ab    Thu Jun 19 01:13:32 2008 +0000
+++ b/sysutils/dbus/patches/patch-ab    Thu Jun 19 01:56:44 2008 +0000
@@ -1,12 +1,12 @@
-$NetBSD: patch-ab,v 1.11 2008/06/14 10:24:52 tnn Exp $
+$NetBSD: patch-ab,v 1.12 2008/06/19 01:56:44 bjs Exp $
 
---- dbus/dbus-sysdeps-unix.c.orig      2008-04-04 17:24:08.000000000 +0200
+--- dbus/dbus-sysdeps-unix.c.orig      2008-04-04 11:24:08.000000000 -0400
 +++ dbus/dbus-sysdeps-unix.c
 @@ -35,6 +35,9 @@
  #include "dbus-list.h"
  #include "dbus-credentials.h"
  
-+#ifdef DBUS_USE_NETBSD_ATOMIC_OPS
++#ifdef HAVE_NETBSD_ATOMIC_OPS
 +#include <sys/atomic.h>
 +#endif
  #include <sys/types.h>
@@ -34,35 +34,42 @@
  
   redo_lookup_with_port:
    if ((res = getaddrinfo(host, port, &hints, &ai)) != 0 || !ai)
-@@ -1753,7 +1762,19 @@ _dbus_parse_uid (const DBusString      *
+@@ -1753,7 +1762,26 @@ _dbus_parse_uid (const DBusString      *
    return TRUE;
  }
  
-+#ifdef DBUS_USE_NETBSD_ATOMIC_OPS
++#ifdef HAVE_NETBSD_ATOMIC_OPS
 +dbus_int32_t
 +_dbus_atomic_inc (DBusAtomic *atomic)
 +{
-+  return (atomic_inc_32_nv(DBusAtomic));
++      register dbus_int32_t old = atomic->value;
++
++      atomic_inc_uint((unsigned *)&atomic->value);
++      return old;
 +}
  
 +dbus_int32_t
 +_dbus_atomic_dec (DBusAtomic *atomic)
 +{
-+  return (atomic_dec_32_nv(DBusAtomic));
++      register dbus_int32_t old = atomic->value;
++
++      atomic_dec_uint((unsigned *)&atomic->value);
++      return old;
 +}
++_DBUS_DEFINE_GLOBAL_LOCK (atomic);
 +#else
  _DBUS_DEFINE_GLOBAL_LOCK (atomic);
  
  #if DBUS_USE_ATOMIC_INT_486_COND
-@@ -1818,6 +1839,7 @@ _dbus_atomic_dec (DBusAtomic *atomic)
+@@ -1818,6 +1846,7 @@ _dbus_atomic_dec (DBusAtomic *atomic)
    return res;
  #endif
  }
-+#endif /* DBUS_USE_NETBSD_ATOMIC_OPS */
++#endif /* HAVE_NETBSD_ATOMIC_OPS */
  
  #ifdef DBUS_BUILD_TESTS
  /** Gets our GID
-@@ -2711,8 +2733,18 @@ int
+@@ -2711,8 +2740,18 @@ int
  _dbus_printf_string_upper_bound (const char *format,
                                   va_list     args)
  {
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/dbus/patches/patch-ad    Thu Jun 19 01:56:44 2008 +0000
@@ -0,0 +1,82 @@
+$NetBSD: patch-ad,v 1.3 2008/06/19 01:56:44 bjs Exp $
+
+git ref:       cdca6dbce88fd1e1195e2a81eb6619c782df2fac
+               Prevent a crash in some applications due to timers 
+               leaking after the DVusPendingCall object was freed.
+
+git ref:       d7bb3cf8dfc162007caf5e28d9c304381de7b8c3
+               Fix inverted return value from dbus_connection_read_write()
+
+also:          fix f.d.o. bug 15635
+
+--- dbus/dbus-connection.c.orig        2008-04-04 11:24:08.000000000 -0400
++++ dbus/dbus-connection.c
+@@ -965,6 +965,13 @@ _dbus_connection_detach_pending_call_and
+   _dbus_pending_call_ref_unlocked (pending);
+   _dbus_hash_table_remove_int (connection->pending_replies,
+                                _dbus_pending_call_get_reply_serial_unlocked (pending));
++
++  if (_dbus_pending_call_is_timeout_added_unlocked (pending))
++      _dbus_connection_remove_timeout_unlocked (connection,
++              _dbus_pending_call_get_timeout_unlocked (pending));
++
++  _dbus_pending_call_set_timeout_added_unlocked (pending, FALSE);
++
+   _dbus_pending_call_unref_and_unlock (pending);
+ }
+ 
+@@ -1671,21 +1678,26 @@ connection_forget_shared_unlocked (DBusC
+   if (!connection->shareable)
+     return;
+   
++  _DBUS_LOCK (shared_connections);
++      
+   if (connection->server_guid != NULL)
+     {
+       _dbus_verbose ("dropping connection to %s out of the shared table\n",
+                      connection->server_guid);
+       
+-      _DBUS_LOCK (shared_connections);
+-      
+       if (!_dbus_hash_table_remove_string (shared_connections,
+                                            connection->server_guid))
+         _dbus_assert_not_reached ("connection was not in the shared table");
+       
+       dbus_free (connection->server_guid);
+       connection->server_guid = NULL;
+-      _DBUS_UNLOCK (shared_connections);
+     }
++  else
++    {
++      _dbus_list_remove (&shared_connections_no_guid, connection);
++    }
++
++  _DBUS_UNLOCK (shared_connections);
+   
+   /* remove our reference held on all shareable connections */
+   _dbus_connection_unref_unlocked (connection);
+@@ -3405,6 +3417,12 @@ _dbus_connection_read_write_dispatch (DB
+ {
+   DBusDispatchStatus dstatus;
+   dbus_bool_t no_progress_possible;
++
++  /* Need to grab a ref here in case we're a private connection and
++   * the user drops the last ref in a handler we call; see bug 
++   * https://bugs.freedesktop.org/show_bug.cgi?id=15635
++   */
++  dbus_connection_ref (connection);
+   
+   dstatus = dbus_connection_get_dispatch_status (connection);
+ 
+@@ -3444,7 +3462,11 @@ _dbus_connection_read_write_dispatch (DB
+       connection->disconnect_message_link == NULL;
+   else
+     no_progress_possible = _dbus_connection_get_is_connected_unlocked (connection);
++
+   CONNECTION_UNLOCK (connection);
++
++  dbus_connection_unref (connection);
++
+   return !no_progress_possible; /* TRUE if we can make more progress */
+ }
+ 
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/patches/patch-ag
--- a/sysutils/dbus/patches/patch-ag    Thu Jun 19 01:13:32 2008 +0000
+++ b/sysutils/dbus/patches/patch-ag    Thu Jun 19 01:56:44 2008 +0000
@@ -1,7 +1,16 @@
-$NetBSD: patch-ag,v 1.2 2008/06/13 11:28:35 drochner Exp $
+$NetBSD: patch-ag,v 1.3 2008/06/19 01:56:44 bjs Exp $
 
---- tools/dbus-monitor.c.orig  2008-02-26 11:02:28.000000000 -0500
+--- tools/dbus-monitor.c.orig  2008-04-04 11:24:08.000000000 -0400
 +++ tools/dbus-monitor.c
+@@ -91,7 +91,7 @@ typedef enum
+   PROFILE_ATTRIBUTE_FLAG_PATH = 16,
+   PROFILE_ATTRIBUTE_FLAG_INTERFACE = 32,
+   PROFILE_ATTRIBUTE_FLAG_MEMBER = 64,
+-  PROFILE_ATTRIBUTE_FLAG_ERROR_NAME = 128,
++  PROFILE_ATTRIBUTE_FLAG_ERROR_NAME = 128
+ } ProfileAttributeFlags;
+ 
+ static void
 @@ -295,8 +295,10 @@ main (int argc, char *argv[])
      exit (1);
    }
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/patches/patch-ah
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/dbus/patches/patch-ah    Thu Jun 19 01:56:44 2008 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-ah,v 1.3 2008/06/19 01:56:44 bjs Exp $
+
+Fix to match config.h.in.
+
+--- dbus/dbus-userdb-util.c.orig       2008-04-04 11:24:08.000000000 -0400
++++ dbus/dbus-userdb-util.c
+@@ -223,7 +223,7 @@ _dbus_user_database_lookup_group (DBusUs
+         gid = n;
+     }
+ 
+-#ifdef DBUS_ENABLE_USER_CACHE
++#ifdef DBUS_ENABLE_USERDB_CACHE
+   if (gid != DBUS_GID_UNSET)
+     info = _dbus_hash_table_lookup_ulong (db->groups, gid);
+   else
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/patches/patch-ai
--- a/sysutils/dbus/patches/patch-ai    Thu Jun 19 01:13:32 2008 +0000
+++ b/sysutils/dbus/patches/patch-ai    Thu Jun 19 01:56:44 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: patch-ai,v 1.1 2008/06/13 11:28:35 drochner Exp $
+$NetBSD: patch-ai,v 1.2 2008/06/19 01:56:44 bjs Exp $
 
 --- config.h.in.orig   2008-04-04 14:24:08.000000000 -0400
 +++ config.h.in
@@ -6,7 +6,7 @@
     for 486, else 0 */
  #undef DBUS_USE_ATOMIC_INT_486_COND
  
-+#undef DBUS_USE_NETBSD_ATOMIC_OPS
++#undef HAVE_NETBSD_ATOMIC_OPS
 +
  /* A 'va_copy' style function */
  #undef DBUS_VA_COPY
diff -r 5a01bb4232d3 -r b64a51963896 sysutils/dbus/patches/patch-aj
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/dbus/patches/patch-aj    Thu Jun 19 01:56:44 2008 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-aj,v 1.1 2008/06/19 01:56:44 bjs Exp $
+
+Fix to match what's in config.h.in.
+
+--- dbus/dbus-userdb.c.orig    2008-04-04 11:24:08.000000000 -0400
++++ dbus/dbus-userdb.c
+@@ -143,7 +143,7 @@ _dbus_user_database_lookup (DBusUserData
+         uid = n;
+     }
+ 



Home | Main Index | Thread Index | Old Index