Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Apr 2021 19:14:47 GMT
From:      Dmitry Marakasov <amdmi3@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 5fe665bea083 - main - games/egoboo: update to 2.8.1
Message-ID:  <202104091914.139JElfI051499@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5fe665bea0830f15788dfbf75fecf15aefc45668

commit 5fe665bea0830f15788dfbf75fecf15aefc45668
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2021-04-08 22:23:45 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2021-04-09 19:14:22 +0000

    games/egoboo: update to 2.8.1
---
 games/egoboo/Makefile                              | 58 ++++++++++++++--------
 games/egoboo/distinfo                              |  7 ++-
 games/egoboo/files/patch-game-Makefile.unix        | 29 -----------
 games/egoboo/files/patch-game-lin-file.c           | 12 -----
 games/egoboo/files/patch-src_game_Makefile         | 26 ++++++++++
 .../files/patch-src_game_file__formats_id_md2.c    | 11 ++++
 games/egoboo/files/patch-src_game_game.c           | 17 +++++++
 games/egoboo/files/patch-src_game_network.c        | 54 ++++++++++++++++++++
 .../files/patch-src_game_platform_file__linux.c    | 23 +++++++++
 games/egoboo/pkg-plist                             |  3 ++
 10 files changed, 175 insertions(+), 65 deletions(-)

diff --git a/games/egoboo/Makefile b/games/egoboo/Makefile
index 6f1bb8706b54..e199439132c2 100644
--- a/games/egoboo/Makefile
+++ b/games/egoboo/Makefile
@@ -1,37 +1,55 @@
 # Created by: Jan Stocker <Jan.Stocker@t-online.de>
 
 PORTNAME=	egoboo
-PORTVERSION=	2.7.5
-PORTREVISION=	11
+PORTVERSION=	2.8.1
 PORTEPOCH=	1
 CATEGORIES=	games
-MASTER_SITES=	SF/${PORTNAME}/Linux%20Source%20Distro/${PORTVERSION}
-DISTFILES=	${DISTNAME}${EXTRACT_SUFX} \
-		${DISTNAME:S/-/-data-/}${EXTRACT_SUFX}
+MASTER_SITES=	SF/${PORTNAME}/Linux%20Source%20Distro/${PORTVERSION}%20(Stable)
 
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	3D dungeon crawling adventure in the spirit of NetHack
 
+LICENSE=	GPLv3+
+LICENSE_FILE=	${WRKSRC}/license.txt
+
+LIB_DEPENDS=	libphysfs.so:devel/physfs \
+		libenet.so:net/enet
+
 USES=		dos2unix gl gmake sdl
 USE_SDL=	sdl ttf mixer image
-USE_GL=		glu
-DOS2UNIX_GLOB=	*.c
+USE_GL=		gl glu
+DOS2UNIX_GLOB=	Makefile *.c
 
-WRKSRC=		${WRKDIR}/${DISTNAME}/game
-MAKEFILE=	Makefile.unix
-MAKE_ARGS=	PREFIX="${STAGEDIR}${PREFIX}"
+PROJ_NAME=	egoboo
 
-PLIST_FILES=	bin/${PORTNAME} libexec/${PORTNAME}
-PORTDATA=	*
+BUILD_WRKSRC=	${WRKSRC}/src/game
+MAKE_ENV=	PROJ_NAME=${PROJ_NAME}
+ALL_TARGET=	${PROJ_NAME}
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/share/egoboo|${DATADIR}|g; \
-		s|cp -a|cp -RPp|; s|/usr/libexec|${PREFIX}/libexec|' \
-		${WRKSRC}/egoboo.sh
+ETCDIR=		${PREFIX}/etc/${PROJ_NAME}
+DATADIR=	${PREFIX}/share/${PROJ_NAME}
+
+PORTDOCS=	*
+PORTDATA=	*
 
-post-install:
-	@cd ${WRKDIR}/${DISTNAME:S/-/-data-/} && \
-		${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/
-	${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}
+DESKTOP_ENTRIES="Egoboo" \
+		"" \
+		"${DATADIR}/icon.bmp" \
+		"${PROJ_NAME}" \
+		"Game;AdventureGame;RolePlaying;" \
+		""
+
+OPTIONS_DEFINE=	DOCS
+
+do-install:
+	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PROJ_NAME} ${STAGEDIR}${PREFIX}/bin/
+	@cd ${WRKSRC} && ${COPYTREE_SHARE} "basicdat modules" ${STAGEDIR}${DATADIR}/
+	@${MKDIR} ${STAGEDIR}${ETCDIR}
+	${INSTALL_DATA} ${WRKSRC}/controls.txt ${STAGEDIR}${ETCDIR}/controls.txt.sample
+	${INSTALL_DATA} ${WRKSRC}/setup.txt ${STAGEDIR}${ETCDIR}/setup.txt.sample
+
+do-install-DOCS-on:
+	@cd ${WRKSRC} && ${COPYTREE_SHARE} "BUGS.txt Changelog.txt doc" \
+		${STAGEDIR}${DOCSDIR} "-not -empty"
 
 .include <bsd.port.mk>
diff --git a/games/egoboo/distinfo b/games/egoboo/distinfo
index 31f2be846ec5..14bf17c4f166 100644
--- a/games/egoboo/distinfo
+++ b/games/egoboo/distinfo
@@ -1,4 +1,3 @@
-SHA256 (egoboo-2.7.5.tar.gz) = 83af95f66b68afdf1b322dffa883f8568ca402f203257315ebacff6fc95ddb2b
-SIZE (egoboo-2.7.5.tar.gz) = 368781
-SHA256 (egoboo-data-2.7.5.tar.gz) = aa1455d285d28c1e7e584fac67438efe57b9dce9495ca860deb8069bed95500e
-SIZE (egoboo-data-2.7.5.tar.gz) = 64254746
+TIMESTAMP = 1611855459
+SHA256 (egoboo-2.8.1.tar.gz) = a2694187d28a7aadf4ca3b9b7a6c6dcd3bb03ec8f145435c744bb77afb5f4c26
+SIZE (egoboo-2.8.1.tar.gz) = 150029960
diff --git a/games/egoboo/files/patch-game-Makefile.unix b/games/egoboo/files/patch-game-Makefile.unix
deleted file mode 100644
index c88312ac977e..000000000000
--- a/games/egoboo/files/patch-game-Makefile.unix
+++ /dev/null
@@ -1,29 +0,0 @@
---- Makefile.unix.orig	2008-01-02 00:35:35.000000000 +0300
-+++ Makefile.unix	2008-02-07 04:07:36.000000000 +0300
-@@ -1,5 +1,4 @@
- # note if you change the prefix also update egoboo.sh
--PREFIX   := /usr
- EGO_SRC  := camera.c char.c Client.c Clock.c common-file.c configfile.c \
- 					  egoboostrutil.c enchant.c Font.c game.c gltexture.c graphicfan.c \
- 					  graphicmad.c graphic.c graphicprt.c id_normals.c input.c \
-@@ -12,15 +11,15 @@
- 						../enet/unix.c
- ENET_OBJ := ${ENET_SRC:.c=.o}
- 
--SDL_CONF  := sdl-config
-+SDL_CONF  := ${SDL_CONFIG}
- SDLCONF_I := $(shell ${SDL_CONF} --cflags)
- SDLCONF_L := $(shell ${SDL_CONF} --libs)
- 
--CC      := gcc
-+CC      ?= gcc
- OPT     := -Os
--INC     := -I. -I.. ${SDLCONF_I}
--CFLAGS  := ${OPT} ${INC}
--LDFLAGS := ${SDLCONF_L} -lSDL_ttf -lSDL_mixer -lSDL_image -lGL -lGLU
-+INC     := -I. -I.. ${SDLCONF_I} -I${LOCALBASE}/include
-+CFLAGS  += ${INC}
-+LDFLAGS := ${SDLCONF_L} -L${LOCALBASE}/lib -lSDL_ttf -lSDL_mixer -lSDL_image -lGL -lGLU -lm
- 
- EGO_BIN := egoboo
- 
diff --git a/games/egoboo/files/patch-game-lin-file.c b/games/egoboo/files/patch-game-lin-file.c
deleted file mode 100644
index 349573027a8f..000000000000
--- a/games/egoboo/files/patch-game-lin-file.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- lin-file.c.orig	2019-06-15 14:41:01 UTC
-+++ lin-file.c
-@@ -8,7 +8,8 @@
- #include <glob.h>
- #include <sys/types.h>
- #include <sys/stat.h>
--#include <sys/dir.h>
-+#include <dirent.h>
-+#include <sys/syslimits.h>
- 
- //File Routines-----------------------------------------------------------
- void fs_init()
diff --git a/games/egoboo/files/patch-src_game_Makefile b/games/egoboo/files/patch-src_game_Makefile
new file mode 100644
index 000000000000..7501270c34b2
--- /dev/null
+++ b/games/egoboo/files/patch-src_game_Makefile
@@ -0,0 +1,26 @@
+--- src/game/Makefile.orig	2021-01-28 17:44:39 UTC
++++ src/game/Makefile
+@@ -32,18 +32,18 @@ SDLCONF_L := $(shell ${SDL_CONF} --libs)
+ #---------------------
+ # the compiler options
+ 
+-CC      := gcc
+-INC     := -I. -I.. -I../enet/include ${SDLCONF_I} -I./extensions -I./file_formats -I./platform
+-LDFLAGS := ${SDLCONF_L} -L../enet/lib -lSDL_ttf -lSDL_mixer -lGL -lGLU -lSDL_image -lphysfs -lenet
++CC      ?= gcc
++INC     := -I. -I.. -isystem${LOCALBASE}/include ${SDLCONF_I} -I./extensions -I./file_formats -I./platform
++LDFLAGS := ${SDLCONF_L} -L${LOCALBASE}/lib -lSDL_ttf -lSDL_mixer -lGL -lGLU -lSDL_image -lphysfs -lenet -lm
+ 
+ # use different options if the environmental variable PREFIX is defined
+ ifdef ($(PREFIX),"")
+ 	OPT := -Os -Wall
+ else
+-	OPT := -Os -Wall -DPREFIX=\"${PREFIX}\" -D_NIX_PREFIX
++	OPT := -Wall -DPREFIX=\"${PREFIX}\" -D_NIX_PREFIX
+ endif
+ 
+-CFLAGS  := ${OPT} ${INC}
++CFLAGS  += ${OPT} ${INC}
+ 
+ #------------------------------------
+ # definitions of the target projects
diff --git a/games/egoboo/files/patch-src_game_file__formats_id_md2.c b/games/egoboo/files/patch-src_game_file__formats_id_md2.c
new file mode 100644
index 000000000000..2e5dafa4f086
--- /dev/null
+++ b/games/egoboo/files/patch-src_game_file__formats_id_md2.c
@@ -0,0 +1,11 @@
+--- src/game/file_formats/id_md2.c.orig	2021-01-29 16:26:24 UTC
++++ src/game/file_formats/id_md2.c
+@@ -24,7 +24,7 @@
+ #include "id_md2.h"
+ #include "egoboo_vfs.h"
+ 
+-#include <malloc.h>
++#include <stdlib.h>
+ 
+ //--------------------------------------------------------------------------------------------
+ //--------------------------------------------------------------------------------------------
diff --git a/games/egoboo/files/patch-src_game_game.c b/games/egoboo/files/patch-src_game_game.c
new file mode 100644
index 000000000000..2bc724211b4e
--- /dev/null
+++ b/games/egoboo/files/patch-src_game_game.c
@@ -0,0 +1,17 @@
+Fix controls (left acting as right and up as down)
+
+Arith with booleans is a bad idea.
+
+--- src/game/game.c.orig	2021-04-09 17:57:53 UTC
++++ src/game/game.c
+@@ -2052,8 +2052,8 @@ void set_one_player_latch( const PLA_REF player )
+         if (( CAM_TURN_GOOD == PCamera->turn_mode && 1 == local_numlpla ) ||
+             !control_is_pressed( INPUT_DEVICE_KEYBOARD, CONTROL_CAMERA ) )
+         {
+-            joy_pos.x = ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_RIGHT ) - control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_LEFT ) );
+-            joy_pos.y = ( control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_DOWN ) - control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_UP ) );
++            joy_pos.x = ( (int)control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_RIGHT ) - (int)control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_LEFT ) );
++            joy_pos.y = ( (int)control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_DOWN ) - (int)control_is_pressed( INPUT_DEVICE_KEYBOARD,  CONTROL_UP ) );
+ 
+             if ( CAM_TURN_GOOD == PCamera->turn_mode &&
+                  1 == local_numlpla )  joy_pos.x = 0;
diff --git a/games/egoboo/files/patch-src_game_network.c b/games/egoboo/files/patch-src_game_network.c
new file mode 100644
index 000000000000..8db876335afd
--- /dev/null
+++ b/games/egoboo/files/patch-src_game_network.c
@@ -0,0 +1,54 @@
+--- src/game/network.c.orig	2010-12-22 19:26:01 UTC
++++ src/game/network.c
+@@ -173,7 +173,7 @@ void close_session()
+ 
+             for ( i = 0; i < numPeers; i++ )
+             {
+-#if defined(ENET11)
++#if 1
+                 enet_peer_disconnect( &net_myHost->peers[i], 0 );
+ #else
+                 enet_peer_disconnect( &net_myHost->peers[i] );
+@@ -1519,7 +1519,7 @@ void listen_for_packets()
+                     // don't allow anyone to connect during the game session
+                     log_warning( "listen_for_packets: Client tried to connect during the game: %x:%u\n",
+                                  event.peer->address.host, event.peer->address.port );
+-#if defined(ENET11)
++#if 1
+                     enet_peer_disconnect( event.peer, 0 );
+ #else
+                     enet_peer_disconnect( event.peer );
+@@ -1845,7 +1845,7 @@ int cl_joinGame( const char* hostname )
+         log_info( "cl_joinGame: Creating client network connection... " );
+         // Create my host thingamabober
+         /// @todo Should I limit client bandwidth here?
+-        net_myHost = enet_host_create( NULL, 1, 0, 0 );
++        net_myHost = enet_host_create( NULL, 1, 0, 0, 0 );
+         if ( NULL == net_myHost )
+         {
+             // can't create a network connection at all
+@@ -1861,7 +1861,7 @@ int cl_joinGame( const char* hostname )
+         log_info( "cl_joinGame: Attempting to connect to %s:%d\n", hostname, NET_EGOBOO_PORT );
+         enet_address_set_host( &address, hostname );
+         address.port = NET_EGOBOO_PORT;
+-        net_gameHost = enet_host_connect( net_myHost, &address, NET_EGOBOO_NUM_CHANNELS );
++        net_gameHost = enet_host_connect( net_myHost, &address, NET_EGOBOO_NUM_CHANNELS, 0 );
+         if ( NULL == net_gameHost )
+         {
+             log_info( "cl_joinGame: No available peers to create a connection!\n" );
+@@ -1904,7 +1904,7 @@ int sv_hostGame()
+         address.port = NET_EGOBOO_PORT;
+ 
+         log_info( "sv_hostGame: Creating game on port %d\n", NET_EGOBOO_PORT );
+-        net_myHost = enet_host_create( &address, MAX_PLAYER, 0, 0 );
++        net_myHost = enet_host_create( &address, MAX_PLAYER, 0, 0, 0 );
+         if ( NULL == net_myHost )
+         {
+             log_info( "sv_hostGame: Could not create network connection!\n" );
+@@ -2180,4 +2180,4 @@ player_t* chr_get_ppla( const CHR_REF ichr )
+     if ( !VALID_PLA( iplayer ) ) return NULL;
+ 
+     return PlaStack.lst + iplayer;
+-}
+\ No newline at end of file
++}
diff --git a/games/egoboo/files/patch-src_game_platform_file__linux.c b/games/egoboo/files/patch-src_game_platform_file__linux.c
new file mode 100644
index 000000000000..98473e756eba
--- /dev/null
+++ b/games/egoboo/files/patch-src_game_platform_file__linux.c
@@ -0,0 +1,23 @@
+--- src/game/platform/file_linux.c.orig	2021-01-29 16:26:24 UTC
++++ src/game/platform/file_linux.c
+@@ -33,7 +33,7 @@
+ #include <glob.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <sys/dir.h>
++#include <sys/syslimits.h>
+ #include "egoboo_mem.h"
+ 
+ //--------------------------------------------------------------------------------------------
+@@ -75,8 +75,8 @@ void sys_fs_init()
+     // .rpm or .deb package.
+ 
+-    strncpy( linux_configPath, PREFIX "/etc/egoboo-2.x",         SDL_arraysize( linux_configPath ) );
+-    strncpy( linux_binaryPath, PREFIX "/games/",                  SDL_arraysize( linux_binaryPath ) );
+-    strncpy( linux_dataPath,   PREFIX "/share/games/egoboo-2.x", SDL_arraysize( linux_dataPath ) );
++    strncpy( linux_configPath, PREFIX "/etc/egoboo",         SDL_arraysize( linux_configPath ) );
++    strncpy( linux_binaryPath, PREFIX "/bin/",                  SDL_arraysize( linux_binaryPath ) );
++    strncpy( linux_dataPath,   PREFIX "/share/egoboo", SDL_arraysize( linux_dataPath ) );
+ #else
+     // these are read-only directories
+     strncpy( linux_configPath, "/etc/egoboo-2.x/",         SDL_arraysize( linux_configPath ) );
diff --git a/games/egoboo/pkg-plist b/games/egoboo/pkg-plist
new file mode 100644
index 000000000000..df0a527557fb
--- /dev/null
+++ b/games/egoboo/pkg-plist
@@ -0,0 +1,3 @@
+bin/egoboo
+@sample %%ETCDIR%%/controls.txt.sample
+@sample %%ETCDIR%%/setup.txt.sample



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104091914.139JElfI051499>