endless-sky: 0.10.10 -> 0.10.12 (#388189)

Co-authored-by: TheGiraffe3 <TheGiraffe3@users.noreply.github.com>
Co-authored-by: Mutsuha Asada <me@momee.mt>
Co-authored-by: Arne Keller <arne.keller@posteo.de>
This commit is contained in:
Loymdayddaud
2025-03-24 16:14:15 +03:00
committed by GitHub
parent 7886d980f8
commit f0b75c41fd
2 changed files with 11 additions and 39 deletions

View File

@@ -12,42 +12,14 @@ index 48fd080..419b40d 100644
# Install the desktop file:
env.Install("$DESTDIR$PREFIX/share/applications", "endless-sky.desktop")
diff --git a/source/Files.cpp b/source/Files.cpp
index de27023e..4225051f 100644
index f5dec21..ad57c55 100644
--- a/source/Files.cpp
+++ b/source/Files.cpp
@@ -108,32 +108,9 @@ void Files::Init(const char * const *argv)
resources = str;
SDL_free(str);
@@ -115,6 +115,7 @@ void Files::Init(const char * const *argv)
else if(IsParent(STANDARD_PATH, resources))
resources = STANDARD_PATH / RESOURCE_PATH;
#endif
+ resources = "%NIXPKGS_RESOURCES_PATH%";
}
-#if defined _WIN32
- FixWindowsSlashes(resources);
-#endif
- if(resources.back() != '/')
- resources += '/';
-#if defined __linux__ || defined __FreeBSD__ || defined __DragonFly__
- // Special case, for Linux: the resource files are not in the same place as
- // the executable, but are under the same prefix (/usr or /usr/local).
- static const string LOCAL_PATH = "/usr/local/";
- static const string STANDARD_PATH = "/usr/";
- static const string RESOURCE_PATH = "share/games/endless-sky/";
- if(!resources.compare(0, LOCAL_PATH.length(), LOCAL_PATH))
- resources = LOCAL_PATH + RESOURCE_PATH;
- else if(!resources.compare(0, STANDARD_PATH.length(), STANDARD_PATH))
- resources = STANDARD_PATH + RESOURCE_PATH;
-#endif
- // If the resources are not here, search in the directories containing this
- // one. This allows, for example, a Mac app that does not actually have the
- // resources embedded within it.
- while(!Exists(resources + "credits.txt"))
- {
- size_t pos = resources.rfind('/', resources.length() - 2);
- if(pos == string::npos || pos == 0)
- throw runtime_error("Unable to find the resource directories!");
- resources.erase(pos + 1);
- }
+
+ resources = "%NIXPKGS_RESOURCES_PATH%";
+
dataPath = resources + "data/";
imagePath = resources + "images/";
soundPath = resources + "sounds/";
// If the resources are not here, search in the directories containing this
// one. This allows, for example, a Mac app that does not actually have the

View File

@@ -14,13 +14,13 @@
stdenv.mkDerivation rec {
pname = "endless-sky";
version = "0.10.10";
version = "0.10.12";
src = fetchFromGitHub {
owner = "endless-sky";
repo = "endless-sky";
rev = "v${version}";
sha256 = "sha256-FjQluOFU+fPr4/3WveScRRabDjD/bq8YmXvCU9w9yo8=";
tag = "v${version}";
hash = "sha256-cT/bklRGQnS9Nm8J0oH1mG20JQOe58FAAHToNDpvPpQ=";
};
patches = [