Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/games/doomlegacy games/doomlegacy: Build fix for SunOS
details: https://anonhg.NetBSD.org/pkgsrc/rev/9418c8407975
branches: trunk
changeset: 434522:9418c8407975
user: micha <micha%pkgsrc.org@localhost>
date: Thu Jun 18 10:14:54 2020 +0000
description:
games/doomlegacy: Build fix for SunOS
Use master server TCP patches for UDP too.
diffstat:
games/doomlegacy/Makefile | 4 +-
games/doomlegacy/distinfo | 3 +-
games/doomlegacy/patches/patch-src_i__tcp.c | 56 +++++++++++++++++++++++++++++
3 files changed, 60 insertions(+), 3 deletions(-)
diffs (91 lines):
diff -r 069897c3db00 -r 9418c8407975 games/doomlegacy/Makefile
--- a/games/doomlegacy/Makefile Thu Jun 18 10:07:35 2020 +0000
+++ b/games/doomlegacy/Makefile Thu Jun 18 10:14:54 2020 +0000
@@ -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 -r 069897c3db00 -r 9418c8407975 games/doomlegacy/distinfo
--- a/games/doomlegacy/distinfo Thu Jun 18 10:07:35 2020 +0000
+++ b/games/doomlegacy/distinfo Thu Jun 18 10:14:54 2020 +0000
@@ -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_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 -r 069897c3db00 -r 9418c8407975 games/doomlegacy/patches/patch-src_i__tcp.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/games/doomlegacy/patches/patch-src_i__tcp.c Thu Jun 18 10:14:54 2020 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index