Update bluetooth patches with their latest revision from the BZ ticket.

This commit is contained in:
ajacoutot 2013-05-07 10:48:24 +00:00
parent 810e2b1ae5
commit c7d3acaf51
5 changed files with 245 additions and 92 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2013/04/28 07:18:46 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.7 2013/05/07 10:48:24 ajacoutot Exp $
SHARED_ONLY= Yes
@ -6,7 +6,7 @@ COMMENT= personal file-sharing service for GNOME
GNOME_PROJECT= gnome-user-share
GNOME_VERSION= 3.8.0
REVISION= 4
REVISION= 5
CATEGORIES= www sysutils
@ -44,10 +44,21 @@ CONFIGURE_ARGS= --disable-static \
--with-httpd=${LOCALBASE}/sbin/httpd2 \
--with-modules-path=${LOCALBASE}/lib/apache2
### https://bugzilla.gnome.org/show_bug.cgi?id=697537
CONFIGURE_ARGS += --disable-bluetooth
AUTOCONF_VERSION= 2.69
CONFIGURE_STYLE= autoconf
AUTOMAKE_VERSION= 1.13
BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS} \
devel/libtool
pre-configure:
cd ${WRKSRC} && \
AUTOCONF_VERSION=${AUTOCONF_VERSION} \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
autoreconf -i
###
perl -pi -e 's,/usr/share,${TRUEPREFIX}/share,g' \
${WRKSRC}/data/dav_user_2.*.conf

View File

@ -1,10 +1,10 @@
$OpenBSD: patch-configure_ac,v 1.3 2013/04/28 07:07:56 ajacoutot Exp $
$OpenBSD: patch-configure_ac,v 1.4 2013/05/07 10:48:24 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=697537
https://bugzilla.gnome.org/show_bug.cgi?id=601890
--- configure.ac.orig Mon Mar 25 12:33:35 2013
+++ configure.ac Wed Apr 10 10:20:02 2013
@@ -54,7 +54,7 @@ fi
+++ configure.ac Tue May 7 12:34:38 2013
@@ -54,10 +54,19 @@ fi
AC_SUBST(HTTPD)
@ -13,32 +13,19 @@ https://bugzilla.gnome.org/show_bug.cgi?id=697537
AC_SUBST(USER_SHARE_CFLAGS)
AC_SUBST(USER_SHARE_LIBS)
@@ -116,6 +116,24 @@ MODULES_PATH=$with_modules_path
AC_SUBST(MODULES_PATH)
dnl===========================================================================
+dnl disable bluetooth on non Linux platforms (needs bluez and udev)
+
+case $host_os in
+ linux*)
+ PKG_CHECK_MODULES(BLUETOOTH, gnome-bluetooth-1.0 >= 2.91.5)
+ have_bluetooth=yes
+ ;;
+ *)
+ have_bluetooth=no
+ ;;
+esac
+
+if test "x$have_bluetooth" = xyes ; then
+ AC_DEFINE(HAVE_BLUETOOTH, 1, [Define to 1 if bluetooth support is available])
+AC_ARG_ENABLE(bluetooth, AS_HELP_STRING([--disable-bluetooth],[compile without bluetooth support]),,enable_bluetooth=yes)
+if test "x$enable_bluetooth" = "xyes"; then
+ PKG_CHECK_MODULES(BLUETOOTH, gnome-bluetooth-1.0 >= 2.91.5)
+ AC_DEFINE(HAVE_BLUETOOTH, 1, [Set to true if gnome-bluetooth support is available])
+else
+ AC_MSG_WARN([Bluetooth support is disabled.])
+fi
+AM_CONDITIONAL(HAVE_BLUETOOTH, [test x"$have_bluetooth" = x"yes"])
+AM_CONDITIONAL(USE_BLUETOOTH, [test "$enable_bluetooth" = "yes"])
+
+dnl===========================================================================
dnl Check for nautilus for the share bar
AC_CHECK_LIB(socket, socket)
AC_ARG_WITH(nautilusdir,
@@ -124,7 +142,7 @@ AC_ARG_WITH(nautilusdir,
have_socket=no
@@ -124,7 +133,7 @@ AC_ARG_WITH(nautilusdir,
[ac_with_nautilusdir=""])
PKG_CHECK_MODULES(EXTENSION,

View File

@ -0,0 +1,52 @@
$OpenBSD: patch-src_Makefile_am,v 1.1 2013/05/07 10:48:24 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=601890
--- src/Makefile.am.orig Thu Feb 21 09:19:18 2013
+++ src/Makefile.am Tue May 7 12:34:38 2013
@@ -27,6 +27,7 @@ INCLUDES= \
-I$(top_builddir) \
$(EXTENSION_CFLAGS) \
$(USER_SHARE_CFLAGS) \
+ $(BLUETOOTH_CFLAGS) \
$(X_CFLAGS)
gnome_user_share_SOURCES = \
@@ -36,10 +37,6 @@ gnome_user_share_SOURCES = \
user_share-private.c \
http.c \
http.h \
- obexftp.c \
- obexftp.h \
- obexpush.c \
- obexpush.h \
$(MARSHALFILES)
gnome_user_share_LDADD = \
@@ -48,6 +45,15 @@ gnome_user_share_LDADD = \
$(SELINUX_LIBS) \
$(X_LIBS) $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
+if USE_BLUETOOTH
+gnome_user_share_SOURCES += \
+ obexftp.c \
+ obexftp.h \
+ obexpush.c \
+ obexpush.h
+gnome_user_share_LDADD += $(BLUETOOTH_LIBS)
+endif
+
nautilus_extensiondir = $(NAUTILUSDIR)
nautilus_extension_LTLIBRARIES = libnautilus-share-extension.la
@@ -59,6 +65,10 @@ libnautilus_share_extension_la_SOURCES = \
libnautilus_share_extension_la_LIBADD = libuser-share-common.la $(EXTENSION_LIBS)
libnautilus_share_extension_la_LDFLAGS = -avoid-version -module -no-undefined
+
+if USE_BLUETOOTH
+libnautilus_share_extension_la_LIBADD += $(BLUETOOTH_LIBS)
+endif
EXTRA_DIST = marshal.list

View File

@ -1,48 +1,61 @@
$OpenBSD: patch-src_share-extension_c,v 1.2 2013/04/08 09:05:42 ajacoutot Exp $
$OpenBSD: patch-src_share-extension_c,v 1.3 2013/05/07 10:48:24 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=697537
https://bugzilla.gnome.org/show_bug.cgi?id=601890
--- src/share-extension.c.orig Tue Jan 15 17:43:03 2013
+++ src/share-extension.c Mon Apr 8 10:21:30 2013
@@ -28,7 +28,9 @@
+++ src/share-extension.c Tue May 7 12:34:38 2013
@@ -28,10 +28,13 @@
#include <glib/gi18n-lib.h>
#include <gio/gdesktopappinfo.h>
#include <gtk/gtk.h>
+#ifdef HAVE_BLUETOOTH
#include <bluetooth-client.h>
+#endif
-#include <bluetooth-client.h>
#include <libnautilus-extension/nautilus-menu-provider.h>
#include <libnautilus-extension/nautilus-location-widget-provider.h>
@@ -92,6 +94,7 @@ bar_response_cb (NautilusShareBar *bar,
+#ifdef HAVE_BLUETOOTH
+#include <bluetooth-client.h>
+#endif /* HAVE_BLUETOOTH */
+
#include "nautilus-share-bar.h"
#include "user_share-common.h"
@@ -89,6 +92,7 @@ bar_response_cb (NautilusShareBar *bar,
launch_prefs_on_window ();
}
+#ifdef HAVE_BLUETOOTH
static void
downloads_bar_set_from_bluetooth_status (GtkWidget *bar)
{
+#ifdef HAVE_BLUETOOTH
BluetoothClient *client;
gboolean bt_powered;
@@ -100,6 +103,7 @@ downloads_bar_set_from_bluetooth_status (GtkWidget *ba
"default-adapter-powered", &bt_powered,
NULL);
gtk_widget_set_visible (bar, bt_powered);
+#endif
@@ -109,6 +113,7 @@ default_adapter_powered_cb (GObject *gobject,
{
downloads_bar_set_from_bluetooth_status (bar);
}
+#endif /* HAVE_BLUETOOTH */
static void
@@ -152,6 +156,7 @@ nautilus_user_share_get_location_widget (NautilusLocat
static GtkWidget *
nautilus_user_share_get_location_widget (NautilusLocationWidgetProvider *iface,
@@ -151,8 +156,13 @@ nautilus_user_share_get_location_widget (NautilusLocat
if (is_dir[0] != FALSE && is_dir[1] != FALSE) {
bar = nautilus_share_bar_new (_("May be used to share or receive files"));
} else if (is_dir[0] != FALSE) {
bar = nautilus_share_bar_new (_("May be shared over the network or Bluetooth"));
+#ifdef HAVE_BLUETOOTH
bar = nautilus_share_bar_new (_("May be shared over the network or Bluetooth"));
+#else
+ bar = nautilus_share_bar_new (_("May be shared over the network"));
+#endif /* HAVE_BLUETOOTH */
} else {
+#ifdef HAVE_BLUETOOTH
BluetoothClient *client;
@@ -162,6 +167,7 @@ nautilus_user_share_get_location_widget (NautilusLocat
bar = nautilus_share_bar_new (_("May be used to receive files over Bluetooth"));
@@ -162,6 +172,9 @@ nautilus_user_share_get_location_widget (NautilusLocat
g_signal_connect (G_OBJECT (client), "notify::default-adapter-powered",
G_CALLBACK (default_adapter_powered_cb), bar);
downloads_bar_set_from_bluetooth_status (bar);
+#endif
+#else
+ return NULL;
+#endif /* HAVE_BLUETOOTH */
}
g_signal_connect (bar, "response",

View File

@ -1,59 +1,149 @@
$OpenBSD: patch-src_user_share_c,v 1.5 2013/04/28 07:07:56 ajacoutot Exp $
$OpenBSD: patch-src_user_share_c,v 1.6 2013/05/07 10:48:24 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=697537
https://bugzilla.gnome.org/show_bug.cgi?id=601890
--- src/user_share.c.orig Thu Feb 21 09:18:06 2013
+++ src/user_share.c Sun Apr 28 08:48:13 2013
@@ -27,7 +27,9 @@
+++ src/user_share.c Tue May 7 12:34:38 2013
@@ -27,7 +27,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <glib/gstdio.h>
+#ifdef HAVE_BLUETOOTH
#include <bluetooth-client.h>
+#endif
-#include <bluetooth-client.h>
#include <gio/gio.h>
#include <X11/Xlib.h>
@@ -59,7 +61,9 @@ static guint disabled_timeout_tag = 0;
@@ -35,11 +34,16 @@
#include "user_share-private.h"
#include "user_share-common.h"
#include "http.h"
+
+#ifdef HAVE_BLUETOOTH
+#include <bluetooth-client.h>
+
#include "obexftp.h"
#include "obexpush.h"
#include <dbus/dbus.h>
#include <dbus/dbus-glib.h>
+#endif /* HAVE_BLUETOOTH */
#include <stdarg.h>
#include <string.h>
@@ -56,6 +60,8 @@
static GSettings *settings = NULL;
static guint disabled_timeout_tag = 0;
+
+#ifdef HAVE_BLUETOOTH
static GDBusProxy *session_proxy = NULL;
static gboolean has_console = TRUE;
+#ifdef HAVE_BLUETOOTH
static BluetoothClient *client = NULL;
+#endif
static gboolean bluetoothd_enabled = FALSE;
#define OBEX_ENABLED (bluetoothd_enabled && has_console)
@@ -153,6 +157,7 @@ default_adapter_changed (GObject *gobject,
GParamSpec *pspec,
gpointer user_data)
{
+#ifdef HAVE_BLUETOOTH
char *adapter;
gboolean adapter_powered;
@@ -173,17 +178,20 @@ default_adapter_changed (GObject *gobject,
else
obex_services_shutdown ();
}
+#endif
}
static void
bluez_init (void)
{
+#ifdef HAVE_BLUETOOTH
client = bluetooth_client_new ();
default_adapter_changed (NULL, NULL, NULL);
g_signal_connect (G_OBJECT (client), "notify::default-adapter",
G_CALLBACK (default_adapter_changed), NULL);
@@ -185,6 +191,7 @@ bluez_init (void)
g_signal_connect (G_OBJECT (client), "notify::default-adapter-powered",
G_CALLBACK (default_adapter_changed), NULL);
+#endif
}
+#endif /* HAVE_BLUETOOTH */
static void
migrate_old_configuration (void)
@@ -216,9 +223,13 @@ disabled_timeout_callback (void)
{
http_down ();
+#ifdef HAVE_BLUETOOTH
if (g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_ENABLED) == FALSE &&
g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED) == FALSE)
_exit (0);
+#else
+ _exit (0);
+#endif /* HAVE_BLUETOOTH */
return FALSE;
}
@@ -246,6 +257,7 @@ file_sharing_enabled_changed (void)
}
}
+#ifdef HAVE_BLUETOOTH
static void
file_sharing_bluetooth_allow_write_changed (void)
{
@@ -312,6 +324,7 @@ file_sharing_bluetooth_obexpush_notify_changed (void)
{
obexpush_set_notify (g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY));
}
+#endif /* HAVE_BLUETOOTH */
static void
setttings_changed (GSettings *settings,
@@ -324,6 +337,7 @@ setttings_changed (GSettings *settings,
else if (g_strcmp0 (FILE_SHARING_REQUIRE_PASSWORD, path) == 0)
require_password_changed ();
+#ifdef HAVE_BLUETOOTH
else if (g_strcmp0 (FILE_SHARING_BLUETOOTH_ENABLED, path) == 0)
file_sharing_bluetooth_enabled_changed ();
@@ -341,14 +355,17 @@ setttings_changed (GSettings *settings,
else if (g_strcmp0 (FILE_SHARING_BLUETOOTH_OBEXPUSH_NOTIFY, path) == 0)
file_sharing_bluetooth_obexpush_notify_changed ();
+#endif /* HAVE_BLUETOOTH */
}
static void
@@ -434,10 +442,12 @@ main (int argc, char **argv)
cleanup_handler (int sig)
{
http_down ();
+#ifdef HAVE_BLUETOOTH
obexftp_down ();
obexpush_down ();
+#endif /* HAVE_BLUETOOTH */
_exit (2);
}
@@ -356,7 +373,9 @@ static int
x_io_error_handler (Display *xdisplay)
{
http_down ();
+#ifdef HAVE_BLUETOOTH
obexftp_down ();
+#endif /* HAVE_BLUETOOTH */
_exit (2);
}
@@ -411,10 +430,14 @@ main (int argc, char **argv)
migrate_old_configuration ();
+#ifdef HAVE_BLUETOOTH
settings = g_settings_new (GNOME_USER_SHARE_SCHEMAS);
if (g_settings_get_boolean (settings, FILE_SHARING_ENABLED) == FALSE &&
g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_ENABLED) == FALSE &&
g_settings_get_boolean (settings, FILE_SHARING_BLUETOOTH_OBEXPUSH_ENABLED) == FALSE)
+#else
+ if (g_settings_get_boolean (settings, FILE_SHARING_ENABLED) == FALSE)
+#endif /* HAVE_BLUETOOTH */
return 1;
x_fd = ConnectionNumber (xdisplay);
@@ -422,22 +445,28 @@ main (int argc, char **argv)
if (http_init () == FALSE)
return 1;
+#ifdef HAVE_BLUETOOTH
if (obexftp_init () == FALSE)
return 1;
if (obexpush_init () == FALSE)
return 1;
+#endif /* HAVE_BLUETOOTH */
g_signal_connect (settings, "changed", G_CALLBACK(setttings_changed), NULL);
+#ifdef HAVE_BLUETOOTH
bluez_init ();
session_init ();
+#endif /* HAVE_BLUETOOTH */
/* Initial setting */
file_sharing_enabled_changed ();
@ -62,7 +152,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=697537
file_sharing_bluetooth_obexpush_accept_files_changed ();
file_sharing_bluetooth_obexpush_notify_changed ();
file_sharing_bluetooth_obexpush_enabled_changed ();
+#endif
+#endif /* HAVE_BLUETOOTH */
gtk_main ();
g_object_unref (settings);