Revision
130555
Author
jeremyhu@macports.org
Date
2014-12-31 17:37:15 -0800 (Wed, 31 Dec 2014)

Log Message

gpsd: Leopard build fix

Modified Paths

Added Paths

Diff

Modified: trunk/dports/net/gpsd/Portfile (130554 => 130555)


--- trunk/dports/net/gpsd/Portfile	2015-01-01 00:52:37 UTC (rev 130554)
+++ trunk/dports/net/gpsd/Portfile	2015-01-01 01:37:15 UTC (rev 130555)
@@ -31,7 +31,8 @@
 
 patchfiles              patch-SConstruct.diff \
                         patch-pkg-config.diff \
-                        patch-gps.h-string.diff
+                        patch-gps.h-string.diff \
+                        leopard-IPV6_TCLASS.patch
 
 use_configure           no
 

Added: trunk/dports/net/gpsd/files/leopard-IPV6_TCLASS.patch (0 => 130555)


--- trunk/dports/net/gpsd/files/leopard-IPV6_TCLASS.patch	                        (rev 0)
+++ trunk/dports/net/gpsd/files/leopard-IPV6_TCLASS.patch	2015-01-01 01:37:15 UTC (rev 130555)
@@ -0,0 +1,51 @@
+--- gpsd.c.orig	2014-12-31 17:27:26.000000000 -0800
++++ gpsd.c	2014-12-31 17:31:10.000000000 -0800
+@@ -149,11 +149,13 @@ static struct gps_context_t context;
+ static int sd_socket_count = 0;
+ #endif
+ 
+-/* work around the unfinished ipv6 implementation on hurd */
+-#ifdef __GNU__
++/* work around the unfinished ipv6 implementation on hurd and OSX <10.6 */
+ #ifndef IPV6_TCLASS
+-#define IPV6_TCLASS 61
+-#endif
++# if defined(__GNU__)
++#  define IPV6_TCLASS 61
++# elif defined(__APPLE__)
++#  define IPV6_TCLASS 36
++# endif
+ #endif
+ 
+ 
+@@ -451,10 +453,12 @@ static socket_t passivesock_af(int af, c
+ 		(void)close(s);
+ 		return -1;
+ 	    }
++#ifdef IPV6_TCLASS
+ 	    /* Set packet priority */
+ 	    if (setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &dscp, sizeof(dscp)) == -1)
+ 		gpsd_report(context.debug, LOG_WARN,
+ 			    "Warning: SETSOCKOPT TOS failed\n");
++#endif /* IPV6_TCLASS */
+ 	}
+ #endif /* S_SPLINT_S */
+ 	break;
+--- netlib.c.orig	2014-12-31 17:31:54.000000000 -0800
++++ netlib.c	2014-12-31 17:33:00.000000000 -0800
+@@ -23,6 +23,15 @@
+ #include "gpsd.h"
+ #include "sockaddr.h"
+ 
++/* work around the unfinished ipv6 implementation on hurd and OSX <10.6 */
++#ifndef IPV6_TCLASS
++# if defined(__GNU__)
++#  define IPV6_TCLASS 61
++# elif defined(__APPLE__)
++#  define IPV6_TCLASS 36
++# endif
++#endif
++
+ /*@-mustfreefresh -usedef@*/
+ socket_t netlib_connectsock(int af, const char *host, const char *service,
+ 			    const char *protocol)