Thu Jun 18 10:14:54 2020 UTC ()
games/doomlegacy: Build fix for SunOS

Use master server TCP patches for UDP too.


(micha)
diff -r1.7 -r1.8 pkgsrc/games/doomlegacy/Makefile
diff -r1.6 -r1.7 pkgsrc/games/doomlegacy/distinfo
diff -r0 -r1.3 pkgsrc/games/doomlegacy/patches/patch-src_i__tcp.c

cvs diff -r1.7 -r1.8 pkgsrc/games/doomlegacy/Makefile (expand / switch to unified diff)

--- pkgsrc/games/doomlegacy/Makefile 2020/06/17 16:16:57 1.7
+++ pkgsrc/games/doomlegacy/Makefile 2020/06/18 10:14:54 1.8
@@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
1# $NetBSD: Makefile,v 1.7 2020/06/17 16:16:57 micha Exp $ 1# $NetBSD: Makefile,v 1.8 2020/06/18 10:14:54 micha Exp $
2 2
3VERS= 1.48.4 3VERS= 1.48.4
4PKGNAME= doomlegacy-${VERS} 4PKGNAME= doomlegacy-${VERS}
5PKGREVISION= 2 5PKGREVISION= 3
6CATEGORIES= games 6CATEGORIES= games
7MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=doomlegacy/} 7MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=doomlegacy/}
8DISTNAME= ${PKGNAME_NOREV:S/-/_/}_source 8DISTNAME= ${PKGNAME_NOREV:S/-/_/}_source
9DISTFILES= ${DEFAULT_DISTFILES} doomlegacy_${VERS}_common.zip 9DISTFILES= ${DEFAULT_DISTFILES} doomlegacy_${VERS}_common.zip
10EXTRACT_SUFX= .tar.bz2 10EXTRACT_SUFX= .tar.bz2
11 11
12MAINTAINER= micha@NetBSD.org 12MAINTAINER= micha@NetBSD.org
13HOMEPAGE= http://doomlegacy.sourceforge.net/ 13HOMEPAGE= http://doomlegacy.sourceforge.net/
14COMMENT= The legacy of Doom 14COMMENT= The legacy of Doom
15LICENSE= gnu-gpl-v2 15LICENSE= gnu-gpl-v2
16 16
17# Tested on Linux/ppc (32bit Big Endian) and NetBSD/amd64 (64bit Little Endian) 17# Tested on Linux/ppc (32bit Big Endian) and NetBSD/amd64 (64bit Little Endian)
18# Untested: In general the source code has support for the other listed OS too 18# Untested: In general the source code has support for the other listed OS too

cvs diff -r1.6 -r1.7 pkgsrc/games/doomlegacy/distinfo (expand / switch to unified diff)

--- pkgsrc/games/doomlegacy/distinfo 2020/06/17 16:16:57 1.6
+++ pkgsrc/games/doomlegacy/distinfo 2020/06/18 10:14:54 1.7
@@ -1,19 +1,20 @@ @@ -1,19 +1,20 @@
1$NetBSD: distinfo,v 1.6 2020/06/17 16:16:57 micha Exp $ 1$NetBSD: distinfo,v 1.7 2020/06/18 10:14:54 micha Exp $
2 2
3SHA1 (doomlegacy_1.48.4_common.zip) = 14aed4c0091e8c61f46a2303f9316659ab6c0483 3SHA1 (doomlegacy_1.48.4_common.zip) = 14aed4c0091e8c61f46a2303f9316659ab6c0483
4RMD160 (doomlegacy_1.48.4_common.zip) = cca61af6bdda1003032ee117129e07596c8bbfcf 4RMD160 (doomlegacy_1.48.4_common.zip) = cca61af6bdda1003032ee117129e07596c8bbfcf
5SHA512 (doomlegacy_1.48.4_common.zip) = f41830b6d3ba7f30d020e887193fedf502d9b0b260bb53f78e888ce4985dfc2a8b744b5add86813e135c9a0ed65c9be42da64437976b7a85992bcc45bbeeb462 5SHA512 (doomlegacy_1.48.4_common.zip) = f41830b6d3ba7f30d020e887193fedf502d9b0b260bb53f78e888ce4985dfc2a8b744b5add86813e135c9a0ed65c9be42da64437976b7a85992bcc45bbeeb462
6Size (doomlegacy_1.48.4_common.zip) = 1004978 bytes 6Size (doomlegacy_1.48.4_common.zip) = 1004978 bytes
7SHA1 (doomlegacy_1.48.4_source.tar.bz2) = f787c653ac4d097de702c72c9b30aed9b4b308a1 7SHA1 (doomlegacy_1.48.4_source.tar.bz2) = f787c653ac4d097de702c72c9b30aed9b4b308a1
8RMD160 (doomlegacy_1.48.4_source.tar.bz2) = 1e2a435e28f84a1578041feec4b98770774b2287 8RMD160 (doomlegacy_1.48.4_source.tar.bz2) = 1e2a435e28f84a1578041feec4b98770774b2287
9SHA512 (doomlegacy_1.48.4_source.tar.bz2) = a63a38135f902b7ddfedfbc117ccf9446dba5b1da918189de560722b4fe2afae5f5a0493f9571b5817f95aed96f52fecd32d46c101da5141596cf062d55cec57 9SHA512 (doomlegacy_1.48.4_source.tar.bz2) = a63a38135f902b7ddfedfbc117ccf9446dba5b1da918189de560722b4fe2afae5f5a0493f9571b5817f95aed96f52fecd32d46c101da5141596cf062d55cec57
10Size (doomlegacy_1.48.4_source.tar.bz2) = 2410187 bytes 10Size (doomlegacy_1.48.4_source.tar.bz2) = 2410187 bytes
11SHA1 (patch-src_Makefile) = 65a6380a5d117333f95a8265b55869244002587c 11SHA1 (patch-src_Makefile) = 65a6380a5d117333f95a8265b55869244002587c
12SHA1 (patch-src_am__map.c) = 647bcba2374cfa7038646e0c053636b43caaf33a 12SHA1 (patch-src_am__map.c) = 647bcba2374cfa7038646e0c053636b43caaf33a
13SHA1 (patch-src_doomdata.h) = 2fd95b5db154b05ba88597b20c45146339db4622 13SHA1 (patch-src_doomdata.h) = 2fd95b5db154b05ba88597b20c45146339db4622
14SHA1 (patch-src_dstrings.c) = e1fc8bdcb83efa18690d95c56e3ea7c94a388a50 14SHA1 (patch-src_dstrings.c) = e1fc8bdcb83efa18690d95c56e3ea7c94a388a50
 15SHA1 (patch-src_i__tcp.c) = 13c8bd14cae31b078154f4ef0d2353cf089234b8
15SHA1 (patch-src_mserv.c) = 685ca5028740428ef2579025ca8673d8da526ebe 16SHA1 (patch-src_mserv.c) = 685ca5028740428ef2579025ca8673d8da526ebe
16SHA1 (patch-src_p__local.h) = e429f2ce5d60dd538bc5e796847b53ae72604b33 17SHA1 (patch-src_p__local.h) = e429f2ce5d60dd538bc5e796847b53ae72604b33
17SHA1 (patch-src_p__setup.c) = c3766f924b05655b8d9d17d4686dde9a83239e0a 18SHA1 (patch-src_p__setup.c) = c3766f924b05655b8d9d17d4686dde9a83239e0a
18SHA1 (patch-src_r__defs.h) = 9211ae6db72f0288f38449b18c8c252f42686405 19SHA1 (patch-src_r__defs.h) = 9211ae6db72f0288f38449b18c8c252f42686405
19SHA1 (patch-src_t__prepro.h) = 768fc3a87665a75a85ff4ff88b53091b13eab55e 20SHA1 (patch-src_t__prepro.h) = 768fc3a87665a75a85ff4ff88b53091b13eab55e

File Added: pkgsrc/games/doomlegacy/patches/Attic/patch-src_i__tcp.c
$NetBSD: patch-src_i__tcp.c,v 1.3 2020/06/18 10:14:54 micha Exp $

Use native inet_aton() on Solaris.
Use portable fcntl() instead of ioctl() for non-blocking mode by default.

--- src/i_tcp.c.orig	2020-05-10 22:05:16.000000000 +0000
+++ src/i_tcp.c
@@ -123,7 +123,7 @@
 
 #ifdef __OS2__
   // sys/types.h is also included unconditionally by doomincl.h
-# include <sys/types.h>
+# include <sys/types.h>  // [MB] 2020-06-18: Maybe required for old Unix too
 # include <sys/time.h>
 #endif // __OS2__
 
@@ -146,6 +146,7 @@
 // non-windows includes
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <fcntl.h>       // [MB] 2020-06-18: For fcntl()
 #include <unistd.h>
 #include <netdb.h>
 #include <sys/ioctl.h>
@@ -355,7 +356,9 @@ byte  generic_hashaddr( mysockaddr_t *a 
 // htons: host to net byte order
 // ntohs: net to host byte order
 
-#if defined( WIN32) || defined( __OS2__) || defined( SOLARIS)
+// [MB] 2020-06-18: Use native inet_aton() on Solaris
+// Solaris has inet_aton() in libresolv since version 2.6 from 1997
+#if defined( WIN32) || defined( __OS2__) // || defined( SOLARIS)
 // [WDJ] Also defined in mserv.c, but too small, will be inlined anyway.
 static inline
 int inet_aton(const char *hostname,
@@ -1006,7 +1009,20 @@ retry_bind:
     CONS_Printf("Network port: %d\n", my_sock_port);
 
     // make it non blocking
+#ifndef LINUX
     ioctl (s, FIONBIO, &trueval);
+#else
+    // [MB] 2020-06-18: Use portable POSIX way to enable non-blocking mode
+    // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
+    {
+        int res = fcntl(s, F_SETFL, O_NONBLOCK);
+        if(-1 == res)
+        {
+            I_SoftError("UDP_Socket: Switching to non-blocking mode failed: %s\n", strerror(errno));
+            goto close_socket;
+        }
+    }
+#endif
 
     // make it broadcastable
 #ifdef LINUX