Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 8 additions & 36 deletions pkgs/by-name/en/endless-sky/fixes.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions pkgs/by-name/en/endless-sky/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down