summaryrefslogtreecommitdiff
path: root/games-arcade
diff options
context:
space:
mode:
Diffstat (limited to 'games-arcade')
-rw-r--r--games-arcade/Manifest.gzbin20094 -> 20095 bytes
-rw-r--r--games-arcade/jazz2-data/Manifest5
-rw-r--r--games-arcade/jazz2-data/jazz2-data-0-r20200327.ebuild81
-rw-r--r--games-arcade/jazz2-data/jazz2-data-0-r20241219.ebuild64
-rw-r--r--games-arcade/jazz2-data/metadata.xml3
-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
10 files changed, 309 insertions, 192 deletions
diff --git a/games-arcade/Manifest.gz b/games-arcade/Manifest.gz
index 57eef761e21e..d7286ed5ab5c 100644
--- a/games-arcade/Manifest.gz
+++ b/games-arcade/Manifest.gz
Binary files differ
diff --git a/games-arcade/jazz2-data/Manifest b/games-arcade/jazz2-data/Manifest
index 959e471bfae5..a76f23770c07 100644
--- a/games-arcade/jazz2-data/Manifest
+++ b/games-arcade/jazz2-data/Manifest
@@ -1,6 +1,5 @@
DIST jazz2-shareware-demo.zip 7658261 BLAKE2B b2b4412cd62feba07878a091a2a47d432a10d09f5f552eeb49095938d9ca6f97e94ab31e9cc8545019d9bdd8e5f97270dd9c1b25ba2099b260ff731dee5847c6 SHA512 208aedbb581f001c8215932166c71e5a160c70af6343d06aa35211558f898f18c47f066c896f016372aaefc8dbc495bc28ace18ce5fcbb729a9d2444a445d9ce
-DIST jj2plus-v1.zip 153487 BLAKE2B 49867cd3d30ee26e8795a7983657f7092710d43b0b8f083853bd0284fc5e1917954951a796747f4700ab43f82633886eb7fa229950fcc003c798f24fd9c33209 SHA512 139b8f98a6c4b8bb7067893e4387af540e7c15d1e633c5f964d7a6ae64320ad1a432434403a74aa4b4af36e3d4eb5245e74ade395ea473c8fd2e3fc37cef06a5
DIST setup_jazz_jackrabbit_2_1.24hf_(16886).exe 58050816 BLAKE2B 6a6492aedc3d7387e5ef5bfc641d54c46dbe850f65f9269268c962cf963164dcd98c2f2651e9dc3b7c2d0ea9ea00836e9cc1332a158b08c34f8fa9fbfb44859e SHA512 df6fc47abf24aaa1895df5f897f698b53865fdc499e2454e07b273eddc8fcdeeebe8fc2992292fb27e077da252d3d5728823ce6a2e83412c150fb8742a52116f
DIST setup_jazz_jackrabbit_2_cc_1.2x_(16742).exe 57273872 BLAKE2B 85cd51fbe706bd6a040931d084102cf46c13d3508653ac429f721b93b8bcef131bea688a1d49cc6e789fa108fed5611e2bd476a2f50ceee4ac0c16531d49795a SHA512 fafce9bb318903970b8ba8e3c08cd261c748180158c162db4f67408d12b436a1a091b2423e2df0859e6c65df5ffe1e7e07d370089b6ebf70f8fc32ff5c260a86
-EBUILD jazz2-data-0-r20200327.ebuild 1833 BLAKE2B 3c9ddcb372f67f6219dbcfc196eb37fd8e7a9c319a2056331b6b1d1eaf92f250b525b62d0ee97cffb2053ffc863f667b3f5a9c6c8f1a2db68bc527938c4ff363 SHA512 e9bc4994484521dc737e1bff89321b227bd4f8267d6a88409867bc887b3a3dea4dc0a3d7b44800bcbc75209f292f255ac63274974a789bc4b50f986b0c76488c
-MISC metadata.xml 512 BLAKE2B d56ac98f2d1c8bfc9b0d34083033d8bf273b320102b9e3d38771894bfd799476e26bf75e19c223eea5b99d66b9d353d955007d44f9a3a6315ae2c363576a6e53 SHA512 87ddcda53963aa6d37fb9d407488f9e93ac713d635420bf14248d7a390e646b5d417ce6a9b71eec2336c780f9c750ba572faf0b8b8b9778c3b02d8e80ae84f23
+EBUILD jazz2-data-0-r20241219.ebuild 1256 BLAKE2B e9383c3e626108dab33ca51bb94adf204cb17b3c1d57a3f03246e6e2dd7d227e2f635182937c7e4348172c4e6914a39e68284c9aec351b2e3e6c372ad4956d4a SHA512 59dcd4d202b578e249e1b5e0eb48e103a7ac274afac2015bb0adaf88ee54915b5a5d6b014dcc0c932c193f6c3537963e79f0c06039b14e3b084958c99c1aedc6
+MISC metadata.xml 430 BLAKE2B 976efec639b4a3100ddc48c941e5a94974b9383002f39db906e45fb352583653a0085416fd6b784c5683b06689fa3c026778d0ea55940b4e16bb833527548e49 SHA512 08e3c6cc2f1dcd2d0becedec881c974e1bdcb3111e1c4f8aa5cd7679355178ca022084a69391bf2da3b6cccc9e714b00404d316ac01d8d1b1bdca806c594563f
diff --git a/games-arcade/jazz2-data/jazz2-data-0-r20200327.ebuild b/games-arcade/jazz2-data/jazz2-data-0-r20200327.ebuild
deleted file mode 100644
index ecb870298485..000000000000
--- a/games-arcade/jazz2-data/jazz2-data-0-r20200327.ebuild
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 1999-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-DEATTK="http://deat.tk/jazz2/misc"
-JJ2PLUS="${DEATTK}/jj2plus-v1.zip"
-
-DESCRIPTION="Jazz Jackrabbit 2 data files imported for games-arcade/jazz2"
-HOMEPAGE="https://www.gog.com/game/jazz_jackrabbit_2_collection"
-
-# Order is significant!
-SRC_URI="
- ${JJ2PLUS}
- demo? (
- ${DEATTK}/shareware-demo.zip -> jazz2-shareware-demo.zip
- )
- !demo? (
- cc? ( setup_jazz_jackrabbit_2_cc_1.2x_(16742).exe )
- setup_jazz_jackrabbit_2_1.24hf_(16886).exe
- )
-"
-
-LICENSE="free-noncomm GOG-EULA"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="+cc demo gles2-only"
-RESTRICT="!demo? ( bindist fetch )"
-
-# jazz2-import is available only before version 1.0.0
-RDEPEND="<games-arcade/jazz2-1:=[gles2-only=]"
-
-BDEPEND="
- ${RDEPEND}
- app-arch/unzip
- !demo? ( app-arch/innoextract )
-"
-
-DIR="/usr/share/jazz2"
-S="${WORKDIR}"
-
-pkg_nofetch() {
- local a
- einfo "Please place the following files in your distfiles directory."
- einfo
- einfo " Go to https://www.gog.com/game/jazz_jackrabbit_2_collection,"
- einfo " purchase the game, and download:"
- for a in ${A}; do
- [[ ${SRC_URI} == */${a}* ]] && continue
- einfo " - ${a}"
- done
- einfo
- einfo " You must also download:"
- einfo " - ${JJ2PLUS}"
-}
-
-src_unpack() {
- ln -snf "${DISTDIR}/${JJ2PLUS##*/}" || die
-
- if use demo; then
- ln -snf "${DISTDIR}"/jazz2-shareware-demo.zip shareware-demo.zip || die
- else
- local EXE
- for EXE in ${A}; do
- [[ ${EXE} == *.exe ]] || continue
- innoextract -e -s -p0 -I app -d "${EXE}" "${DISTDIR}/${EXE}" || die
- done
- fi
-}
-
-src_install() {
- if use demo; then
- jazz2-import /no-wait /output "${ED}${DIR}" || die
- else
- local EXE
- for EXE in ${A}; do
- [[ ${EXE} == *.exe ]] || continue
- jazz2-import /no-wait /output "${ED}${DIR}" "${EXE}"/app || die
- done
- fi
-}
diff --git a/games-arcade/jazz2-data/jazz2-data-0-r20241219.ebuild b/games-arcade/jazz2-data/jazz2-data-0-r20241219.ebuild
new file mode 100644
index 000000000000..50ae121bfcfd
--- /dev/null
+++ b/games-arcade/jazz2-data/jazz2-data-0-r20241219.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit estack
+
+DESCRIPTION="Jazz Jackrabbit 2 data files for games-arcade/jazz2"
+HOMEPAGE="https://www.gog.com/game/jazz_jackrabbit_2_collection"
+
+# Order is significant!
+SRC_URI="
+ demo? (
+ https://deat.tk/jazz2/misc/shareware-demo.zip -> jazz2-shareware-demo.zip
+ )
+ !demo? (
+ setup_jazz_jackrabbit_2_1.24hf_(16886).exe
+ cc? ( setup_jazz_jackrabbit_2_cc_1.2x_(16742).exe )
+ )
+"
+
+S="${WORKDIR}/app"
+LICENSE="free-noncomm GOG-EULA"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+cc demo"
+RESTRICT="!demo? ( bindist fetch )"
+
+RDEPEND=">=games-arcade/jazz2-3.0.0-r1"
+
+BDEPEND="
+ demo? ( app-arch/unzip )
+ !demo? ( app-arch/innoextract )
+"
+
+DIR="/usr/share/jazz2"
+
+pkg_nofetch() {
+ einfo "Please buy and download the following files from"
+ einfo "${HOMEPAGE}."
+ einfo
+ local EXE
+ for EXE in ${A}; do
+ einfo " - ${EXE}"
+ done
+}
+
+src_unpack() {
+ if use demo; then
+ unzip -qoL -d app "${DISTDIR}/${A}" || die
+ else
+ local EXE
+ for EXE in ${A}; do
+ innoextract -e -s -p0 -L -I app "${DISTDIR}/${EXE}" || die
+ done
+ fi
+}
+
+src_install() {
+ eshopts_push -s nullglob
+ insinto /usr/share/jazz2/Source
+ doins -r *.j?? *.it *.mod *.s3m tiles*/
+ eshopts_pop
+}
diff --git a/games-arcade/jazz2-data/metadata.xml b/games-arcade/jazz2-data/metadata.xml
index aa4c2459df1a..fcd190be0a62 100644
--- a/games-arcade/jazz2-data/metadata.xml
+++ b/games-arcade/jazz2-data/metadata.xml
@@ -5,9 +5,6 @@
<email>games@gentoo.org</email>
<name>Gentoo Games Project</name>
</maintainer>
- <upstream>
- <remote-id type="github">deathkiller/jazz2</remote-id>
- </upstream>
<use>
<flag name="cc">Install The Christmas Chronicles additional data</flag>
<flag name="demo">Use the free demo data instead of the full retail game data</flag>
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>