Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 53 lines 2.0 kB view raw
1diff --git a/SConstruct b/SConstruct 2index 48fd080..419b40d 100644 3--- a/SConstruct 4+++ b/SConstruct 5@@ -55,7 +55,7 @@ sky = env.Program("endless-sky", Glob("build/" + env["mode"] + "/*.cpp")) 6 7 8 # Install the binary: 9-env.Install("$DESTDIR$PREFIX/games", sky) 10+env.Install("$DESTDIR$PREFIX/bin", sky) 11 12 # Install the desktop file: 13 env.Install("$DESTDIR$PREFIX/share/applications", "endless-sky.desktop") 14diff --git a/source/Files.cpp b/source/Files.cpp 15index de27023e..4225051f 100644 16--- a/source/Files.cpp 17+++ b/source/Files.cpp 18@@ -108,32 +108,9 @@ void Files::Init(const char * const *argv) 19 resources = str; 20 SDL_free(str); 21 } 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/";