fs2open-git: import fs2open (git snapshot) as fs2open-git

The Source Code Project was started roughly five years ago, when Volition
released the source code to the game known as "Freespace 2". This virtually
unknown game consistently won awards for being a great action space sim, but
never really caught on when it was released. The Source Code Project has worked,
and continues to work, on improving the graphics and gameplay of this
ten-year-old game.

This package installs the executable only. The original game CD, or
data files for the game are required to play the game.
This commit is contained in:
Yorick Hardy 2019-12-18 09:02:18 +02:00
parent 0d10af478d
commit ecc7f3fdd7
16 changed files with 270 additions and 0 deletions

View File

@ -890,6 +890,7 @@ SUBDIR+= frobtads
SUBDIR+= fs-uae-dev
SUBDIR+= fs-uae-launcher
SUBDIR+= fs2open
SUBDIR+= fs2open-git
SUBDIR+= fsharp
SUBDIR+= fslsfonts
SUBDIR+= fsom

9
fs2open-git/DESCR Normal file
View File

@ -0,0 +1,9 @@
The Source Code Project was started roughly five years ago, when Volition
released the source code to the game known as "Freespace 2". This virtually
unknown game consistently won awards for being a great action space sim, but
never really caught on when it was released. The Source Code Project has worked,
and continues to work, on improving the graphics and gameplay of this
ten-year-old game.
This package installs the executable only. The original game CD, or
data files for the game are required to play the game.

14
fs2open-git/LICENSE Normal file
View File

@ -0,0 +1,14 @@
Volition Copyright (applies to original FreeSpace2 source code
developed and released by Volition):
"Copyright (C) Volition, Inc. 1999. All rights reserved.
All source code herein is the property of Volition, Inc. You may not
sell or otherwise commercially exploit the source or things you
created based on the source."
Modifications by members of the FreeSpace Source Code Project are
released under whatever terms the individual authors choose, but the
above notice continues to apply to all fs2_open code.

38
fs2open-git/Makefile Normal file
View File

@ -0,0 +1,38 @@
# $NetBSD$
#
DISTNAME= fs2_open-0.0
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_GITHUB:=scp-fs2open/}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://scp.indiegames.us/
COMMENT= Freespace 2 source code project
GIT_REPOSITORIES= fs2open
GIT_REPO.fs2open= git://github.com/scp-fs2open/fs2open.github.com.git
WRKSRC= ${WRKDIR}/fs2open
USE_CMAKE= yes
USE_LANGUAGES= c c++
USE_TOOLS+= pkg-config
CONFIGURE_DIRS= build
CMAKE_ARG_PATH= ..
LUA_VERSIONS_ACCEPTED= 51
pre-configure:
${MKDIR} ${WRKSRC}/build
.include "../../audio/openal-soft/buildlink3.mk"
.include "../../devel/SDL2/buildlink3.mk"
.include "../../devel/libexecinfo/buildlink3.mk"
.include "../../graphics/freetype2/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../lang/lua/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../multimedia/ffmpeg4/buildlink3.mk"
.include "../../textproc/jansson/buildlink3.mk"
.include "../../wip/mk/git-package.mk"
.include "../../mk/bsd.pkg.mk"

2
fs2open-git/PLIST Normal file
View File

@ -0,0 +1,2 @@
@comment $NetBSD$
bin/fs2_open

12
fs2open-git/distinfo Normal file
View File

@ -0,0 +1,12 @@
$NetBSD$
SHA1 (patch-cmake_platform-unix.cmake) = 54de840e05b9ac738e84e9e33f17ce623599ec6d
SHA1 (patch-cmake_platforms.cmake) = b91c2544b2225f7d00fa35272dd2b20725e1ba3e
SHA1 (patch-cmake_toolchain-clang.cmake) = b3c9375059a56d2963e60d83bac38e690ea6eabc
SHA1 (patch-cmake_toolchain-gcc.cmake) = 957a15184012f3924f265ca467bcf5875d15ff96
SHA1 (patch-code_libs_renderdoc_renderdoc__app.h) = 8c7179a15fc5015bd8f27267fda237f3e9c7b15e
SHA1 (patch-code_network_multi__portfwd.cpp) = 4f08bfa9b1376a9c7c054067ff993dac157280c2
SHA1 (patch-code_osapi_dialogs.cpp) = 10eb8c64f633c6b4db62bee7bc56e07631e22f08
SHA1 (patch-freespace2_CMakeLists.txt) = 78cfadc9c91c90636c60bba164be387bf39b9a11
SHA1 (patch-lib_libpcp_src_net_gateway.c) = 47cf7aff4231c5b1914609bde7025d8f9def8d67
SHA1 (patch-lib_libpcp_src_net_sock__ntop.c) = 8d1dc4326c714010f6632ab7d229874e4357a982

View File

@ -0,0 +1,22 @@
$NetBSD$
Use the pkgsrcs settings for rpath, and set the binary
and library destinations for pkgsrc.
--- cmake/platform-unix.cmake.orig 2019-12-15 06:53:29.388252150 +0000
+++ cmake/platform-unix.cmake
@@ -6,8 +6,11 @@ MESSAGE(STATUS "Configuring UNIX specifi
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL _REENTRANT)
# Set RPATH
-set(CMAKE_SKIP_BUILD_RPATH TRUE)
-set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-set(CMAKE_INSTALL_RPATH "\$ORIGIN")
+#set(CMAKE_SKIP_BUILD_RPATH TRUE)
+#set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
+#set(CMAKE_INSTALL_RPATH "\$ORIGIN")
set(PLATFORM_UNIX TRUE CACHE INTERNAL "" FORCE)
+
+SET(BINARY_DESTINATION "bin")
+SET(LIBRAY_DESTINATION "lib")

View File

@ -0,0 +1,17 @@
$NetBSD$
Add support for NetBSD and OpenBSD.
--- cmake/platforms.cmake.orig 2019-11-03 18:11:21.000000000 +0000
+++ cmake/platforms.cmake
@@ -17,6 +17,10 @@ ELSEIF(UNIX)
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
INCLUDE(platform-freebsd)
+ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+ INCLUDE(platform-freebsd)
+ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
+ INCLUDE(platform-freebsd)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
INCLUDE(platform-solaris)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

View File

@ -0,0 +1,15 @@
$NetBSD$
Keep the linker flags (which include the rpath).
--- cmake/toolchain-clang.cmake.orig 2019-12-15 18:44:11.111523660 +0000
+++ cmake/toolchain-clang.cmake
@@ -97,7 +97,7 @@ set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLA
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
-set(CMAKE_EXE_LINKER_FLAGS "")
+#set(CMAKE_EXE_LINKER_FLAGS "")
if (CLANG_USE_LIBCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi")

View File

@ -0,0 +1,15 @@
$NetBSD$
Keep the linker flags (which include the rpath).
--- cmake/toolchain-gcc.cmake.orig 2019-11-03 18:11:21.000000000 +0000
+++ cmake/toolchain-gcc.cmake
@@ -108,7 +108,7 @@ set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLA
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
-set(CMAKE_EXE_LINKER_FLAGS "")
+#set(CMAKE_EXE_LINKER_FLAGS "")
IF (MINGW)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++ -Wl,--enable-auto-import")

View File

@ -0,0 +1,19 @@
$NetBSD$
Add support for NetBSD and OpenBSD.
--- code/libs/renderdoc/renderdoc_app.h.orig 2019-08-28 23:04:20.000000000 +0000
+++ code/libs/renderdoc/renderdoc_app.h
@@ -39,6 +39,12 @@
#define RENDERDOC_CC
#elif defined(__APPLE__)
#define RENDERDOC_CC
+#elif defined(__FreeBSD__)
+#define RENDERDOC_CC
+#elif defined(__NetBSD__)
+#define RENDERDOC_CC
+#elif defined(__OpenBSD__)
+#define RENDERDOC_CC
#else
#error "Unknown platform"
#endif

View File

@ -0,0 +1,16 @@
$NetBSD$
AI_V4MAPPED is not defined on all platforms, define to 0 if necessary.
--- code/network/multi_portfwd.cpp.orig 2019-12-15 06:53:29.495797393 +0000
+++ code/network/multi_portfwd.cpp
@@ -187,6 +187,9 @@ static bool PF_get_addr(const char *host
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
+#ifndef AI_V4MAPPED
+# define AI_V4MAPPED 0
+#endif
hints.ai_flags = AI_V4MAPPED;
if (host == nullptr) {

View File

@ -0,0 +1,44 @@
$NetBSD$
Provide fallback error messages to stderr.
--- code/osapi/dialogs.cpp.orig 2019-12-16 14:07:42.626176361 +0000
+++ code/osapi/dialogs.cpp
@@ -11,6 +11,7 @@
#include <string>
#include <algorithm>
+#include <iostream>
extern "C" {
#include <lauxlib.h>
@@ -251,6 +252,9 @@ namespace os
if (SDL_ShowMessageBox(&boxData, &buttonId) < 0)
{
// Call failed
+ std::cerr << "(SDL_ShowMessageBox failed: " << SDL_GetError() << ")" << std::endl;
+ std::cerr << boxData.message << std::endl;
+ std::cerr.flush();
buttonId = 1; // No action
}
@@ -335,6 +339,9 @@ namespace os
if (SDL_ShowMessageBox(&boxData, &buttonId) < 0)
{
// Call failed
+ std::cerr << "(SDL_ShowMessageBox failed: " << SDL_GetError() << ")" << std::endl;
+ std::cerr << boxData.message << std::endl;
+ std::cerr.flush();
abort();
}
@@ -403,6 +410,9 @@ namespace os
if (SDL_ShowMessageBox(&boxData, &buttonId) < 0)
{
// Call failed
+ std::cerr << "(SDL_ShowMessageBox failed: " << SDL_GetError() << ")" << std::endl;
+ std::cerr << boxData.message << std::endl;
+ std::cerr.flush();
abort();
}

View File

@ -0,0 +1,15 @@
$NetBSD$
Don't use the architecture suffix.
--- freespace2/CMakeLists.txt.orig 2019-11-03 18:11:22.000000000 +0000
+++ freespace2/CMakeLists.txt
@@ -23,7 +23,7 @@ ADD_EXECUTABLE(Freespace2 ${EXE_GUI_TYPE
include(resources.cmake)
-SET_TARGET_PROPERTIES(Freespace2 PROPERTIES OUTPUT_NAME "fs2_open_${FSO_BINARY_SUFFIX}")
+SET_TARGET_PROPERTIES(Freespace2 PROPERTIES OUTPUT_NAME "fs2_open")
TARGET_LINK_LIBRARIES(Freespace2 code)
TARGET_LINK_LIBRARIES(Freespace2 platform)

View File

@ -0,0 +1,15 @@
$NetBSD$
Also support NetbSD and OpenBSD.
--- lib/libpcp/src/net/gateway.c.orig 2019-12-15 06:53:29.677263118 +0000
+++ lib/libpcp/src/net/gateway.c
@@ -62,7 +62,7 @@
#include "pcp_win_defines.h"
#endif
-#if defined(__APPLE__) || defined(__FreeBSD__)
+#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <sys/sysctl.h>
#include <net/if_dl.h> //struct sockaddr_dl
#define USE_SOCKET_ROUTE

View File

@ -0,0 +1,16 @@
$NetBSD$
AI_V4MAPPED is not defined on all platforms, define to 0 if necessary.
--- lib/libpcp/src/net/sock_ntop.c.orig 2019-12-15 06:53:29.678798451 +0000
+++ lib/libpcp/src/net/sock_ntop.c
@@ -175,6 +175,9 @@ sock_pton(const char* cp, struct sockadd
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
+#ifndef AI_V4MAPPED
+# define AI_V4MAPPED 0
+#endif
hints.ai_flags = AI_V4MAPPED;
if ((rv = getaddrinfo(host_name, port, &hints, &servinfo)) != 0) {