ports/85075: [patch] unbreak net/gaim-openq on 4.X
Matthew Luckie
mjl at luckie.org.nz
Thu Aug 18 08:00:38 UTC 2005
>Number: 85075
>Category: ports
>Synopsis: [patch] unbreak net/gaim-openq on 4.X
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 18 08:00:35 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Matthew Luckie
>Release: FreeBSD 4.11-RELEASE-p8 i386
>Organization:
University of Waikato
>Environment:
System: FreeBSD lycra.luckie.org.nz 4.11-RELEASE-p8 FreeBSD 4.11-RELEASE-p8 #1: Wed May 11 14:02:09 NZST 2005 root at lycra.luckie.org.nz:/files/freebsd_src/sys/compile/lycra i386
>Description:
make gaim-openq compile on 4.X
>How-To-Repeat:
N/A
>Fix:
diff -uNr gaim-openq.orig/Makefile gaim-openq/Makefile
--- gaim-openq.orig/Makefile Sun Jul 10 07:04:01 2005
+++ gaim-openq/Makefile Thu Aug 18 19:50:17 2005
@@ -7,7 +7,7 @@
PORTNAME= openq
PORTVERSION= 0.3.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -27,10 +27,4 @@
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} < 500000
-BROKEN= "does not compile"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff -uNr gaim-openq.orig/files/patch-src-file_trans.c gaim-openq/files/patch-src-file_trans.c
--- gaim-openq.orig/files/patch-src-file_trans.c Wed Apr 20 23:18:47 2005
+++ gaim-openq/files/patch-src-file_trans.c Thu Aug 18 19:35:23 2005
@@ -1,10 +1,96 @@
---- src/file_trans.c.orig Tue Apr 19 03:52:08 2005
-+++ src/file_trans.c Tue Apr 19 03:00:39 2005
-@@ -26,6 +26,7 @@
+--- src/file_trans.c.orig Thu Aug 18 19:21:53 2005
++++ src/file_trans.c Thu Aug 18 19:33:01 2005
+@@ -26,6 +26,9 @@
#define random rand
#endif
++#include <sys/types.h>
+#include <sys/socket.h>
++
#include "debug.h" // gaim_debug
#include "ft.h" // gaim_xfer
#include "md5.h"
+@@ -213,8 +216,8 @@
+ int _qq_xfer_open_file(const gchar *filename, const gchar *method, GaimXfer *xfer)
+ {
+ ft_info *info = xfer->data;
+- info->dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method);
+- if (info->dest_fp == NULL) {
++ info->un.dest_fp = fopen(gaim_xfer_get_local_filename(xfer), method);
++ if (info->un.dest_fp == NULL) {
+ return -1;
+ }
+ return 0;
+@@ -225,26 +228,28 @@
+ {
+ ft_info *info = xfer->data;
+
+- fseek(info->dest_fp, index * len, SEEK_SET);
+- return fread(buffer, 1, len, info->dest_fp);
++ fseek(info->un.dest_fp, index * len, SEEK_SET);
++ return fread(buffer, 1, len, info->un.dest_fp);
+ }
+
+ gint
+ _qq_xfer_write_file(guint8 *buffer, guint index, guint len, GaimXfer *xfer)
+ {
+ ft_info *info = xfer->data;
+- fseek(info->dest_fp, index * len, SEEK_SET);
+- return fwrite(buffer, 1, len, info->dest_fp);
++ fseek(info->un.dest_fp, index * len, SEEK_SET);
++ return fwrite(buffer, 1, len, info->un.dest_fp);
+ }
+
+ void qq_xfer_close_file(GaimXfer *xfer)
+ {
+ ft_info *info = xfer->data;
+
+- if (info->dest_fp) fclose(info->dest_fp);
++ if (info->un.dest_fp) fclose(info->un.dest_fp);
+ }
+ #endif
+
++ssize_t _qq_xfer_write(const char *buf, size_t len, GaimXfer *xfer);
++
+ gint _qq_send_file(GaimConnection *gc, guint8 *data, gint len, guint16 packet_type, guint32 to_uid)
+ {
+ gint bytes;
+@@ -270,7 +275,6 @@
+ bytes += create_packet_dw(buf, &cursor, _encrypt_qq_uid(to_uid, file_key));
+ bytes += create_packet_data(buf, &cursor, data, len);
+
+- ssize_t _qq_xfer_write(const char *buf, size_t len, GaimXfer *xfer);
+ if (bytes == len + 12) {
+ //gaim_xfer_write(qd->xfer, buf, bytes);
+ _qq_xfer_write(buf, bytes, qd->xfer);
+@@ -397,10 +401,11 @@
+ gchar file_md5[16], filename_md5[16], *filename;
+ gint filename_len, filesize;
+ qq_data *qd;
++ ft_info *info;
+
+ g_return_if_fail(gc != NULL && gc->proto_data != NULL);
+ qd = (qq_data *) gc->proto_data;
+- ft_info *info = (ft_info *) qd->xfer->data;
++ info = (ft_info *) qd->xfer->data;
+
+ filename = (gchar *) gaim_xfer_get_filename(qd->xfer);
+ filesize = gaim_xfer_get_size(qd->xfer);
+@@ -669,6 +674,8 @@
+ GaimXfer *xfer = qd->xfer;
+ ft_info *info = (ft_info *) xfer->data;
+ guint32 mask;
++ guint8 *buffer;
++ gint readbytes;
+
+ gaim_debug(GAIM_DEBUG_INFO, "QQ", "receiving %dth fragment ack, slide window status %o, max_fragment_index %d\n",
+ fragment_index, info->window, info->max_fragment_index);
+@@ -698,8 +705,6 @@
+ {
+ //move the slide window
+ info->window &= ~mask;
+- guint8 *buffer;
+- gint readbytes;
+
+ buffer = g_newa(guint8, info->fragment_len);
+ readbytes = _qq_xfer_read_file(buffer, info->max_fragment_index + sizeof(info->window),
diff -uNr gaim-openq.orig/files/patch-src-send_file.c gaim-openq/files/patch-src-send_file.c
--- gaim-openq.orig/files/patch-src-send_file.c Wed Apr 20 23:18:47 2005
+++ gaim-openq/files/patch-src-send_file.c Thu Aug 18 18:50:55 2005
@@ -1,10 +1,56 @@
---- src/send_file.c.orig Thu Dec 23 06:22:22 2004
-+++ src/send_file.c Wed Apr 20 13:16:55 2005
-@@ -22,6 +22,7 @@
+--- src/send_file.c.orig Thu Dec 23 18:22:22 2004
++++ src/send_file.c Thu Aug 18 18:18:11 2005
+@@ -22,6 +22,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
++#include <sys/types.h>
+#include <sys/socket.h>
#include <network.h>
#include "send_file.h"
+@@ -203,8 +205,8 @@
+ info = (ft_info *) xfer->data;
+
+ qq_xfer_close_file(xfer);
+- if (info->dest_fp != NULL) {
+- fclose(info->dest_fp);
++ if (info->un.dest_fp != NULL) {
++ fclose(info->un.dest_fp);
+ gaim_debug(GAIM_DEBUG_INFO, "QQ", "file closed\n");
+ }
+ if (info->major_fd != 0) {
+@@ -499,6 +501,8 @@
+ guint8 *cursor, *raw_data;
+ gint packet_len, bytes;
+ ft_info *info;
++ guint16 minor_port;
++ guint32 real_ip;
+
+ g_return_if_fail (gc != NULL && gc->proto_data != NULL);
+ qd = (qq_data *) gc->proto_data;
+@@ -506,8 +510,6 @@
+
+ gaim_debug(GAIM_DEBUG_INFO, "QQ", "I've accepted the file transfer request from %d\n", to_uid);
+ _qq_xfer_init_socket(qd->xfer);
+- guint16 minor_port;
+- guint32 real_ip;
+
+ packet_len = 79;
+ raw_data = g_newa (guint8, packet_len);
+@@ -809,6 +811,7 @@
+ GaimXfer *xfer;
+ gchar *sender_name;
+ ft_info *info;
++ gchar **fileinfo;
+
+ g_return_if_fail (gc != NULL && data != NULL && data_len != 0);
+ qd = (qq_data *) gc->proto_data;
+@@ -834,7 +837,6 @@
+ GAIM_XFER_RECEIVE,
+ sender_name);
+
+- gchar **fileinfo;
+ fileinfo = g_strsplit(data + 81 + 12, "\x1f", 2);
+ g_return_if_fail (fileinfo != NULL && fileinfo[0] != NULL && fileinfo[1] != NULL);
+ gaim_xfer_set_filename(xfer, fileinfo[0]);
diff -uNr gaim-openq.orig/files/patch-src-send_file.h gaim-openq/files/patch-src-send_file.h
--- gaim-openq.orig/files/patch-src-send_file.h Thu Jan 1 12:00:00 1970
+++ gaim-openq/files/patch-src-send_file.h Thu Aug 18 18:50:13 2005
@@ -0,0 +1,11 @@
+--- src/send_file.h.orig Thu Aug 18 18:49:04 2005
++++ src/send_file.h Thu Aug 18 17:55:56 2005
+@@ -40,7 +40,7 @@
+ union {
+ FILE *dest_fp;
+ guint8 *buffer;
+- };
++ } un;
+ gboolean use_major;
+ } ft_info;
+
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list