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>

authored by

Loymdayddaud
TheGiraffe3
Mutsuha Asada
Arne Keller
and committed by
GitHub
f0b75c41 7886d980

+11 -39
+8 -36
pkgs/by-name/en/endless-sky/fixes.patch
··· 12 12 # Install the desktop file: 13 13 env.Install("$DESTDIR$PREFIX/share/applications", "endless-sky.desktop") 14 14 diff --git a/source/Files.cpp b/source/Files.cpp 15 - index de27023e..4225051f 100644 15 + index f5dec21..ad57c55 100644 16 16 --- a/source/Files.cpp 17 17 +++ b/source/Files.cpp 18 - @@ -108,32 +108,9 @@ void Files::Init(const char * const *argv) 19 - resources = str; 20 - SDL_free(str); 18 + @@ -115,6 +115,7 @@ void Files::Init(const char * const *argv) 19 + else if(IsParent(STANDARD_PATH, resources)) 20 + resources = STANDARD_PATH / RESOURCE_PATH; 21 + #endif 22 + + resources = "%NIXPKGS_RESOURCES_PATH%"; 21 23 } 22 - -#if defined _WIN32 23 - - FixWindowsSlashes(resources); 24 - -#endif 25 - - if(resources.back() != '/') 26 - - resources += '/'; 27 - -#if defined __linux__ || defined __FreeBSD__ || defined __DragonFly__ 28 - - // Special case, for Linux: the resource files are not in the same place as 29 - - // the executable, but are under the same prefix (/usr or /usr/local). 30 - - static const string LOCAL_PATH = "/usr/local/"; 31 - - static const string STANDARD_PATH = "/usr/"; 32 - - static const string RESOURCE_PATH = "share/games/endless-sky/"; 33 - - if(!resources.compare(0, LOCAL_PATH.length(), LOCAL_PATH)) 34 - - resources = LOCAL_PATH + RESOURCE_PATH; 35 - - else if(!resources.compare(0, STANDARD_PATH.length(), STANDARD_PATH)) 36 - - resources = STANDARD_PATH + RESOURCE_PATH; 37 - -#endif 38 - - // If the resources are not here, search in the directories containing this 39 - - // one. This allows, for example, a Mac app that does not actually have the 40 - - // resources embedded within it. 41 - - while(!Exists(resources + "credits.txt")) 42 - - { 43 - - size_t pos = resources.rfind('/', resources.length() - 2); 44 - - if(pos == string::npos || pos == 0) 45 - - throw runtime_error("Unable to find the resource directories!"); 46 - - resources.erase(pos + 1); 47 - - } 48 - + 49 - + resources = "%NIXPKGS_RESOURCES_PATH%"; 50 - + 51 - dataPath = resources + "data/"; 52 - imagePath = resources + "images/"; 53 - soundPath = resources + "sounds/"; 24 + // If the resources are not here, search in the directories containing this 25 + // one. This allows, for example, a Mac app that does not actually have the
+3 -3
pkgs/by-name/en/endless-sky/package.nix
··· 14 14 15 15 stdenv.mkDerivation rec { 16 16 pname = "endless-sky"; 17 - version = "0.10.10"; 17 + version = "0.10.12"; 18 18 19 19 src = fetchFromGitHub { 20 20 owner = "endless-sky"; 21 21 repo = "endless-sky"; 22 - rev = "v${version}"; 23 - sha256 = "sha256-FjQluOFU+fPr4/3WveScRRabDjD/bq8YmXvCU9w9yo8="; 22 + tag = "v${version}"; 23 + hash = "sha256-cT/bklRGQnS9Nm8J0oH1mG20JQOe58FAAHToNDpvPpQ="; 24 24 }; 25 25 26 26 patches = [