summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authormicha <micha@pkgsrc.org>2020-06-18 10:14:54 +0000
committermicha <micha@pkgsrc.org>2020-06-18 10:14:54 +0000
commit25e2581335a15a6ce21e48e59d95135e76af2f67 (patch)
tree0c08354d456d9e3c3eab999449d02c18277f4ee7 /games
parentda1df4bcfef78171cad5733eacc9d6b40233eba2 (diff)
downloadpkgsrc-25e2581335a15a6ce21e48e59d95135e76af2f67.tar.gz
games/doomlegacy: Build fix for SunOS
Use master server TCP patches for UDP too.
Diffstat (limited to 'games')
-rw-r--r--games/doomlegacy/Makefile4
-rw-r--r--games/doomlegacy/distinfo3
-rw-r--r--games/doomlegacy/patches/patch-src_i__tcp.c56
3 files changed, 60 insertions, 3 deletions
diff --git a/games/doomlegacy/Makefile b/games/doomlegacy/Makefile
index e067edcdb4d..f55304bccba 100644
--- a/games/doomlegacy/Makefile
+++ b/games/doomlegacy/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2020/06/17 16:16:57 micha Exp $
+# $NetBSD: Makefile,v 1.8 2020/06/18 10:14:54 micha Exp $
VERS= 1.48.4
PKGNAME= doomlegacy-${VERS}
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=doomlegacy/}
DISTNAME= ${PKGNAME_NOREV:S/-/_/}_source
diff --git a/games/doomlegacy/distinfo b/games/doomlegacy/distinfo
index 75ad114904a..3b1bef4afe1 100644
--- a/games/doomlegacy/distinfo
+++ b/games/doomlegacy/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.6 2020/06/17 16:16:57 micha Exp $
+$NetBSD: distinfo,v 1.7 2020/06/18 10:14:54 micha Exp $
SHA1 (doomlegacy_1.48.4_common.zip) = 14aed4c0091e8c61f46a2303f9316659ab6c0483
RMD160 (doomlegacy_1.48.4_common.zip) = cca61af6bdda1003032ee117129e07596c8bbfcf
@@ -12,6 +12,7 @@ SHA1 (patch-src_Makefile) = 65a6380a5d117333f95a8265b55869244002587c
SHA1 (patch-src_am__map.c) = 647bcba2374cfa7038646e0c053636b43caaf33a
SHA1 (patch-src_doomdata.h) = 2fd95b5db154b05ba88597b20c45146339db4622
SHA1 (patch-src_dstrings.c) = e1fc8bdcb83efa18690d95c56e3ea7c94a388a50
+SHA1 (patch-src_i__tcp.c) = 13c8bd14cae31b078154f4ef0d2353cf089234b8
SHA1 (patch-src_mserv.c) = 685ca5028740428ef2579025ca8673d8da526ebe
SHA1 (patch-src_p__local.h) = e429f2ce5d60dd538bc5e796847b53ae72604b33
SHA1 (patch-src_p__setup.c) = c3766f924b05655b8d9d17d4686dde9a83239e0a
diff --git a/games/doomlegacy/patches/patch-src_i__tcp.c b/games/doomlegacy/patches/patch-src_i__tcp.c
new file mode 100644
index 00000000000..7049caa5c15
--- /dev/null
+++ b/games/doomlegacy/patches/patch-src_i__tcp.c
@@ -0,0 +1,56 @@
+$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