games: Add vvvvvv

VVVVVV is a platform game all about exploring one simple mechanical idea -
what if you reversed gravity instead of jumping?

The game is designed not to artificially gate your progress. In VVVVVV there
are no locks, no power-ups, no switches, nothing to stop you progressing
except the challenges themselves.
This commit is contained in:
nia 2020-01-10 18:27:18 +00:00
parent 36d75282a0
commit 560631a80d
8 changed files with 222 additions and 0 deletions

6
games/vvvvvv/DESCR Normal file
View file

@ -0,0 +1,6 @@
VVVVVV is a platform game all about exploring one simple mechanical idea -
what if you reversed gravity instead of jumping?
The game is designed not to artificially gate your progress. In VVVVVV there
are no locks, no power-ups, no switches, nothing to stop you progressing
except the challenges themselves.

6
games/vvvvvv/MESSAGE Normal file
View file

@ -0,0 +1,6 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2020/01/10 18:27:18 nia Exp $
Copy all data files to ~/.local/share/VVVVVV before running the game.
===========================================================================

27
games/vvvvvv/Makefile Normal file
View file

@ -0,0 +1,27 @@
# $NetBSD: Makefile,v 1.1 2020/01/10 18:27:18 nia Exp $
DISTNAME= VVVVVVV-0.0.0.20200110
PKGNAME= ${DISTNAME:tl}
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_GITHUB:=TerryCavanagh/}
GITHUB_PROJECT= VVVVVV
GITHUB_TAG= 9e5e9f3e670a0cc48475a20486b0630e83ae14b4
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://github.com/TerryCavanagh/VVVVVV
COMMENT= 2D puzzle platform video game with gravity reversal
LICENSE= vvvvvv-license
WRKSRC= ${WRKDIR}/VVVVVV-${GITHUB_TAG}/desktop_version
USE_CMAKE= yes
USE_TOOLS+= pkg-config
USE_LANGUAGES= c c++
INSTALLATION_DIRS+= bin
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/vvvvvv* ${DESTDIR}${PREFIX}/bin/vvvvvv
.include "../../audio/SDL2_mixer/buildlink3.mk"
.include "../../devel/SDL2/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

2
games/vvvvvv/PLIST Normal file
View file

@ -0,0 +1,2 @@
@comment $NetBSD: PLIST,v 1.1 2020/01/10 18:27:18 nia Exp $
bin/vvvvvv

9
games/vvvvvv/distinfo Normal file
View file

@ -0,0 +1,9 @@
$NetBSD: distinfo,v 1.1 2020/01/10 18:27:18 nia Exp $
SHA1 (VVVVVVV-0.0.0.20200110-9e5e9f3e670a0cc48475a20486b0630e83ae14b4.tar.gz) = 7efdc53b9c86bcdbcbbdaced32390cd64e9ee4a0
RMD160 (VVVVVVV-0.0.0.20200110-9e5e9f3e670a0cc48475a20486b0630e83ae14b4.tar.gz) = b12109fa84a6a87573210a2ffc99fb54cf62a605
SHA512 (VVVVVVV-0.0.0.20200110-9e5e9f3e670a0cc48475a20486b0630e83ae14b4.tar.gz) = 5e1ab96261afa091496bb79b6c2a5f5c5f304dbf03214cc87bfb01e722fe26fde14e9a659fff2ac9411be2247fd53bf0d6e400ea2ac2a78637bda0ddd8f87078
Size (VVVVVVV-0.0.0.20200110-9e5e9f3e670a0cc48475a20486b0630e83ae14b4.tar.gz) = 828498 bytes
SHA1 (patch-physfs_physfs__platform__unix.c) = 6c84e653c3058d614d08783925b35892e3f0950c
SHA1 (patch-src_FileSystemUtils.cpp) = 6ad10e2827e0453abdb50036fc156f7ec9504c28
SHA1 (patch-src_SteamNetwork.c) = 8e86050961b0a623e1794eeef03ce312c8fcefe9

View file

@ -0,0 +1,17 @@
$NetBSD: patch-physfs_physfs__platform__unix.c,v 1.1 2020/01/10 18:27:18 nia Exp $
Support NetBSD.
--- physfs/physfs_platform_unix.c.orig 2020-01-10 16:45:29.000000000 +0000
+++ physfs/physfs_platform_unix.c
@@ -57,6 +57,10 @@
#include <sys/sysctl.h>
#endif
+#ifdef __NetBSD__
+#include <sys/statvfs.h>
+#define statfs statvfs
+#endif
#include "physfs_internal.h"

View file

@ -0,0 +1,68 @@
$NetBSD: patch-src_FileSystemUtils.cpp,v 1.1 2020/01/10 18:27:18 nia Exp $
Support non-Linux
--- src/FileSystemUtils.cpp.orig 2020-01-10 16:45:29.000000000 +0000
+++ src/FileSystemUtils.cpp
@@ -14,7 +14,7 @@
#include <shlobj.h>
#define mkdir(a, b) CreateDirectory(a, NULL)
#define VNEEDS_MIGRATION (mkdirResult != 0)
-#elif defined(__linux__) || defined(__APPLE__)
+#elif defined(__unix__) || defined(__APPLE__)
#include <sys/stat.h>
#include <limits.h>
#define VNEEDS_MIGRATION (mkdirResult == 0)
@@ -141,7 +141,13 @@ std::vector<std::string> FILESYSTEM_getL
void PLATFORM_getOSDirectory(char* output)
{
-#if defined(__linux__)
+#if defined(__APPLE__)
+ strcpy(output, PHYSFS_getUserDir());
+ strcat(output, "Library/Application Support/VVVVVV/");
+#elif defined(_WIN32)
+ SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, output);
+ strcat(output, "\\VVVVVV\\");
+#else
const char *homeDir = getenv("XDG_DATA_HOME");
if (homeDir == NULL)
{
@@ -153,14 +159,6 @@ void PLATFORM_getOSDirectory(char* outpu
strcpy(output, homeDir);
strcat(output, "/VVVVVV/");
}
-#elif defined(__APPLE__)
- strcpy(output, PHYSFS_getUserDir());
- strcat(output, "Library/Application Support/VVVVVV/");
-#elif defined(_WIN32)
- SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, output);
- strcat(output, "\\VVVVVV\\");
-#else
-#error See PLATFORM_getOSDirectory
#endif
}
@@ -169,7 +167,7 @@ void PLATFORM_migrateSaveData(char* outp
char oldLocation[MAX_PATH];
char newLocation[MAX_PATH];
char oldDirectory[MAX_PATH];
-#if defined(__linux__) || defined(__APPLE__)
+#if defined(__unix__) || defined(__APPLE__)
DIR *dir = NULL;
struct dirent *de = NULL;
DIR *subDir = NULL;
@@ -182,10 +180,10 @@ void PLATFORM_migrateSaveData(char* outp
return;
}
strcpy(oldDirectory, homeDir);
-#if defined(__linux__)
- strcat(oldDirectory, "/.vvvvvv/");
-#elif defined(__APPLE__)
+#if defined(__APPLE__)
strcat(oldDirectory, "/Documents/VVVVVV/");
+#else
+ strcat(oldDirectory, "/.vvvvvv/");
#endif
dir = opendir(oldDirectory);
if (!dir)

View file

@ -0,0 +1,87 @@
$NetBSD: patch-src_SteamNetwork.c,v 1.1 2020/01/10 18:27:18 nia Exp $
Don't depend on proprietary steam libs
--- src/SteamNetwork.c.orig 2020-01-10 16:45:29.000000000 +0000
+++ src/SteamNetwork.c
@@ -15,10 +15,8 @@
#define NETWORK_LIBRARY "steam_api.dll"
#elif defined(__APPLE__)
#define NETWORK_LIBRARY "libsteam_api.dylib"
-#elif defined(__linux__)
-#define NETWORK_LIBRARY "libsteam_api.so"
#else
-#error NETWORK_LIBRARY: Unrecognized platform!
+#define NETWORK_LIBRARY "libsteam_api.so"
#endif
/* Function Pointer Types */
@@ -97,68 +95,6 @@ static void ClearPointers()
int NETWORK_init()
{
- intptr_t steamClient;
- int32_t steamUser, steamPipe;
-
- libHandle = SDL_LoadObject(NETWORK_LIBRARY);
- if (!libHandle)
- {
- printf("%s not found!\n", NETWORK_LIBRARY);
- return 0;
- }
-
- #define LOAD_FUNC(name) \
- name = (name##Func) SDL_LoadFunction(libHandle, #name); \
- if (!name) \
- { \
- printf("%s symbol %s not found!\n", NETWORK_LIBRARY, #name); \
- ClearPointers(); \
- return 0; \
- }
- LOAD_FUNC(SteamAPI_Init)
- LOAD_FUNC(SteamAPI_Shutdown)
- LOAD_FUNC(SteamAPI_RunCallbacks)
- LOAD_FUNC(SteamInternal_CreateInterface)
- LOAD_FUNC(SteamAPI_GetHSteamUser)
- LOAD_FUNC(SteamAPI_GetHSteamPipe)
- LOAD_FUNC(SteamAPI_ISteamClient_GetISteamUserStats)
- LOAD_FUNC(SteamAPI_ISteamUserStats_RequestCurrentStats)
- LOAD_FUNC(SteamAPI_ISteamUserStats_StoreStats)
- LOAD_FUNC(SteamAPI_ISteamUserStats_GetStat)
- LOAD_FUNC(SteamAPI_ISteamUserStats_SetStat)
- LOAD_FUNC(SteamAPI_ISteamUserStats_SetAchievement)
- #undef LOAD_FUNC
-
- if (!SteamAPI_Init())
- {
- printf("Steamworks not initialized!\n");
- ClearPointers();
- return 0;
- }
- steamClient = SteamInternal_CreateInterface(VVVVVV_STEAMCLIENT);
- steamUser = SteamAPI_GetHSteamUser();
- steamPipe = SteamAPI_GetHSteamPipe();
- if (!steamClient || !steamUser || !steamPipe)
- {
- SteamAPI_Shutdown();
- printf(VVVVVV_STEAMCLIENT " not created!\n");
- ClearPointers();
- return 0;
- }
- steamUserStats = SteamAPI_ISteamClient_GetISteamUserStats(
- steamClient,
- steamUser,
- steamPipe,
- VVVVVV_STEAMUSERSTATS
- );
- if (!steamUserStats)
- {
- SteamAPI_Shutdown();
- printf(VVVVVV_STEAMUSERSTATS " not created!\n");
- ClearPointers();
- return 0;
- }
- SteamAPI_ISteamUserStats_RequestCurrentStats(steamUserStats);
return 1;
}