git: 86981fc16ddf - main - games/vanilla-conquer: new port had been added (+)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Thu, 04 Aug 2022 15:20:11 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=86981fc16ddf963a064beccc9bc553af092c9cb5

commit 86981fc16ddf963a064beccc9bc553af092c9cb5
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-08-04 15:18:52 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-08-04 15:18:52 +0000

    games/vanilla-conquer: new port had been added (+)
    
    Vanilla Conquer is a fully portable version of the first generation
    C&C engine and is capable of running both Tiberian Dawn and Red Alert
    on multiple platforms.
    
    WWW: https://github.com/TheAssemblyArmada/Vanilla-Conquer
---
 games/Makefile                                     |  1 +
 games/vanilla-conquer/Makefile                     | 54 ++++++++++++++++++++++
 games/vanilla-conquer/distinfo                     |  5 ++
 .../files/patch-cmake_GitWatcher.cmake             | 26 +++++++++++
 .../files/patch-common_CMakeLists.txt              | 15 ++++++
 .../vanilla-conquer/files/patch-common_wspudp.cpp  | 10 ++++
 games/vanilla-conquer/pkg-descr                    | 11 +++++
 7 files changed, 122 insertions(+)

diff --git a/games/Makefile b/games/Makefile
index 57d259eb174f..b347c8342d44 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -1009,6 +1009,7 @@
     SUBDIR += urbanterror-data
     SUBDIR += valyriatear
     SUBDIR += vamos
+    SUBDIR += vanilla-conquer
     SUBDIR += vavoom
     SUBDIR += vavoom-extras
     SUBDIR += vectoroids
diff --git a/games/vanilla-conquer/Makefile b/games/vanilla-conquer/Makefile
new file mode 100644
index 000000000000..bd45f56d7c41
--- /dev/null
+++ b/games/vanilla-conquer/Makefile
@@ -0,0 +1,54 @@
+PORTNAME=	${GH_PROJECT:tl}
+PORTVERSION=	g20220804
+CATEGORIES=	games
+
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES=	f1a415ebe08c01ccf317.patch:-p1
+
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Portable version of the original C&C engine
+
+LICENSE=	GPLv3+
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	TheAssemblyArmada
+GH_PROJECT=	Vanilla-Conquer
+GH_TAGNAME=	8fb1a09
+
+USES=		cmake openal sdl
+USE_SDL=	sdl2
+CMAKE_ON=	BUILD_TOOLS
+CONFIGURE_ENV=	GIT_HEAD_SHA1=8fb1a09c91bd64fe599d4f15bd7fe3cdffd00707 \
+		GIT_HEAD_SHORT_SHA1=${GH_TAGNAME} \
+		GIT_COMMIT_DATE_ISO8601=${_GET_DATE:sh} \
+		GIT_AUTHOR_NAME=\<irrelevant\> GIT_TAG=latest \
+		GIT_COMMIT_TSTAMP=${_GET_TSTAMP:sh} GIT_IS_DIRTY=true \
+		GIT_RETRIEVED_STATE=true GIT_REV_LIST_COUNT=802
+LDFLAGS_i386=	-fuse-ld=bfd
+
+PLIST_FILES=	bin/vanillamix bin/vanillara bin/vanillatd \
+		share/icons/hicolor/scalable/apps/vanillara_icon.svg \
+		share/icons/hicolor/scalable/apps/vanillatd_icon.svg
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == i386
+BUILD_DEPENDS+=	ld.bfd:devel/binutils
+.endif
+
+post-patch:
+	@${REINPLACE_CMD} -e '/Obfuscate/s,long,unsigned,' \
+		${WRKSRC}/tiberiandawn/function.h \
+		${WRKSRC}/tiberiandawn/init.cpp
+
+do-install:
+	${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/vanilla* \
+		${STAGEDIR}${PREFIX}/bin
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+	${INSTALL_DATA} ${WRKSRC}/resources/*.svg \
+		${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps
+
+.include <bsd.port.post.mk>
+
+_GET_DATE=	TZ= ${STAT} -f %Sm -t %FT%TZ ${WRKSRC}/.gitignore
+_GET_TSTAMP=	TZ= ${STAT} -f %m ${WRKSRC}/.gitignore
diff --git a/games/vanilla-conquer/distinfo b/games/vanilla-conquer/distinfo
new file mode 100644
index 000000000000..0f953e88d6b1
--- /dev/null
+++ b/games/vanilla-conquer/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1659612087
+SHA256 (TheAssemblyArmada-Vanilla-Conquer-g20220804-8fb1a09_GH0.tar.gz) = a3d56190973b18f87863f2f15e732040dac24d7391d0d6306cd1c9eeb1362787
+SIZE (TheAssemblyArmada-Vanilla-Conquer-g20220804-8fb1a09_GH0.tar.gz) = 3883264
+SHA256 (f1a415ebe08c01ccf317.patch) = f9063a3b558b6f04c253d0415efcdbbd7859155c5d096127f89db1711106d417
+SIZE (f1a415ebe08c01ccf317.patch) = 19376
diff --git a/games/vanilla-conquer/files/patch-cmake_GitWatcher.cmake b/games/vanilla-conquer/files/patch-cmake_GitWatcher.cmake
new file mode 100644
index 000000000000..f4755f9e5a88
--- /dev/null
+++ b/games/vanilla-conquer/files/patch-cmake_GitWatcher.cmake
@@ -0,0 +1,26 @@
+--- cmake/GitWatcher.cmake.orig	2022-08-04 11:21:27 UTC
++++ cmake/GitWatcher.cmake
+@@ -72,7 +72,7 @@ if(NOT DEFINED GIT_EXECUTABLE)
+ # Check the optional git variable.
+ # If it's not set, we'll try to find it using the CMake packaging system.
+ if(NOT DEFINED GIT_EXECUTABLE)
+-    find_package(Git QUIET REQUIRED)
++    find_package(Git)
+ endif()
+ CHECK_REQUIRED_VARIABLE(GIT_EXECUTABLE)
+ 
+@@ -326,5 +326,13 @@ endfunction()
+     endif()
+ endfunction()
+ 
++# Archives fetched from GitHub lack Git metadata, just fill in the values
++# from the environment.
++function(NoGitBuild)
++    if(NOT EXISTS "${GIT_POST_CONFIGURE_FILE}")
++        GitStateChangedAction()
++    endif()
++endfunction()
++
+ # And off we go...
+-Main()
++NoGitBuild()
diff --git a/games/vanilla-conquer/files/patch-common_CMakeLists.txt b/games/vanilla-conquer/files/patch-common_CMakeLists.txt
new file mode 100644
index 000000000000..39b57004d2f0
--- /dev/null
+++ b/games/vanilla-conquer/files/patch-common_CMakeLists.txt
@@ -0,0 +1,15 @@
+--- common/CMakeLists.txt.orig	2022-08-04 11:21:27 UTC
++++ common/CMakeLists.txt
+@@ -164,11 +164,9 @@ add_library(common STATIC ${COMMON_SRC} ${COMMON_HEADE
+ file(GLOB_RECURSE COMMON_HEADERS "*.h")
+ 
+ add_library(common STATIC ${COMMON_SRC} ${COMMON_HEADERS})
+-target_link_libraries(common PUBLIC ${COMMON_LIBS})
++target_link_libraries(common PUBLIC ${COMMON_LIBS} compat)
+ target_include_directories(common PUBLIC .)
+ target_compile_definitions(common PRIVATE FIXIT_FAST_LOAD $<$<CONFIG:Debug>:_DEBUG>)
+-# Make build check state of git to check for uncommitted changes.
+-add_dependencies(common check_git)
+ 
+ if(BUILD_REMASTERTD OR BUILD_REMASTERRA)
+     add_library(commonr STATIC ${COMMONR_SRC})
diff --git a/games/vanilla-conquer/files/patch-common_wspudp.cpp b/games/vanilla-conquer/files/patch-common_wspudp.cpp
new file mode 100644
index 000000000000..6726b7d4e136
--- /dev/null
+++ b/games/vanilla-conquer/files/patch-common_wspudp.cpp
@@ -0,0 +1,10 @@
+--- common/wspudp.cpp.orig	2022-08-04 11:21:27 UTC
++++ common/wspudp.cpp
+@@ -54,6 +54,7 @@ extern WWKeyboardClass* Keyboard;
+ #include <assert.h>
+ 
+ #ifndef _WIN32
++#include <netinet/in.h>
+ #include <ifaddrs.h>
+ #endif
+ 
diff --git a/games/vanilla-conquer/pkg-descr b/games/vanilla-conquer/pkg-descr
new file mode 100644
index 000000000000..70d464a94dbd
--- /dev/null
+++ b/games/vanilla-conquer/pkg-descr
@@ -0,0 +1,11 @@
+Vanilla Conquer is a fully portable version of the first generation C&C
+engine and is capable of running both Tiberian Dawn and Red Alert on
+multiple platforms.  It can also be used for mod development for the
+Remastered Collection.
+
+The main focus of Vanilla Conquer is to keep the default out-of-box
+experience faithful to what the games were back when they were released
+and work as a drop-in replacement for the original executables while
+also providing bug fixes, compatibility and quality of life improvements.
+
+WWW: https://github.com/TheAssemblyArmada/Vanilla-Conquer