aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2011-09-03 23:26:37 +0200
committerMemphiz <memphis@machzwo.de>2011-09-03 23:26:37 +0200
commitfb03653ff274c881b68231441557247d970900ff (patch)
treedee8d5b87422390eaf7ecdeb6b1ade288d4e7a97 /tools
parentc1d2bb6e7070c636a7919da5f3f797d95ea58126 (diff)
[osx/ios/atv2] - add lib-gpgerror, libgcrypt and afpnfs-ng to darwin depends
Diffstat (limited to 'tools')
-rw-r--r--tools/darwin/depends/Makefile.in1
-rw-r--r--tools/darwin/depends/afpfs-ng/02-pointer.patch280
-rw-r--r--tools/darwin/depends/afpfs-ng/03-include.patch13
-rw-r--r--tools/darwin/depends/afpfs-ng/04-boxee1.patch25
-rw-r--r--tools/darwin/depends/afpfs-ng/05-boxee2.patch89
-rw-r--r--tools/darwin/depends/afpfs-ng/06-boxee3.patch141
-rw-r--r--tools/darwin/depends/afpfs-ng/07-boxee4.patch27
-rw-r--r--tools/darwin/depends/afpfs-ng/08-boxee5.patch11
-rw-r--r--tools/darwin/depends/afpfs-ng/09-boxee6.patch24
-rw-r--r--tools/darwin/depends/afpfs-ng/Makefile11
-rw-r--r--tools/darwin/depends/lib-gpgerror/Makefile41
11 files changed, 662 insertions, 1 deletions
diff --git a/tools/darwin/depends/Makefile.in b/tools/darwin/depends/Makefile.in
index 2bc5cdf0d9..79e9810c10 100644
--- a/tools/darwin/depends/Makefile.in
+++ b/tools/darwin/depends/Makefile.in
@@ -11,6 +11,7 @@ SUBDIRS := \
libass libcdio libsamplerate librtmp libcrystalhd libnfs \
libGLEW libsdl libsdl_mixer libsdl_image \
libmicrohttpd libmodplug libbluray libyajl \
+ libgpg-error libgcrypt afpfs-ng \
libplist \
samba python26 mysqlclient boost \
diff --git a/tools/darwin/depends/afpfs-ng/02-pointer.patch b/tools/darwin/depends/afpfs-ng/02-pointer.patch
new file mode 100644
index 0000000000..b47b834451
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/02-pointer.patch
@@ -0,0 +1,280 @@
+diff -up afpfs-ng-0.8.1/cmdline/getstatus.c.pointer afpfs-ng-0.8.1/cmdline/getstatus.c
+--- afpfs-ng-0.8.1/cmdline/getstatus.c.pointer 2011-06-14 17:06:35.000000000 +0200
++++ afpfs-ng-0.8.1/cmdline/getstatus.c 2011-06-14 17:07:25.000000000 +0200
+@@ -1,4 +1,5 @@
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <pthread.h>
+
+diff -up afpfs-ng-0.8.1/fuse/client.c.pointer afpfs-ng-0.8.1/fuse/client.c
+--- afpfs-ng-0.8.1/fuse/client.c.pointer 2008-03-08 03:44:16.000000000 +0100
++++ afpfs-ng-0.8.1/fuse/client.c 2011-06-14 17:02:15.000000000 +0200
+@@ -61,8 +61,9 @@ static int start_afpfsd(void)
+ snprintf(filename, PATH_MAX,
+ "/usr/local/bin/%s",AFPFSD_FILENAME);
+ if (access(filename,X_OK)) {
+- snprintf(filename, "/usr/bin/%s",
++ snprintf(filename, sizeof(filename), "/usr/bin/%s",
+ AFPFSD_FILENAME);
++ filename[sizeof(filename) - 1] = 0;
+ if (access(filename,X_OK)) {
+ printf("Could not find server (%s)\n",
+ filename);
+diff -up afpfs-ng-0.8.1/fuse/fuse_int.c.pointer afpfs-ng-0.8.1/fuse/fuse_int.c
+--- afpfs-ng-0.8.1/fuse/fuse_int.c.pointer 2008-03-02 06:06:24.000000000 +0100
++++ afpfs-ng-0.8.1/fuse/fuse_int.c 2011-06-14 17:02:15.000000000 +0200
+@@ -197,7 +197,7 @@ static int fuse_open(const char *path, s
+ ret = ml_open(volume,path,flags,&fp);
+
+ if (ret==0)
+- fi->fh=(void *) fp;
++ fi->fh=(unsigned long) fp;
+
+ return ret;
+ }
+diff -up afpfs-ng-0.8.1/include/afp.h.pointer afpfs-ng-0.8.1/include/afp.h
+--- afpfs-ng-0.8.1/include/afp.h.pointer 2008-03-08 17:08:18.000000000 +0100
++++ afpfs-ng-0.8.1/include/afp.h 2011-06-14 17:02:15.000000000 +0200
+@@ -370,7 +370,7 @@ int afp_unmount_all_volumes(struct afp_s
+
+ int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
+
+-int afp_closedt(struct afp_server * server, unsigned short * refnum);
++int afp_closedt(struct afp_server * server, unsigned short refnum);
+
+ int afp_getcomment(struct afp_volume *volume, unsigned int did,
+ const char * pathname, struct afp_comment * comment);
+diff -up afpfs-ng-0.8.1/include/utils.h.pointer afpfs-ng-0.8.1/include/utils.h
+--- afpfs-ng-0.8.1/include/utils.h.pointer 2008-02-18 04:33:58.000000000 +0100
++++ afpfs-ng-0.8.1/include/utils.h 2011-06-14 17:02:15.000000000 +0200
+@@ -8,8 +8,8 @@
+ #define hton64(x) (x)
+ #define ntoh64(x) (x)
+ #else /* BYTE_ORDER == BIG_ENDIAN */
+-#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
+- (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
++#define hton64(x) ((u_int64_t) (htonl((((unsigned long long)(x)) >> 32) & 0xffffffffLL)) | \
++ (u_int64_t) ((htonl((unsigned long long)(x)) & 0xffffffffLL) << 32))
+ #define ntoh64(x) (hton64(x))
+ #endif /* BYTE_ORDER == BIG_ENDIAN */
+
+diff -up afpfs-ng-0.8.1/lib/afp_url.c.pointer afpfs-ng-0.8.1/lib/afp_url.c
+--- afpfs-ng-0.8.1/lib/afp_url.c.pointer 2008-03-04 21:16:49.000000000 +0100
++++ afpfs-ng-0.8.1/lib/afp_url.c 2011-06-14 17:02:15.000000000 +0200
+@@ -33,7 +33,7 @@ static int check_port(char * port)
+ static int check_uamname(const char * uam)
+ {
+ char * p;
+- for (p=uam;*p;p++) {
++ for (p=(char *)uam;*p;p++) {
+ if (*p==' ') continue;
+ if ((*p<'A') || (*p>'z')) return -1;
+ }
+@@ -188,7 +188,7 @@ int afp_parse_url(struct afp_url * url,
+ return -1;
+
+ }
+- if (p==NULL) p=toparse;
++ if (p==NULL) p=(char *)toparse;
+
+ /* Now split on the first / */
+ if (sscanf(p,"%[^/]/%[^$]",
+diff -up afpfs-ng-0.8.1/lib/did.c.pointer afpfs-ng-0.8.1/lib/did.c
+--- afpfs-ng-0.8.1/lib/did.c.pointer 2008-02-18 04:39:17.000000000 +0100
++++ afpfs-ng-0.8.1/lib/did.c 2011-06-14 17:02:15.000000000 +0200
+@@ -226,7 +226,7 @@ int get_dirid(struct afp_volume * volume
+
+
+ /* Go to the end of last known entry */
+- p=path+(p-copy);
++ p=(char *)path+(p-copy);
+ p2=p;
+
+ while ((p=strchr(p+1,'/'))) {
+diff -up afpfs-ng-0.8.1/lib/dsi.c.pointer afpfs-ng-0.8.1/lib/dsi.c
+--- afpfs-ng-0.8.1/lib/dsi.c.pointer 2008-02-18 04:53:03.000000000 +0100
++++ afpfs-ng-0.8.1/lib/dsi.c 2011-06-14 17:02:15.000000000 +0200
+@@ -474,7 +474,7 @@ void dsi_getstatus_reply(struct afp_serv
+ }
+ server->flags=ntohs(reply1->flags);
+
+- p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1));
++ p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1));
+ p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1;
+
+ /* Now work our way through the variable bits */
+@@ -757,7 +757,7 @@ gotenough:
+ printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
+ #endif
+ ret = read(server->fd, (void *)
+- (((unsigned int) server->incoming_buffer)+server->data_read),
++ (((unsigned long) server->incoming_buffer)+server->data_read),
+ amount_to_read);
+ if (ret<0) return -1;
+ if (ret==0) {
+diff -up afpfs-ng-0.8.1/lib/loop.c.pointer afpfs-ng-0.8.1/lib/loop.c
+--- afpfs-ng-0.8.1/lib/loop.c.pointer 2008-02-18 04:40:11.000000000 +0100
++++ afpfs-ng-0.8.1/lib/loop.c 2011-06-14 17:02:15.000000000 +0200
+@@ -25,7 +25,7 @@
+ static unsigned char exit_program=0;
+
+ static pthread_t ending_thread;
+-static pthread_t main_thread = NULL;
++static pthread_t main_thread = (pthread_t)NULL;
+
+ static int loop_started=0;
+ static pthread_cond_t loop_started_condition;
+diff -up afpfs-ng-0.8.1/lib/lowlevel.c.pointer afpfs-ng-0.8.1/lib/lowlevel.c
+--- afpfs-ng-0.8.1/lib/lowlevel.c.pointer 2008-02-20 02:33:17.000000000 +0100
++++ afpfs-ng-0.8.1/lib/lowlevel.c 2011-06-14 17:02:15.000000000 +0200
+@@ -582,7 +582,7 @@ int ll_getattr(struct afp_volume * volum
+ if (volume->server->using_version->av_number>=30)
+ stbuf->st_mode |= fp.unixprivs.permissions;
+ else
+- set_nonunix_perms(stbuf,&fp);
++ set_nonunix_perms(&stbuf->st_mode,&fp);
+
+ stbuf->st_uid=fp.unixprivs.uid;
+ stbuf->st_gid=fp.unixprivs.gid;
+diff -up afpfs-ng-0.8.1/lib/midlevel.c.pointer afpfs-ng-0.8.1/lib/midlevel.c
+--- afpfs-ng-0.8.1/lib/midlevel.c.pointer 2008-03-08 17:08:18.000000000 +0100
++++ afpfs-ng-0.8.1/lib/midlevel.c 2011-06-14 17:02:15.000000000 +0200
+@@ -713,7 +713,7 @@ int ml_write(struct afp_volume * volume,
+ {
+
+ int ret,err=0;
+- int totalwritten = 0;
++ size_t totalwritten = 0;
+ uint64_t sizetowrite, ignored;
+ unsigned char flags = 0;
+ unsigned int max_packet_size=volume->server->tx_quantum;
+diff -up afpfs-ng-0.8.1/lib/proto_attr.c.pointer afpfs-ng-0.8.1/lib/proto_attr.c
+--- afpfs-ng-0.8.1/lib/proto_attr.c.pointer 2008-01-30 05:37:58.000000000 +0100
++++ afpfs-ng-0.8.1/lib/proto_attr.c 2011-06-14 17:02:15.000000000 +0200
+@@ -166,7 +166,7 @@ int afp_getextattr(struct afp_volume * v
+ copy_path(server,p,pathname,strlen(pathname));
+ unixpath_to_afppath(server,p);
+ p2=p+sizeof_path_header(server)+strlen(pathname);
+- if (((unsigned int ) p2) & 0x1) p2++;
++ if (((unsigned long) p2) & 0x1) p2++;
+ req2=(void *) p2;
+
+ req2->len=htons(namelen);
+diff -up afpfs-ng-0.8.1/lib/proto_desktop.c.pointer afpfs-ng-0.8.1/lib/proto_desktop.c
+--- afpfs-ng-0.8.1/lib/proto_desktop.c.pointer 2008-02-18 04:44:11.000000000 +0100
++++ afpfs-ng-0.8.1/lib/proto_desktop.c 2011-06-14 17:02:15.000000000 +0200
+@@ -168,7 +168,7 @@ int afp_getcomment_reply(struct afp_serv
+ return 0;
+ }
+
+-int afp_closedt(struct afp_server * server, unsigned short * refnum)
++int afp_closedt(struct afp_server * server, unsigned short refnum)
+ {
+ struct {
+ struct dsi_header dsi_header __attribute__((__packed__));
+diff -up afpfs-ng-0.8.1/lib/proto_directory.c.pointer afpfs-ng-0.8.1/lib/proto_directory.c
+--- afpfs-ng-0.8.1/lib/proto_directory.c.pointer 2008-02-19 03:39:29.000000000 +0100
++++ afpfs-ng-0.8.1/lib/proto_directory.c 2011-06-14 17:02:15.000000000 +0200
+@@ -248,6 +248,7 @@ int afp_enumerate_reply(struct afp_serve
+
+ return 0;
+ }
++
+ int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other)
+ {
+
+@@ -266,8 +267,7 @@ int afp_enumerateext2_reply(struct afp_s
+ char * p = buf + sizeof(*reply);
+ int i;
+ char *max=buf+size;
+- struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL;
+- void ** x = other;
++ struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other;
+
+ if (reply->dsi_header.return_code.error_code) {
+ return reply->dsi_header.return_code.error_code;
+diff -up afpfs-ng-0.8.1/lib/proto_map.c.pointer afpfs-ng-0.8.1/lib/proto_map.c
+--- afpfs-ng-0.8.1/lib/proto_map.c.pointer 2008-01-30 05:37:59.000000000 +0100
++++ afpfs-ng-0.8.1/lib/proto_map.c 2011-06-14 17:02:15.000000000 +0200
+@@ -122,7 +122,7 @@ int afp_mapid_reply(struct afp_server *s
+
+ if (reply->header.return_code.error_code!=kFPNoErr) return -1;
+
+- copy_from_pascal_two(name,&reply->name,255);
++ copy_from_pascal_two(name,reply->name,255);
+
+ return 0;
+ }
+diff -up afpfs-ng-0.8.1/lib/proto_session.c.pointer afpfs-ng-0.8.1/lib/proto_session.c
+--- afpfs-ng-0.8.1/lib/proto_session.c.pointer 2008-02-18 04:46:19.000000000 +0100
++++ afpfs-ng-0.8.1/lib/proto_session.c 2011-06-14 17:02:15.000000000 +0200
+@@ -39,7 +39,7 @@ int afp_getsessiontoken(struct afp_serve
+ switch (type) {
+ case kLoginWithTimeAndID:
+ case kReconnWithTimeAndID: {
+- uint32_t *p = (void *) (((unsigned int) request)+
++ uint32_t *p = (void *) (((unsigned long) request)+
+ sizeof(*request));
+
+ offset=sizeof(timestamp);
+@@ -63,7 +63,7 @@ int afp_getsessiontoken(struct afp_serve
+ goto error;
+ }
+
+- data=(void *) (((unsigned int) request)+sizeof(*request)+offset);
++ data=(void *) (((unsigned long) request)+sizeof(*request)+offset);
+ request->idlength=htonl(datalen);
+ request->pad=0;
+ request->type=htons(type);
+@@ -127,7 +127,7 @@ int afp_disconnectoldsession(struct afp_
+ if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL)
+ return -1;
+
+- token_data = request + sizeof(*request);
++ token_data = (char *)request + sizeof(*request);
+
+ request->type=htons(type);
+
+diff -up afpfs-ng-0.8.1/lib/uams.c.pointer afpfs-ng-0.8.1/lib/uams.c
+--- afpfs-ng-0.8.1/lib/uams.c.pointer 2008-01-04 04:52:44.000000000 +0100
++++ afpfs-ng-0.8.1/lib/uams.c 2011-06-14 17:02:15.000000000 +0200
+@@ -180,7 +180,7 @@ static int cleartxt_login(struct afp_ser
+ goto cleartxt_fail;
+
+ p += copy_to_pascal(p, username) + 1;
+- if ((int)p & 0x1)
++ if ((long)p & 0x1)
+ len--;
+ else
+ p++;
+@@ -230,7 +230,7 @@ static int cleartxt_passwd(struct afp_se
+ goto cleartxt_fail;
+
+ p += copy_to_pascal(p, username) + 1;
+- if ((int)p & 0x1)
++ if ((long)p & 0x1)
+ len--;
+ else
+ p++;
+@@ -580,7 +580,7 @@ static int dhx_login(struct afp_server *
+ if (ai == NULL)
+ goto dhx_noctx_fail;
+ d += copy_to_pascal(ai, username) + 1;
+- if (((int)d) % 2)
++ if (((long)d) % 2)
+ d++;
+ else
+ ai_len--;
+diff -up afpfs-ng-0.8.1/lib/utils.c.pointer afpfs-ng-0.8.1/lib/utils.c
+--- afpfs-ng-0.8.1/lib/utils.c.pointer 2008-02-18 04:53:37.000000000 +0100
++++ afpfs-ng-0.8.1/lib/utils.c 2011-06-14 17:02:15.000000000 +0200
+@@ -196,7 +196,7 @@ int invalid_filename(struct afp_server *
+ maxlen=255;
+
+
+- p=filename+1;
++ p=(char *)filename+1;
+ while ((q=strchr(p,'/'))) {
+ if (q>p+maxlen)
+ return 1;
diff --git a/tools/darwin/depends/afpfs-ng/03-include.patch b/tools/darwin/depends/afpfs-ng/03-include.patch
new file mode 100644
index 0000000000..e17a1e35af
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/03-include.patch
@@ -0,0 +1,13 @@
+--- afpfs-ng-0.8.1/include/afp.h 2011-08-25 20:58:17.000000000 +0200
++++ afpfs-ng-0.8.1/include/afp.h 2011-08-25 21:15:14.000000000 +0200
+@@ -7,8 +7,8 @@
+ #include <netdb.h>
+ #include <sys/statvfs.h>
+ #include <pwd.h>
+-#include <afp_protocol.h>
+-#include <libafpclient.h>
++#include <afp/afp_protocol.h>
++#include <afp/libafpclient.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
diff --git a/tools/darwin/depends/afpfs-ng/04-boxee1.patch b/tools/darwin/depends/afpfs-ng/04-boxee1.patch
new file mode 100644
index 0000000000..da0e587fd7
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/04-boxee1.patch
@@ -0,0 +1,25 @@
+--- afpfs-ng-0.8.1/include/dsi.h 2008-02-18 04:33:24.000000000 +0100
++++ afpfs-ng-0.8.1/include/dsi.h 2011-08-26 21:33:33.000000000 +0200
+@@ -6,13 +6,15 @@
+
+ struct dsi_request
+ {
+- unsigned short requestid;
+- unsigned char subcommand;
+- void * other;
+- unsigned char wait;
+- pthread_cond_t condition_cond;
+- struct dsi_request * next;
+- int return_code;
++ unsigned short requestid;
++ unsigned char subcommand;
++ void * other;
++ int wait;
++ int done_waiting;
++ pthread_cond_t waiting_cond;
++ pthread_mutex_t waiting_mutex;
++ struct dsi_request * next;
++ int return_code;
+ };
+
+ int dsi_receive(struct afp_server * server, void * data, int size);
diff --git a/tools/darwin/depends/afpfs-ng/05-boxee2.patch b/tools/darwin/depends/afpfs-ng/05-boxee2.patch
new file mode 100644
index 0000000000..50250bc0af
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/05-boxee2.patch
@@ -0,0 +1,89 @@
+--- afpfs-ng-0.8.1/lib/afp.c 2008-03-08 03:44:16.000000000 +0100
++++ afpfs-ng-0.8.1/lib/afp.c 2011-08-26 21:33:33.000000000 +0200
+@@ -68,7 +68,7 @@
+ afp_getsessiontoken_reply,afp_blank_reply, NULL, NULL,
+ afp_enumerateext2_reply, NULL, NULL, NULL, /*64 - 71 */
+ afp_listextattrs_reply, NULL, NULL, NULL,
+- afp_blank_reply, NULL, NULL, NULL, /*72 - 79 */
++ afp_blank_reply, NULL, afp_blank_reply, afp_blank_reply, /*72 - 79 */
+
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+@@ -320,8 +320,16 @@
+
+ struct dsi_request * p;
+ struct afp_server *s2;
++
++
++ if (s==NULL)
++ goto out;
++
+ for (p=s->command_requests;p;p=p->next) {
+- pthread_cond_signal(&p->condition_cond);
++ pthread_mutex_lock(&p->waiting_mutex);
++ p->done_waiting=1;
++ pthread_cond_signal(&p->waiting_cond);
++ pthread_mutex_unlock(&p->waiting_mutex);
+ }
+
+ if (s==server_base) {
+@@ -354,7 +362,7 @@
+ s->exit_flag = 0;
+ s->path_encoding=kFPUTF8Name; /* This is a default */
+ s->next=NULL;
+- s->bufsize=2048;
++ s->bufsize=4096;
+ s->incoming_buffer=malloc(s->bufsize);
+
+ s->attention_quantum=AFP_DEFAULT_ATTENTION_QUANTUM;
+@@ -524,13 +532,14 @@
+ kFPVolCreateDateBit|kFPVolIDBit |
+ kFPVolNameBit;
+ char new_encoding;
++ int ret;
+
+ if (server->using_version->av_number>=30)
+ bitmap|= kFPVolNameBit|kFPVolBlockSizeBit;
+
+- switch (afp_volopen(volume,bitmap,
+- (strlen(volume->volpassword)>0) ? volume->volpassword : NULL))
+- {
++ ret = afp_volopen(volume,bitmap,
++ (strlen(volume->volpassword)>0) ? volume->volpassword : NULL);
++ switch(ret){
+ case kFPAccessDenied:
+ *l+=snprintf(mesg,max-*l,
+ "Incorrect volume password\n");
+@@ -544,6 +553,10 @@
+ *l+=snprintf(mesg,max-*l,
+ "Could not open volume\n");
+ goto error;
++ case ETIMEDOUT:
++ *l+=snprintf(mesg,max-*l,
++ "Timed out waiting to open volume\n");
++ goto error;
+ }
+
+ /* It is said that if a volume's encoding will be the same
+@@ -641,7 +654,6 @@
+ add_server(server);
+
+ add_fd_and_signal(server->fd);
+-
+ if (!full) {
+ return 0;
+ }
+@@ -649,10 +661,13 @@
+ /* Get the status, and calculate the transmit time. We use this to
+ * calculate our rx quantum. */
+ gettimeofday(&t1,NULL);
++
+ if ((error=dsi_getstatus(server))!=0)
+ goto error;
+ gettimeofday(&t2,NULL);
+
++ afp_server_identify(server);
++
+ if ((t2.tv_sec - t1.tv_sec) > 0)
+ server->tx_delay= (t2.tv_sec - t1.tv_sec) * 1000;
+ else
diff --git a/tools/darwin/depends/afpfs-ng/06-boxee3.patch b/tools/darwin/depends/afpfs-ng/06-boxee3.patch
new file mode 100644
index 0000000000..4b7c916da3
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/06-boxee3.patch
@@ -0,0 +1,141 @@
+--- afpfs-ng-0.8.1/lib/dsi.c 2011-08-26 17:27:16.000000000 +0200
++++ afpfs-ng-0.8.1/lib/dsi.c 2011-08-26 21:33:33.000000000 +0200
+@@ -64,7 +64,7 @@
+ rx.size=0;
+ dsi_setup_header(server,&header,DSI_DSIGetStatus);
+ /* We're intentionally ignoring the results */
+- ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),20,
++ ret=dsi_send(server,(char *) &header,sizeof(struct dsi_header),60,
+ 0,(void *) &rx);
+
+ free(rx.data);
+@@ -197,6 +197,7 @@
+ new_request->other=other;
+ new_request->wait=wait;
+ new_request->next=NULL;
++ new_request->done_waiting=0;
+
+ pthread_mutex_lock(&server->request_queue_mutex);
+ if (server->command_requests==NULL) {
+@@ -208,7 +209,8 @@
+ server->stats.requests_pending++;
+ pthread_mutex_unlock(&server->request_queue_mutex);
+
+- pthread_cond_init(&new_request->condition_cond,NULL);
++ pthread_cond_init(&new_request->waiting_cond,NULL);
++ pthread_mutex_init(&new_request->waiting_mutex,NULL);
+
+ if (server->connect_state==SERVER_STATE_DISCONNECTED) {
+ char mesg[1024];
+@@ -240,16 +242,12 @@
+ server->stats.tx_bytes+=size;
+ pthread_mutex_unlock(&server->send_mutex);
+
+- int tmpwait=new_request->wait;
+ #ifdef DEBUG_DSI
+ printf("=== Waiting for response for %d %s\n",
+ new_request->requestid,
+ afp_get_command_name(new_request->subcommand));
+ #endif
+- if (tmpwait<0) {
+-
+- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+- pthread_mutex_lock(&mutex);
++ if (new_request->wait<0) {
+
+ /* Wait forever */
+ #ifdef DEBUG_DSI
+@@ -258,14 +256,17 @@
+ afp_get_command_name(new_request->subcommand));
+ #endif
+
+- rc=pthread_cond_wait(
+- &new_request->condition_cond,
+- &mutex );
+- pthread_mutex_unlock(&mutex);
+-
+- } else if (tmpwait>0) {
+- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+- pthread_mutex_lock(&mutex);
++ pthread_mutex_lock(&new_request->waiting_mutex);
++
++ if (new_request->done_waiting==0)
++ rc=pthread_cond_wait(
++ &new_request->waiting_cond,
++ &new_request->waiting_mutex );
++
++ pthread_mutex_unlock(&new_request->waiting_mutex);
++
++ } else if (new_request->wait>0) {
++ /* wait for new_request->wait seconds */
+
+ #ifdef DEBUG_DSI
+ printf("=== Waiting for %d %s, for %ds\n",
+@@ -283,13 +284,15 @@
+ printf("=== Changing my mind, no longer waiting for %d\n",
+ new_request->requestid);
+ #endif
+- pthread_mutex_unlock(&mutex);
+ goto skip;
+ }
+- rc=pthread_cond_timedwait(
+- &new_request->condition_cond,
+- &mutex,&ts);
+- pthread_mutex_unlock(&mutex);
++ pthread_mutex_lock(&new_request->waiting_mutex);
++ if (new_request->done_waiting==0)
++ rc=pthread_cond_timedwait(
++ &new_request->waiting_cond,
++ &new_request->waiting_mutex,&ts);
++ pthread_mutex_unlock(&new_request->waiting_mutex);
++
+ if (rc==ETIMEDOUT) {
+ /* FIXME: should handle this case properly */
+ #ifdef DEBUG_DSI
+@@ -299,6 +302,7 @@
+ goto out;
+ }
+ } else {
++ /* Don't wait */
+ #ifdef DEBUG_DSI
+ printf("=== Skipping wait altogether for %d\n",new_request->requestid);
+ #endif
+@@ -474,7 +478,7 @@
+ }
+ server->flags=ntohs(reply1->flags);
+
+- p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1));
++ p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1));
+ p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1;
+
+ /* Now work our way through the variable bits */
+@@ -577,6 +581,7 @@
+ unsigned char mins=0;
+ unsigned char checkmessage=0;
+
++ memset(mesg,0,AFP_LOGINMESG_LEN);
+
+ /* The logic here's undocumented. If we get an attention packet and
+ there's no flag, then go check the message. Also, go check the
+@@ -757,7 +762,7 @@
+ printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
+ #endif
+ ret = read(server->fd, (void *)
+- (((unsigned long) server->incoming_buffer)+server->data_read),
++ (((unsigned int) server->incoming_buffer)+server->data_read),
+ amount_to_read);
+ if (ret<0) return -1;
+ if (ret==0) {
+@@ -862,8 +867,11 @@
+ #ifdef DEBUG_DSI
+ printf("<<< Signalling %d, returning %d or %d\n",request->requestid,request->return_code,rc);
+ #endif
++ pthread_mutex_lock(&request->waiting_mutex);
+ request->wait=0;
+- pthread_cond_signal(&request->condition_cond);
++ request->done_waiting=1;
++ pthread_cond_signal(&request->waiting_cond);
++ pthread_mutex_unlock(&request->waiting_mutex);
+ } else {
+ dsi_remove_from_request_queue(server,request);
+ }
diff --git a/tools/darwin/depends/afpfs-ng/07-boxee4.patch b/tools/darwin/depends/afpfs-ng/07-boxee4.patch
new file mode 100644
index 0000000000..904925300a
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/07-boxee4.patch
@@ -0,0 +1,27 @@
+--- afpfs-ng-0.8.1/lib/identify.c 1970-01-01 01:00:00.000000000 +0100
++++ afpfs-ng-0.8.1/lib/identify.c 2011-08-26 21:33:33.000000000 +0200
+@@ -0,0 +1,24 @@
++#include <string.h>
++#include "afp.h"
++
++
++/*
++ * afp_server_identify()
++ *
++ * Identifies a server
++ *
++ * Right now, this only does identification using the machine_type
++ * given in getsrvrinfo, but this could later use mDNS to get
++ * more details.
++ */
++void afp_server_identify(struct afp_server * s)
++{
++ if (strcmp(s->machine_type,"Netatalk")==0)
++ s->server_type=AFPFS_SERVER_TYPE_NETATALK;
++ else if (strcmp(s->machine_type,"AirPort")==0)
++ s->server_type=AFPFS_SERVER_TYPE_AIRPORT;
++ else if (strcmp(s->machine_type,"Macintosh")==0)
++ s->server_type=AFPFS_SERVER_TYPE_MACINTOSH;
++ else
++ s->server_type=AFPFS_SERVER_TYPE_UNKNOWN;
++}
diff --git a/tools/darwin/depends/afpfs-ng/08-boxee5.patch b/tools/darwin/depends/afpfs-ng/08-boxee5.patch
new file mode 100644
index 0000000000..253fb05c97
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/08-boxee5.patch
@@ -0,0 +1,11 @@
+--- afpfs-ng-0.8.1/lib/Makefile.am 2008-02-18 04:34:32.000000000 +0100
++++ afpfs-ng-0.8.1/lib/Makefile.am 2011-08-26 21:33:33.000000000 +0200
+@@ -4,7 +4,7 @@
+
+ lib_LTLIBRARIES = libafpclient.la
+
+-libafpclient_la_SOURCES = afp.c codepage.c did.c dsi.c map_def.c uams.c uams_def.c unicode.c users.c utils.c resource.c log.c client.c server.c connect.c loop.c midlevel.c proto_attr.c proto_desktop.c proto_directory.c proto_files.c proto_fork.c proto_login.c proto_map.c proto_replyblock.c proto_server.c proto_volume.c proto_session.c afp_url.c status.c forklist.c debug.c lowlevel.c
++libafpclient_la_SOURCES = afp.c codepage.c did.c dsi.c map_def.c uams.c uams_def.c unicode.c users.c utils.c resource.c log.c client.c server.c connect.c loop.c midlevel.c proto_attr.c proto_desktop.c proto_directory.c proto_files.c proto_fork.c proto_login.c proto_map.c proto_replyblock.c proto_server.c proto_volume.c proto_session.c afp_url.c status.c forklist.c debug.c lowlevel.c identify.c
+
+ # libafpclient_la_LDFLAGS = -module -avoid-version
+
diff --git a/tools/darwin/depends/afpfs-ng/09-boxee6.patch b/tools/darwin/depends/afpfs-ng/09-boxee6.patch
new file mode 100644
index 0000000000..5ff9cac070
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/09-boxee6.patch
@@ -0,0 +1,24 @@
+--- afpfs-ng-0.8.1/lib/Makefile.am 2011-08-26 22:00:06.000000000 +0200
++++ afpfs-ng-0.8.1/lib/Makefile.am.new 2011-08-26 22:02:55.000000000 +0200
+@@ -1,4 +1,4 @@
+-
++afpdir = $(includedir)/afp
+
+ libafpclient_la_CFLAGS = -D_FILE_OFFSET_BITS=64 -I$(top_srcdir)/include @CFLAGS@
+
+@@ -8,4 +8,13 @@
+
+ # libafpclient_la_LDFLAGS = -module -avoid-version
+
+-
++dist_afp_HEADERS = \
++ ../include/afp.h \
++ ../include/afp_protocol.h \
++ ../include/codepage.h \
++ ../include/dsi.h \
++ ../include/libafpclient.h \
++ ../include/map_def.h \
++ ../include/midlevel.h \
++ ../include/uams_def.h \
++ ../include/utils.h
+\ No newline at end of file
diff --git a/tools/darwin/depends/afpfs-ng/Makefile b/tools/darwin/depends/afpfs-ng/Makefile
index 71718b752d..41223e976f 100644
--- a/tools/darwin/depends/afpfs-ng/Makefile
+++ b/tools/darwin/depends/afpfs-ng/Makefile
@@ -1,4 +1,5 @@
include ../Makefile.include
+include ../config.site.mk
# lib name, version
LIBNAME=afpfs-ng
@@ -23,6 +24,13 @@ $(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
$(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
echo $(SOURCE) > .gitignore
cd $(SOURCE); patch -p1 <../01-gcrypt.patch
+ cd $(SOURCE); patch -p1 <../02-pointer.patch
+ cd $(SOURCE); patch -p1 <../04-boxee1.patch
+ cd $(SOURCE); patch -p1 <../05-boxee2.patch
+ cd $(SOURCE); patch -p1 <../06-boxee3.patch
+ cd $(SOURCE); patch -p1 <../07-boxee4.patch
+ cd $(SOURCE); patch -p1 <../08-boxee5.patch
+ cd $(SOURCE); patch -p1 <../09-boxee6.patch
cd $(SOURCE); autoreconf -vif
cd $(SOURCE); $(CONFIGURE)
@@ -30,12 +38,13 @@ $(LIBDYLIB): $(SOURCE)
make -j $(MAKE_JOBS) -C $(SOURCE)
.installed:
+ cd $(SOURCE); patch -p1 <../03-include.patch
make -C $(SOURCE) install
touch $@
clean:
make -C $(SOURCE) clean
- rm-f .installed
+ rm -f .installed
distclean::
rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/lib-gpgerror/Makefile b/tools/darwin/depends/lib-gpgerror/Makefile
new file mode 100644
index 0000000000..ab033a0cac
--- /dev/null
+++ b/tools/darwin/depends/lib-gpgerror/Makefile
@@ -0,0 +1,41 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libgpg-error
+VERSION=1.10
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --with-libintl-prefix=$(PREFIX)/lib
+
+LIBDYLIB=$(SOURCE)/.libs/libgpg-error.dylib
+
+CLEAN_FILES=$(ARCHIVE) $(SOURCE)
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -j $(MAKE_JOBS) -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
+