ports/106357: comms/openobex fails on build

Guido Falsi mad at madpilot.net
Tue Dec 5 19:30:22 UTC 2006


The following reply was made to PR ports/106357; it has been noted by GNATS.

From: Guido Falsi <mad at madpilot.net>
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: ports/106357: comms/openobex fails on build
Date: Tue, 5 Dec 2006 20:23:29 +0100

 A few files were lost somewhere on the path to the last update.
 
 Following patch should fix everything.
 
 added files:
 
 patch-lib-btobex.c
 patch-lib-databuffer.h
 patch-lib-obex.c
 patch-lib-obex_main.c
 patch-lib-obex_transport.h
 
 patch (hope it applies cleanly):
 
 diff -ruN openobex.old/files/patch-lib-btobex.c openobex/files/patch-lib-btobex.c
 --- openobex.old/files/patch-lib-btobex.c	Thu Jan  1 01:00:00 1970
 +++ openobex/files/patch-lib-btobex.c	Tue Dec  5 20:16:15 2006
 @@ -0,0 +1,110 @@
 +--- lib/btobex.c.orig	Tue Jan  3 20:36:15 2006
 ++++ lib/btobex.c	Sat Nov 25 22:00:13 2006
 +@@ -46,8 +46,12 @@
 + #include <netinet/in.h>
 + #include <sys/socket.h>
 + 
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++#include <bluetooth.h>
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + #include <bluetooth/bluetooth.h>
 + #include <bluetooth/rfcomm.h>
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 
 + #endif /* _WIN32 */
 + 
 +@@ -63,6 +67,15 @@
 + void btobex_prepare_connect(obex_t *self, bdaddr_t *src, bdaddr_t *dst, uint8_t channel)
 + {
 + #ifndef _WIN32
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
 ++	bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
 ++	self->trans.self.rfcomm.rfcomm_channel = 0;
 ++
 ++	self->trans.peer.rfcomm.rfcomm_family = AF_BLUETOOTH;
 ++	bacpy(&self->trans.peer.rfcomm.rfcomm_bdaddr, dst);
 ++	self->trans.peer.rfcomm.rfcomm_channel = channel;
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
 + 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
 + 	self->trans.self.rfcomm.rc_channel = 0;
 +@@ -70,6 +83,7 @@
 + 	self->trans.peer.rfcomm.rc_family = AF_BLUETOOTH;
 + 	bacpy(&self->trans.peer.rfcomm.rc_bdaddr, dst);
 + 	self->trans.peer.rfcomm.rc_channel = channel;
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + #endif /* _WIN32 */
 + }
 + 
 +@@ -83,9 +97,15 @@
 + {
 + #ifndef _WIN32
 + 	/* Bind local service */
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	self->trans.self.rfcomm.rfcomm_family = AF_BLUETOOTH;
 ++	bacpy(&self->trans.self.rfcomm.rfcomm_bdaddr, src);
 ++	self->trans.self.rfcomm.rfcomm_channel = channel;
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	self->trans.self.rfcomm.rc_family = AF_BLUETOOTH;
 + 	bacpy(&self->trans.self.rfcomm.rc_bdaddr, src);
 + 	self->trans.self.rfcomm.rc_channel = channel;
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + #endif /* _WIN32 */
 + }
 + 
 +@@ -106,9 +126,15 @@
 + 		return -1;
 + 	}
 + 	
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
 ++		 sizeof(struct sockaddr_rfcomm)))
 ++	{
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	if (bind(self->serverfd, (struct sockaddr*) &self->trans.self.rfcomm, 
 + 		 sizeof(struct sockaddr_rc)))
 + 	{
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 		DEBUG(0, "Error doing bind\n");
 + 		goto out_freesock;
 + 	}
 +@@ -140,7 +166,11 @@
 + int btobex_accept(obex_t *self)
 + {
 + #ifndef _WIN32
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	socklen_t addrlen = sizeof(struct sockaddr_rfcomm);
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	socklen_t addrlen = sizeof(struct sockaddr_rc);
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	//int mtu;
 + 	//int len = sizeof(int);
 + 
 +@@ -178,16 +208,26 @@
 + 			return -1;
 + 	}
 + 
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
 ++		   sizeof(struct sockaddr_rfcomm));
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	ret = bind(self->fd, (struct sockaddr*) &self->trans.self.rfcomm,
 + 		   sizeof(struct sockaddr_rc));
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 
 + 	if (ret < 0) {
 + 		DEBUG(4, "ret=%d\n", ret);
 + 		goto out_freesock;
 + 	}
 + 
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
 ++		      sizeof(struct sockaddr_rfcomm));
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	ret = connect(self->fd, (struct sockaddr*) &self->trans.peer.rfcomm,
 + 		      sizeof(struct sockaddr_rc));
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	if (ret < 0) {
 + 		DEBUG(4, "ret=%d\n", ret);
 + 		goto out_freesock;
 diff -ruN openobex.old/files/patch-lib-databuffer.h openobex/files/patch-lib-databuffer.h
 --- openobex.old/files/patch-lib-databuffer.h	Thu Jan  1 01:00:00 1970
 +++ openobex/files/patch-lib-databuffer.h	Tue Dec  5 20:16:15 2006
 @@ -0,0 +1,11 @@
 +--- lib/databuffer.h.orig	Thu May  4 13:24:21 2006
 ++++ lib/databuffer.h	Sat Nov 25 22:02:38 2006
 +@@ -31,7 +31,7 @@
 + #define DATABUFFER_H
 + 
 + #define __need_size_t
 +-#include <stddef.h>
 ++#include <sys/types.h>
 + #include <stdint.h>
 + 
 + /*
 diff -ruN openobex.old/files/patch-lib-obex.c openobex/files/patch-lib-obex.c
 --- openobex.old/files/patch-lib-obex.c	Thu Jan  1 01:00:00 1970
 +++ openobex/files/patch-lib-obex.c	Tue Dec  5 20:16:15 2006
 @@ -0,0 +1,26 @@
 +--- lib/obex.c.orig	Thu May 25 20:09:41 2006
 ++++ lib/obex.c	Sat Nov 25 22:04:07 2006
 +@@ -1031,7 +1031,11 @@
 + 
 + #ifdef HAVE_BLUETOOTH
 + 	if(src == NULL)
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++		src = NG_HCI_BDADDR_ANY;
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 		src = BDADDR_ANY;
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	btobex_prepare_listen(self, src, channel);
 + 	return obex_transport_listen(self);
 + #else
 +@@ -1061,7 +1065,11 @@
 + 
 + #ifdef HAVE_BLUETOOTH
 + 	if(src == NULL)
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++		src = NG_HCI_BDADDR_ANY;
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 		src = BDADDR_ANY;
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	btobex_prepare_connect(self, src, dst, channel);
 + 	return obex_transport_connect_request(self);
 + #else
 diff -ruN openobex.old/files/patch-lib-obex_main.c openobex/files/patch-lib-obex_main.c
 --- openobex.old/files/patch-lib-obex_main.c	Thu Jan  1 01:00:00 1970
 +++ openobex/files/patch-lib-obex_main.c	Tue Dec  5 20:16:15 2006
 @@ -0,0 +1,26 @@
 +--- lib/obex_main.c.orig	Thu May  4 13:24:21 2006
 ++++ lib/obex_main.c	Sat Nov 25 22:32:59 2006
 +@@ -46,7 +46,11 @@
 + #include <stdio.h>
 + 
 + #ifdef HAVE_BLUETOOTH
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++#include <bluetooth.h>
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + #include <bluetooth/bluetooth.h>
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + #endif /*HAVE_BLUETOOTH*/
 + 
 + #endif /* _WIN32 */
 +@@ -80,7 +84,11 @@
 + 
 + #ifdef HAVE_BLUETOOTH
 + 	if (domain == AF_BLUETOOTH)
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++		proto = BLUETOOTH_PROTO_RFCOMM;
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 		proto = BTPROTO_RFCOMM;
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + #endif /*HAVE_BLUETOOTH*/
 + 
 + 	fd = socket(domain, SOCK_STREAM, proto);
 diff -ruN openobex.old/files/patch-lib-obex_transport.h openobex/files/patch-lib-obex_transport.h
 --- openobex.old/files/patch-lib-obex_transport.h	Thu Jan  1 01:00:00 1970
 +++ openobex/files/patch-lib-obex_transport.h	Tue Dec  5 20:16:15 2006
 @@ -0,0 +1,27 @@
 +--- lib/obex_transport.h.orig	Thu May  4 13:24:21 2006
 ++++ lib/obex_transport.h	Sat Nov 25 22:34:03 2006
 +@@ -40,8 +40,12 @@
 + #include "irda_wrap.h"
 + #endif /*HAVE_IRDA*/
 + #ifdef HAVE_BLUETOOTH
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++#include <bluetooth.h>
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + #include <bluetooth/bluetooth.h>
 + #include <bluetooth/rfcomm.h>
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + #endif /*HAVE_BLUETOOTH*/
 + #ifdef HAVE_USB
 + #include "usbobex.h"
 +@@ -55,7 +59,11 @@
 + #endif /*HAVE_IRDA*/
 + 	struct sockaddr_in   inet;
 + #ifdef HAVE_BLUETOOTH
 ++#ifdef HAVE_BLUETOOTH_NETGRAPH
 ++	struct sockaddr_rfcomm   rfcomm;
 ++#else /*HAVE_BLUETOOTH_NETGRAPH*/
 + 	struct sockaddr_rc   rfcomm;
 ++#endif /*HAVE_BLUETOOTH_NETGRAPH*/
 + #endif /*HAVE_BLUETOOTH*/
 + #ifdef HAVE_USB
 + 	struct obex_usb_intf_transport_t usb;
 
 -- 
 Guido Falsi <mad at madpilot.net>



More information about the freebsd-ports-bugs mailing list