diff --git a/games/vvvvvv/Makefile b/games/vvvvvv/Makefile index 3b6730410585..d9fb4e25c4b3 100644 --- a/games/vvvvvv/Makefile +++ b/games/vvvvvv/Makefile @@ -1,33 +1,59 @@ # Created by: Emmanuel Vadot PORTNAME= VVVVVV -PORTVERSION= v2.2 +DISTVERSION= 2.3.6 CATEGORIES= games +.if ${FLAVOR:U} == makeandplay +# The data file may only be distributed if the MAKEANDPLAY define is set. +# See https://github.com/TerryCavanagh/VVVVVV/blob/master/License%20exceptions.md +MASTER_SITES= https://thelettervsixtim.es/makeandplay/data.zip?dummy=/:datafile +DISTFILES= VVVVVV-data-${DISTVERSION}.zip:datafile +EXTRACT_ONLY= ${GH_ACCOUNT}-${GH_PROJECT}-${DISTVERSION}_GH0.tar.gz +.endif MAINTAINER= manu@FreeBSD.org COMMENT= 2D Platformer game -LICENSE= UNKNOWN -LICENSE_NAME= unknown -LICENSE_FILE= ${WRKSRC}/../LICENSE.md -LICENSE_PERMS= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept +LICENSE= VVVVVV BSD3CLAUSE +LICENSE_COMB= multi +LICENSE_NAME_VVVVVV= VVVVVV Source Code License v1.0 +LICENSE_FILE_VVVVVV= ${WRKSRC}/../LICENSE.md +LICENSE_FILE_BSD3CLAUSE= ${WRKSRC}/../third_party/lodepng/LICENSE.txt +LICENSE_PERMS_VVVVVV= dist-mirror no-dist-sell pkg-mirror no-pkg-sell auto-accept -ONLY_FOR_ARCHS= amd64 powerpc64 powerpc64le +.if defined(NO_LICENSES_INSTALL) +IGNORE= license requires that the license be shipped +.endif + +BUILD_DEPENDS= utf8cpp>0:devel/utf8cpp +LIB_DEPENDS= libtinyxml2.so:textproc/tinyxml2 \ + libphysfs.so:devel/physfs + +FLAVORS= commercial makeandplay +makeandplay_PKGNAMESUFFIX= -makeandplay USES= sdl cmake localbase:ldflags USE_GITHUB= yes GH_ACCOUNT= TerryCavanagh GH_PROJECT= ${PORTNAME} -GH_TAGNAME= cb3640e5 - -WRKSRC_SUBDIR= desktop_version - USE_SDL= sdl2 mixer2 -PLIST_FILES= bin/vvvvvv +CFLAGS+= -DASSETSPATH='\"${DATADIR}/data.zip\"' +CMAKE_OFF= BUNDLE_DEPENDENCIES +.if ${FLAVOR:U} == makeandplay +CMAKE_ON= MAKEANDPLAY +.endif + +WRKSRC_SUBDIR= desktop_version +PLIST_FILES= bin/VVVVVV${PKGNAMESUFFIX} \ + ${"${FLAVOR}"=="makeandplay:?${DATADIR_REL}/data.zip:} +SUB_FILES= pkg-message do-install: - ${INSTALL_PROGRAM} ${WRKDIR}/.build/vvvvvv.x86_64 ${STAGEDIR}${PREFIX}/bin/vvvvvv - @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/vvvvvv + ${INSTALL_PROGRAM} ${WRKDIR}/.build/VVVVVV ${STAGEDIR}${PREFIX}/bin/VVVVVV${PKGNAMESUFFIX} +.if ${FLAVOR:U} == makeandplay + ${MKDIR} ${STAGEDIR}${DATADIR} + ${INSTALL_DATA} ${DISTDIR}/VVVVVV-data-${DISTVERSION}.zip ${STAGEDIR}${DATADIR}/data.zip +.endif .include diff --git a/games/vvvvvv/distinfo b/games/vvvvvv/distinfo index 2d11675cb41a..cbd7b9ea84fb 100644 --- a/games/vvvvvv/distinfo +++ b/games/vvvvvv/distinfo @@ -1,3 +1,5 @@ -TIMESTAMP = 1578694479 -SHA256 (TerryCavanagh-VVVVVV-v2.2-cb3640e5_GH0.tar.gz) = d936ad517ef9b8236148cd8161201d23f55b98dc6a03f3b2763612abb11a1615 -SIZE (TerryCavanagh-VVVVVV-v2.2-cb3640e5_GH0.tar.gz) = 827825 +TIMESTAMP = 1640682897 +SHA256 (VVVVVV-data-2.3.6.zip) = 6fae3cdec06062d05827d4181c438153f3ea3900437a44db73bcd29799fe57e0 +SIZE (VVVVVV-data-2.3.6.zip) = 61404595 +SHA256 (TerryCavanagh-VVVVVV-2.3.6_GH0.tar.gz) = a3366aab9e8462d330044ab1ec63927e9f5c3801c0ed96b24f08c553dcb911e9 +SIZE (TerryCavanagh-VVVVVV-2.3.6_GH0.tar.gz) = 1725842 diff --git a/games/vvvvvv/files/patch-CMakeLists.txt b/games/vvvvvv/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..0927b9a29e55 --- /dev/null +++ b/games/vvvvvv/files/patch-CMakeLists.txt @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2021-12-22 13:20:25 UTC ++++ CMakeLists.txt +@@ -181,7 +181,7 @@ if(APPLE) + endif() + set(PNG_SRC ../third_party/lodepng/lodepng.c) + +-if(NOT OFFICIAL_BUILD) ++if(FALSE) + # Add interim commit hash and its date to the build + + # find_package sets GIT_FOUND and GIT_EXECUTABLE diff --git a/games/vvvvvv/files/patch-src_FileSystemUtils.cpp b/games/vvvvvv/files/patch-src_FileSystemUtils.cpp index 5bb4437be5bc..a93f7e9e794d 100644 --- a/games/vvvvvv/files/patch-src_FileSystemUtils.cpp +++ b/games/vvvvvv/files/patch-src_FileSystemUtils.cpp @@ -1,15 +1,29 @@ ---- src/FileSystemUtils.cpp.orig 2020-01-10 22:11:00 UTC +--- src/FileSystemUtils.cpp.orig 2021-12-22 13:20:25 UTC +++ src/FileSystemUtils.cpp -@@ -73,6 +73,12 @@ int FILESYSTEM_init(char *argvZero) - #ifdef _WIN32 - strcpy(output, PHYSFS_getBaseDir()); - strcat(output, "data.zip"); -+#elif defined(__FreeBSD__) -+ PLATFORM_getOSDirectory(output); -+ if (strlcat(output, "data.zip", sizeof(output)) >= sizeof(output)) { -+ puts("Cannot find location for data.zip\n"); -+ return 0; +@@ -1,3 +1,4 @@ ++#include + #include + #include + #include +@@ -154,6 +155,12 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, cha + } + + /* Mount the stock content last */ ++ if (assetsPath && access(assetsPath, R_OK) == -1) { ++ printf("%s: %s\n", assetsPath, strerror(errno)); ++ printf("Trying %sdata.zip instead.\n", output); ++ assetsPath = NULL; + } - #else - strcpy(output, "data.zip"); - #endif ++ + if (assetsPath) + { + SDL_strlcpy(output, assetsPath, sizeof(output)); +@@ -161,7 +168,7 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, cha + else + { + SDL_snprintf(output, sizeof(output), "%s%s", +- basePath, ++ output, + "data.zip" + ); + } diff --git a/games/vvvvvv/files/patch-src_main.cpp b/games/vvvvvv/files/patch-src_main.cpp new file mode 100644 index 000000000000..437afa0e181f --- /dev/null +++ b/games/vvvvvv/files/patch-src_main.cpp @@ -0,0 +1,11 @@ +--- src/main.cpp.orig 2021-12-28 09:43:31 UTC ++++ src/main.cpp +@@ -342,7 +342,7 @@ static void cleanup(void); + int main(int argc, char *argv[]) + { + char* baseDir = NULL; +- char* assetsPath = NULL; ++ char* assetsPath = (char*)ASSETSPATH; + + for (int i = 1; i < argc; ++i) + { diff --git a/games/vvvvvv/files/pkg-message.in b/games/vvvvvv/files/pkg-message.in new file mode 100644 index 000000000000..27aa099f8126 --- /dev/null +++ b/games/vvvvvv/files/pkg-message.in @@ -0,0 +1,12 @@ +[ +{ type: install + message: <