$NetBSD: patch-configure,v 1.4 2019/09/14 04:26:39 tsutsui Exp $

- pull upstream fix
  g_dbus_server_new_sync() is failed with address unix:tmpdir=/tmp/ibus
  https://github.com/ibus/ibus/issues/2116

--- configure.orig	2019-08-23 11:08:50.000000000 +0000
+++ configure
@@ -1047,6 +1047,7 @@ with_unicode_emoji_dir
 with_emoji_annotation_dir
 enable_unicode_dict
 with_ucd_dir
+with_socket_dir
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1806,6 +1807,19 @@ Optional Packages:
                           "/usr/share/unicode/cldr/common/annotations")
   --with-ucd-dir=DIR      Set the directory of UCD (Unicode Character
                           Database) files. (default: "/usr/share/unicode/ucd")
+  --with-socket-dir=DIR   Set the default socket directory to connect
+                          ibus-daemon with D-Bus connections (default:
+                          "$XDG_RUNTIME_DIR/ibus"). The best practice of the
+                          socket directory would be unique per user not to
+                          modify by malicious users but XDG_RUNTIME_DIR is not
+                          integrated in BSD systems and the BSD's default is
+                          "/tmp". "$XDG_RUMTIME_DIR", "$XDG_CACHE_HOME",
+                          "$UID" are extracted by ibus-daemon. ibus-daemon
+                          also runs mkdir for the socket directory since BSD
+                          systems do not support abstract socket paths. The
+                          socket path on a NFS mount would not be a good idea
+                          likes "/home/$USER" because the directory is not
+                          sometimes accessible with the network condition.
 
 Some influential environment variables:
   CC          C compiler command
@@ -4931,7 +4945,7 @@ _ACEOF
 
 # For dislpay date.
 
-DATE_DISPLAY="Fri Aug 23 2019"
+DATE_DISPLAY="Sat Sep 14 2019"
 
 
 
@@ -20506,6 +20520,25 @@ the UCD files from https://www.unicode.o
     enable_unicode_dict="yes (enabled, use --disable-unicode-dict to disable)"
 fi
 
+
+# Check whether --with-socket-dir was given.
+if test "${with_socket_dir+set}" = set; then :
+  withval=$with_socket_dir; IBUS_SOCKET_DIR=$with_socket_dir
+else
+  case $host in
+         *linux*) IBUS_SOCKET_DIR='unix:tmpdir=$XDG_RUNTIME_DIR/ibus';;
+         *)       IBUS_SOCKET_DIR='unix:tmpdir=/tmp';;
+     esac
+
+
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define IBUS_SOCKET_DIR "$IBUS_SOCKET_DIR"
+_ACEOF
+
+
 # Check iso-codes.
 
 pkg_failed=no
@@ -23270,6 +23303,7 @@ Build options:
   CLDR annotation directory     $EMOJI_ANNOTATION_DIR
   Enable Unicode dict           $enable_unicode_dict
   UCD directory                 $UCD_DIR
+  Socket directory              \"$IBUS_SOCKET_DIR\"
   Run test cases                $enable_tests
   Install tests                 $enable_install_tests
 " >&5
@@ -23310,6 +23344,7 @@ Build options:
   CLDR annotation directory     $EMOJI_ANNOTATION_DIR
   Enable Unicode dict           $enable_unicode_dict
   UCD directory                 $UCD_DIR
+  Socket directory              \"$IBUS_SOCKET_DIR\"
   Run test cases                $enable_tests
   Install tests                 $enable_install_tests
 " >&6; }
