summaryrefslogtreecommitdiff
path: root/games-arcade/jazz2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-12-20 06:30:59 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-12-20 06:30:59 +0000
commit9097a9c06c0b1e11c7f6579f03e3f32948be3f24 (patch)
treeb5f3d3e52bf13944a9db9e3b33ab3e5cabed496e /games-arcade/jazz2
parentf8bb2d659372d0add11c589dcb006d0b7f8822ae (diff)
gentoo auto-resync : 20:12:2024 - 06:30:59
Diffstat (limited to 'games-arcade/jazz2')
-rw-r--r--games-arcade/jazz2/Manifest7
-rw-r--r--games-arcade/jazz2/files/jazz2-system-source.patch226
-rw-r--r--games-arcade/jazz2/jazz2-0.6.7-r1.ebuild80
-rw-r--r--games-arcade/jazz2/jazz2-3.0.0-r1.ebuild (renamed from games-arcade/jazz2/jazz2-3.0.0.ebuild)33
-rw-r--r--games-arcade/jazz2/metadata.xml2
5 files changed, 243 insertions, 105 deletions
diff --git a/games-arcade/jazz2/Manifest b/games-arcade/jazz2/Manifest
index 3888a5b1c850..13ae6be24426 100644
--- a/games-arcade/jazz2/Manifest
+++ b/games-arcade/jazz2/Manifest
@@ -1,7 +1,6 @@
-DIST jazz2-0.6.7.tar.gz 11031735 BLAKE2B 014ff24c6f5a834a727aaed3760a1e228d9f7d9653dd293e98030c9105cbf15a3b420c2d515605e36187cc833ae892ed30589f1bf821c0b674b883cea216f3f5 SHA512 7172a3ccb367122d1c9bfbd36b76cc3d365024affba9aea5cfa595fd11a9b4dc980e57c1cfdb0d32bc28bb7ecb5f6f5225909697c4c93c43117596f44d80ff8f
+AUX jazz2-system-source.patch 8011 BLAKE2B 6f0aa706eb5a829847ddfd8d0d8e2448fd6bda0fe72e5b1cccc622ec3594d5a020f5563360031cdce67d37c8ccdf3c15ffead627ced53d267273cf163e1e2ac6 SHA512 d145e418048797dcceb666d81048b2ccec1a1ee529656ec2aaf580ac94ee263224bbbe628a7e1824206ef4c91969192646c2aef513059458dbb8c373b0f14cf9
DIST jazz2-2.9.1.tar.gz 3700152 BLAKE2B dee3ada0bfa95294dac9fa2c37019edc20dd9a9f462671dea1d083575bc1f231e013bb5f9076b9163cdf0682a7775932f07050e894dad2f492e65150d47b42dd SHA512 d908a2c24d010122d4c9e2db17ed7392780785ef98799401f960cee41b5dfd9504859e30410e0bcf4678d1a73e5e153f4c46259da672b923cdc8decae25aae1c
DIST jazz2-3.0.0.tar.gz 3781625 BLAKE2B d044d4fe5128eaff45ddf57c5bf9090c279730e7c0b5ddf3951744f6fdd81be09335d3d1c9089f930dadbdac906746686af13791ec8f212fed034afa8e8dd35a SHA512 e643e5b3196020737a9a25929684254becd77cb5ba0715f70c313b1d254e42a2178f082abae5155028ad2ffdf605563a3553e8c7beede3bd6a10c0001c7ecfe7
-EBUILD jazz2-0.6.7-r1.ebuild 1845 BLAKE2B 4e811e21b4a2dfd300d26a676bf040b7c1a632f6f31c403c154b9b55e748b01b9784e45aa1cbd3df2aeaadae2c2038e6e5af6cb5819e36e6141ea294e81bcc8e SHA512 77f9fb6c54b7de2c82149a9cdd1275b494f8243ad6595740ff73e9ae47d23b9cad15f9a18c1b3d7635aa0e1d277414c0bd6b35524c398d77cb79140b622947de
EBUILD jazz2-2.9.1.ebuild 1375 BLAKE2B 8d9480af3599e9204ed15e5d845dc6fdb1afac0f794f91ae8c276568503cda2ebf6f6fbb8ffecc4d3984b5dcd822f437eb73825228e8126044af3db01586e681 SHA512 9de3b8291a4b3188024a6a7f9414479bcc79c3e58282abe2354bee9fe57a632230158ec624cdd66616ec84124d88279cec8ca4dc9a09d31ea3654844436d6e31
-EBUILD jazz2-3.0.0.ebuild 1375 BLAKE2B 8d9480af3599e9204ed15e5d845dc6fdb1afac0f794f91ae8c276568503cda2ebf6f6fbb8ffecc4d3984b5dcd822f437eb73825228e8126044af3db01586e681 SHA512 9de3b8291a4b3188024a6a7f9414479bcc79c3e58282abe2354bee9fe57a632230158ec624cdd66616ec84124d88279cec8ca4dc9a09d31ea3654844436d6e31
-MISC metadata.xml 534 BLAKE2B d4854038d3768cbe033bb6e22fcdf81f0f964d8c08a0e46dc33f033bac741609903a64fd551a8ce742d18a9427bc11790772571d78de15458435230645b9b9d7 SHA512 ba8a143912432f5c8d4f0e698e59463cbf9b5c601ec95ac499938efa21c489d8dd070ef879dc68526c7ec5f3fdacef03cf7dd14a1eb368c9fc9d464c4fd6dac2
+EBUILD jazz2-3.0.0-r1.ebuild 1438 BLAKE2B ce526a2311125a4edd81cae7698d97150a373908d57d941cf27f58b48b98eadb14792a18c5ffe3f2a186bdfadca6580f53083e10f5f6c70d3838e7242ed2f5a1 SHA512 0e71a29aac688c61e7475cc404dcc4c96b02fd81bfee5b00284ae886c40e8572894e4694210b5853c36fd815e3a0e94e76bfa596e78e8214580d3c793e756dc4
+MISC metadata.xml 414 BLAKE2B 9716f311ace4344f688bb88c3622cd73319950e6e7bd9ee7cc92219a213b7ce371e580855a539f27b0146eb1173304611ca56a57e78175157bda3acdb3a840c2 SHA512 8b848c69a6225b27e8a884f1ab92b50efa0c9bc235cae6ee792565acbd6c04e45f74d09c47ae53619381094aaa9093ee5d44205837336bf14bf68cd4cdd2aad4
diff --git a/games-arcade/jazz2/files/jazz2-system-source.patch b/games-arcade/jazz2/files/jazz2-system-source.patch
new file mode 100644
index 000000000000..35cbb3a9d9c3
--- /dev/null
+++ b/games-arcade/jazz2/files/jazz2-system-source.patch
@@ -0,0 +1,226 @@
+diff --git a/README.md b/README.md
+index fe466e50..e91dd4ed 100644
+--- a/README.md
++++ b/README.md
+@@ -46,7 +46,7 @@ Jazz² Resurrection is reimplementation of the game **Jazz Jackrabbit 2** releas
+ * Install dependencies: `sudo apt install libglew2.2 libglfw3 libsdl2-2.0-0 libopenal1 libvorbisfile3 libopenmpt0`
+ * Alternatively, install provided `.deb` or `.rpm` package and dependencies should be installed automatically
+ * Copy contents of original *Jazz Jackrabbit 2* directory to `‹Game›/Source/`
+- * If packages are used, the files must be copied to `~/.local/share/Jazz² Resurrection/Source/` instead
++ * If packages are used, the files must be copied to `~/.local/share/Jazz² Resurrection/Source/` or `/usr/local/share/Jazz² Resurrection/Source/` instead, please follow instructions of specific package
+ * Run `‹Game›/jazz2` or `‹Game›/jazz2_sdl2` application
+ * If packages are used, the game should be visible in application list
+
+diff --git a/Sources/Common.h b/Sources/Common.h
+index 865d42bb..cf6f112c 100644
+--- a/Sources/Common.h
++++ b/Sources/Common.h
+@@ -33,6 +33,10 @@
+
+ #include <stdlib.h>
+
++#if !defined(NCINE_INSTALL_PREFIX) && defined(DEATH_TARGET_UNIX)
++# define NCINE_INSTALL_PREFIX "/usr/local"
++#endif
++
+ // Check platform-specific capabilities
+ #if defined(WITH_SDL) || defined(DEATH_TARGET_WINDOWS_RT)
+ # define NCINE_HAS_GAMEPAD_RUMBLE
+diff --git a/Sources/Jazz2/ContentResolver.cpp b/Sources/Jazz2/ContentResolver.cpp
+index 737582db..a7c5d460 100644
+--- a/Sources/Jazz2/ContentResolver.cpp
++++ b/Sources/Jazz2/ContentResolver.cpp
+@@ -207,7 +207,7 @@ namespace Jazz2
+ # elif defined(NCINE_OVERRIDE_CONTENT_PATH)
+ _contentPath = NCINE_OVERRIDE_CONTENT_PATH;
+ # else
+- _contentPath = "/usr/share/" NCINE_LINUX_PACKAGE "/Content/";
++ _contentPath = NCINE_INSTALL_PREFIX "/share/" NCINE_LINUX_PACKAGE "/Content/";
+ # endif
+ # if defined(NCINE_PACKAGED_CONTENT_PATH)
+ // If Content is packaged with binaries, always use standard XDG paths for everything else
+@@ -226,18 +226,25 @@ namespace Jazz2
+ auto localStorage = fs::GetLocalStorage();
+ if (!localStorage.empty()) {
+ // Use "$XDG_DATA_HOME/Jazz² Resurrection/" if exists (for backward compatibility), otherwise "$XDG_DATA_HOME/{NCINE_LINUX_PACKAGE}/"
+- _sourcePath = fs::CombinePath(localStorage, "Jazz² Resurrection/Source/"_s);
+- if (fs::DirectoryExists(_sourcePath)) {
+- _cachePath = fs::CombinePath(localStorage, "Jazz² Resurrection/Cache/"_s);
+- } else {
++ _cachePath = fs::CombinePath(localStorage, "Jazz² Resurrection/Cache/"_s);
++ if (!fs::DirectoryExists(_cachePath)) {
+ auto appData = fs::CombinePath(localStorage, NCINE_LINUX_PACKAGE);
+- _sourcePath = fs::CombinePath(appData, "Source/"_s);
+ _cachePath = fs::CombinePath(appData, "Cache/"_s);
+ }
+ } else {
+- _sourcePath = "Source/"_s;
+ _cachePath = "Cache/"_s;
+ }
++
++ // Prefer system-wide Source only if it exists and local one doesn't exist
++ _sourcePath = fs::CombinePath(fs::GetDirectoryName(_cachePath), "Source/"_s);
++ if (!fs::FindPathCaseInsensitive(fs::CombinePath(_sourcePath, "Anims.j2a"_s)) &&
++ !fs::FindPathCaseInsensitive(fs::CombinePath(_sourcePath, "AnimsSw.j2a"_s))) {
++ auto systemWideSource = NCINE_INSTALL_PREFIX "/share/" NCINE_LINUX_PACKAGE "/Source/";
++ if (fs::FindPathCaseInsensitive(fs::CombinePath(systemWideSource, "Anims.j2a"_s)) ||
++ fs::FindPathCaseInsensitive(fs::CombinePath(systemWideSource, "AnimsSw.j2a"_s))) {
++ _sourcePath = systemWideSource;
++ }
++ }
+ } else {
+ // Fallback to relative paths
+ _contentPath = "Content/"_s;
+diff --git a/Sources/Shared/IO/FileSystem.cpp b/Sources/Shared/IO/FileSystem.cpp
+index 5b5199b0..0d4850bd 100644
+--- a/Sources/Shared/IO/FileSystem.cpp
++++ b/Sources/Shared/IO/FileSystem.cpp
+@@ -701,73 +701,91 @@ namespace Death { namespace IO {
+ #if !defined(DEATH_TARGET_WINDOWS) && !defined(DEATH_TARGET_SWITCH)
+ String FileSystem::FindPathCaseInsensitive(const StringView path)
+ {
+- if (Exists(path)) {
++ if (path.empty() || Exists(path)) {
+ return path;
+ }
+
+- std::size_t l = path.size();
+- char* p = (char*)alloca(l + 1);
+- strncpy(p, path.data(), l);
+- p[l] = '\0';
+- std::size_t rl = 0;
+- bool isAbsolute = (p[0] == '/' || p[0] == '\\');
++ DIR* d = nullptr;
++ String result = path;
++ MutableStringView partialResult = result;
++ char* nextPartBegin;
+
+- String result(NoInit, path.size() + (isAbsolute ? 0 : 2));
++ while (MutableStringView separator = partialResult.findLast('/')) {
++ if DEATH_UNLIKELY(separator.begin() == result.begin()) {
++ // Nothing left, only first slash of absolute path
++ break;
++ }
+
+- DIR* d;
+- if (isAbsolute) {
+- d = ::opendir("/");
+- p = p + 1;
+- } else {
+- d = ::opendir(".");
+- result[0] = '.';
+- result[1] = '\0';
+- rl = 1;
++ partialResult = partialResult.prefix(separator.begin());
++ separator[0] = '\0';
++ d = ::opendir(result.data());
++ separator[0] = '/';
++ if (d != nullptr) {
++ nextPartBegin = separator.end();
++ break;
++ }
+ }
+
+- bool last = false;
+- char* c = strsep(&p, "/");
+- while (c) {
+- if (d == nullptr) {
+- return {};
++ if (d == nullptr) {
++ if (result[0] == '/' || result[0] == '\\') {
++ d = ::opendir("/");
++ nextPartBegin = result.begin() + 1;
++ } else {
++ d = ::opendir(".");
++ nextPartBegin = result.begin();
+ }
+
+- if (last) {
+- ::closedir(d);
++ if DEATH_UNLIKELY(d == nullptr) {
+ return {};
+ }
++ }
++
++ while (true) {
++ partialResult = result.suffix(nextPartBegin);
++ MutableStringView nextSeparator = partialResult.findOr('/', result.end());
++ if DEATH_UNLIKELY(nextSeparator.begin() == nextPartBegin) {
++ // Skip empty parts
++ nextPartBegin = nextSeparator.end();
++ continue;
++ }
+
+- result[rl] = '/';
+- rl += 1;
+- result[rl] = '\0';
++ bool hasNextSeparator = (nextSeparator.begin() != result.end());
++ if DEATH_LIKELY(hasNextSeparator) {
++ nextSeparator[0] = '\0';
++ }
+
+ struct dirent* entry = ::readdir(d);
+ while (entry != nullptr) {
+- if (::strcasecmp(c, entry->d_name) == 0) {
+- strcpy(&result[rl], entry->d_name);
+- rl += strlen(entry->d_name);
+-
++ if (::strcasecmp(partialResult.begin(), entry->d_name) == 0) {
++ std::size_t fileNameLength = std::strlen(entry->d_name);
++ DEATH_DEBUG_ASSERT(partialResult.begin() + fileNameLength == nextSeparator.begin());
++ std::memcpy(partialResult.begin(), entry->d_name, fileNameLength);
+ ::closedir(d);
++
++ nextPartBegin = nextSeparator.end();
++ if (!hasNextSeparator || nextPartBegin == result.end()) {
++ if (hasNextSeparator) {
++ nextSeparator[0] = '/';
++ }
++ return result;
++ }
++
+ d = ::opendir(result.data());
++ if DEATH_UNLIKELY(d == nullptr) {
++ return {};
++ }
++ nextSeparator[0] = '/';
+ break;
+ }
+
+ entry = ::readdir(d);
+ }
+
+- if (entry == nullptr) {
+- strcpy(&result[rl], c);
+- rl += strlen(c);
+- last = true;
++ if DEATH_UNLIKELY(entry == nullptr) {
++ ::closedir(d);
++ return {};
+ }
+-
+- c = strsep(&p, "/");
+ }
+-
+- if (d != nullptr) {
+- ::closedir(d);
+- }
+- return result;
+ }
+ #endif
+
+diff --git a/cmake/ncine_compiler_options.cmake b/cmake/ncine_compiler_options.cmake
+index 9ca461ad..6d981fdc 100644
+--- a/cmake/ncine_compiler_options.cmake
++++ b/cmake/ncine_compiler_options.cmake
+@@ -10,6 +10,10 @@ target_compile_definitions(${NCINE_APP} PUBLIC "NCINE_VERSION=\"${NCINE_VERSION}
+ string(TIMESTAMP NCINE_BUILD_YEAR "%Y")
+ target_compile_definitions(${NCINE_APP} PUBLIC "NCINE_BUILD_YEAR=\"${NCINE_BUILD_YEAR}\"")
+
++if(UNIX)
++ target_compile_definitions(${NCINE_APP} PUBLIC "NCINE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
++endif()
++
+ if(NCINE_OVERRIDE_CONTENT_PATH)
+ message(STATUS "Using overriden `Content` path: ${NCINE_OVERRIDE_CONTENT_PATH}")
+ target_compile_definitions(${NCINE_APP} PUBLIC "NCINE_OVERRIDE_CONTENT_PATH=\"${NCINE_OVERRIDE_CONTENT_PATH}\"")
diff --git a/games-arcade/jazz2/jazz2-0.6.7-r1.ebuild b/games-arcade/jazz2/jazz2-0.6.7-r1.ebuild
deleted file mode 100644
index f9190a49885f..000000000000
--- a/games-arcade/jazz2/jazz2-0.6.7-r1.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit desktop dotnet wrapper
-
-DESCRIPTION="Open source reimplementation of Jazz Jackrabbit 2"
-HOMEPAGE="http://deat.tk/jazz2/"
-SRC_URI="https://github.com/deathkiller/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
-LICENSE="GPL-3"
-SLOT="0/${PV}"
-KEYWORDS="~amd64"
-IUSE="gles2-only server"
-
-RDEPEND="
- dev-lang/mono
- media-libs/libglvnd
- media-libs/libopenmpt
- media-libs/libsdl2[video]
- media-libs/openal
-"
-
-FRAMEWORK="4.5.2"
-DIR="/usr/share/${PN}"
-
-src_prepare() {
- default
-
- # Android/WASM only.
- rm -r Content/Shaders.ES30/ || die
-
- if use gles2-only; then
- rm -r Content/Shaders/ || die
- mv Content/_ES20/* Content/ || die
- else
- rm -r Content/_ES20/ || die
- fi
-}
-
-src_compile() {
- local TARGET
-
- MAIN_TARGETS="Jazz2 $(usex server Jazz2.Server '') Tools/Import"
- EXT_TARGETS="OpenTKBackend $(usex gles2-only Es20Backend GL21Backend)"
-
- for TARGET in ${MAIN_TARGETS}; do
- cd "${S}/${TARGET}" || die
- exbuild "${TARGET##*/}.csproj"
- done
-
- for TARGET in ${EXT_TARGETS}; do
- cd "${S}/Extensions/${TARGET}" || die
- exbuild "${TARGET##*/}.csproj"
- done
-}
-
-src_install() {
- local TARGET
-
- insinto "${DIR}"
- # TODO: Package OpenTK.
- doins -r Content/ Packages/AdamsLair.OpenTK.*/lib/net*/*
-
- for TARGET in ${MAIN_TARGETS}; do
- doins "${TARGET}/Bin/Release/${TARGET##*/}.exe"
- done
-
- insinto "${DIR}"/Extensions
- for TARGET in ${EXT_TARGETS}; do
- doins "Extensions/${TARGET}/Jazz2/Bin/Release/Extensions/${TARGET}.core.dll"
- done
-
- make_wrapper ${PN} "mono '${EPREFIX}${DIR}/Jazz2.exe'"
- make_wrapper ${PN}-import "mono '${EPREFIX}${DIR}/Import.exe'"
- use server && make_wrapper ${PN}-server "mono '${EPREFIX}${DIR}/Jazz2.Server.exe'"
-
- newicon Jazz2/Icon.ico ${PN}.ico
- make_desktop_entry ${PN} "Jazz² Resurrection" ${PN}.ico
-}
diff --git a/games-arcade/jazz2/jazz2-3.0.0.ebuild b/games-arcade/jazz2/jazz2-3.0.0-r1.ebuild
index 4a7c0ac77fc6..ba50e47ce088 100644
--- a/games-arcade/jazz2/jazz2-3.0.0.ebuild
+++ b/games-arcade/jazz2/jazz2-3.0.0-r1.ebuild
@@ -3,17 +3,11 @@
EAPI=8
-inherit cmake xdg-utils
+inherit cmake optfeature prefix xdg
DESCRIPTION="Open source reimplementation of Jazz Jackrabbit 2"
-HOMEPAGE="
- https://deat.tk/jazz2/
- https://github.com/deathkiller/jazz2-native
-"
-SRC_URI="
- https://github.com/deathkiller/jazz2-native/archive/refs/tags/${PV}.tar.gz
- -> ${P}.tar.gz
-"
+HOMEPAGE="https://deat.tk/jazz2/"
+SRC_URI="https://github.com/deathkiller/jazz2-native/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${PN}-native-${PV}"
LICENSE="GPL-3"
@@ -22,8 +16,8 @@ KEYWORDS="~amd64"
IUSE="+openal sdl"
DEPEND="
- sys-libs/zlib:=
media-libs/libglvnd
+ sys-libs/zlib:=
openal? (
media-libs/libopenmpt
media-libs/openal
@@ -33,16 +27,20 @@ DEPEND="
"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${PN}-system-source.patch
+)
+
src_prepare() {
+ cmake_src_prepare
+ hprefixify Sources/Shared/Environment.cpp
+
# We need to install README.md to a different directory, default
# src_install will handle that.
sed -i '/README_INSTALL_DESTINATION/d' cmake/ncine_installation.cmake || die
- cmake_src_prepare
}
src_configure() {
- local backend=GLFW
- use sdl && backend=SDL2
local mycmakeargs=(
-DNCINE_LINUX_PACKAGE="${PN}"
@@ -54,7 +52,7 @@ src_configure() {
-DNCINE_WITH_GLEW=OFF
- -DNCINE_PREFERRED_BACKEND=${backend}
+ -DNCINE_PREFERRED_BACKEND=$(usex sdl SDL2 GLFW)
-DNCINE_WITH_AUDIO=$(usex openal)
)
@@ -62,9 +60,6 @@ src_configure() {
}
pkg_postinst() {
- xdg_icon_cache_update
-}
-
-pkg_postrm() {
- xdg_icon_cache_update
+ xdg_pkg_postinst
+ optfeature "game data unless you want to install it manually" ${CATEGORY}/${PN}-data
}
diff --git a/games-arcade/jazz2/metadata.xml b/games-arcade/jazz2/metadata.xml
index 39f3565c770c..4a5c41fe6a64 100644
--- a/games-arcade/jazz2/metadata.xml
+++ b/games-arcade/jazz2/metadata.xml
@@ -6,11 +6,9 @@
<name>Gentoo Games Project</name>
</maintainer>
<upstream>
- <remote-id type="github">deathkiller/jazz2</remote-id>
<remote-id type="github">deathkiller/jazz2-native</remote-id>
</upstream>
<use>
- <flag name="server">Build the multiplayer game server</flag>
<flag name="sdl">Prefer SDL2 over GLFW backend</flag>
</use>
</pkgmetadata>