aboutsummaryrefslogtreecommitdiff
path: root/games/enigma
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2011-11-08 16:29:02 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2011-11-08 16:29:02 +0000
commitfd7de985ba051d1bdbe0a48bbaf3b38a4f194bb9 (patch)
treefa8196c3d02623121e2a788efd0e1c3712c00ac9 /games/enigma
parentbef975abdc467b39daffe91ffcd3804149309657 (diff)
downloadports-fd7de985ba051d1bdbe0a48bbaf3b38a4f194bb9.tar.gz
ports-fd7de985ba051d1bdbe0a48bbaf3b38a4f194bb9.zip
- Fix build with newer versions of enet
Submitted by: pawel
Notes
Notes: svn path=/head/; revision=285291
Diffstat (limited to 'games/enigma')
-rw-r--r--games/enigma/Makefile2
-rw-r--r--games/enigma/files/patch-src_client.cc25
-rw-r--r--games/enigma/files/patch-src_netgame.cc38
3 files changed, 64 insertions, 1 deletions
diff --git a/games/enigma/Makefile b/games/enigma/Makefile
index 12978c98adee..de532aae0c41 100644
--- a/games/enigma/Makefile
+++ b/games/enigma/Makefile
@@ -7,7 +7,7 @@
PORTNAME= enigma
PORTVERSION= 1.01
-PORTREVISION= 8
+PORTREVISION= 9
CATEGORIES= games
MASTER_SITES= BERLIOS/enigma-game
DISTNAME= ${PORTNAME}-${PORTVERSION}-64bit
diff --git a/games/enigma/files/patch-src_client.cc b/games/enigma/files/patch-src_client.cc
new file mode 100644
index 000000000000..94a4e7150f23
--- /dev/null
+++ b/games/enigma/files/patch-src_client.cc
@@ -0,0 +1,25 @@
+--- src/client.cc.orig 2011-11-07 19:49:08.000000000 +0100
++++ src/client.cc 2011-11-07 19:53:20.000000000 +0100
+@@ -128,6 +128,9 @@
+
+ m_network_host = enet_host_create (NULL,
+ 1 /* only allow 1 outgoing connection */,
++#if ENET_VERSION > 130
++ 0,
++#endif
+ 57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */,
+ 14400 / 8 /* 56K modem with 14 Kbps upstream bandwidth */);
+
+@@ -148,8 +151,11 @@
+ sv_address.port = 12345;
+
+ /* Initiate the connection, allocating the two channels 0 and 1. */
++#if ENET_VERSION > 130
++ m_server = enet_host_connect (m_network_host, &sv_address, 2, 0);
++#else
+ m_server = enet_host_connect (m_network_host, &sv_address, 2);
+-
++#endif
+ if (m_server == NULL) {
+ fprintf (stderr,
+ "No available peers for initiating an ENet connection.\n");
diff --git a/games/enigma/files/patch-src_netgame.cc b/games/enigma/files/patch-src_netgame.cc
new file mode 100644
index 000000000000..0301a3c6963c
--- /dev/null
+++ b/games/enigma/files/patch-src_netgame.cc
@@ -0,0 +1,38 @@
+--- src/netgame.cc.orig 2011-11-07 19:55:38.000000000 +0100
++++ src/netgame.cc 2011-11-07 19:59:07.000000000 +0100
+@@ -154,8 +154,11 @@
+
+ network_address.host = ENET_HOST_ANY;
+ network_address.port = 12345;
+-
++#if ENET_VERSION > 130
++ network_host = enet_host_create (&network_address, 1, 0, 0, 0);
++#else
+ network_host = enet_host_create (&network_address, 1, 0, 0);
++#endif
+ if (network_host == NULL) {
+ fprintf (stderr,
+ "SV: An error occurred while trying to create an ENet server host.\n");
+@@ -240,6 +243,9 @@
+ ENetHost *m_network_host;
+ m_network_host = enet_host_create (NULL,
+ 1 /* only allow 1 outgoing connection */,
++#if ENET_VERSION > 130
++ 0,
++#endif
+ 57600 / 8 /* 56K modem with 56 Kbps downstream bandwidth */,
+ 14400 / 8 /* 56K modem with 14 Kbps upstream bandwidth */);
+
+@@ -260,8 +266,11 @@
+
+ /* Initiate the connection, allocating the two channels 0 and 1. */
+ int numchannels = 2;
++#if ENET_VERSION > 130
++ m_server = enet_host_connect (m_network_host, &sv_address, numchannels, 0);
++#else
+ m_server = enet_host_connect (m_network_host, &sv_address, numchannels);
+-
++#endif
+ if (m_server == NULL) {
+ fprintf (stderr,
+ "CL: No available peers for initiating an ENet connection.\n");