aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/games/0ad/rootdir_env.patch
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/games/0ad/rootdir_env.patch')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/games/0ad/rootdir_env.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/games/0ad/rootdir_env.patch b/infra/libkookie/nixpkgs/pkgs/games/0ad/rootdir_env.patch
new file mode 100644
index 000000000000..c001473e5104
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/games/0ad/rootdir_env.patch
@@ -0,0 +1,38 @@
+diff -ru3 0ad-0.0.20-alpha/source/ps/GameSetup/Paths.cpp 0ad-0.0.20-alpha-new/source/ps/GameSetup/Paths.cpp
+--- 0ad-0.0.20-alpha/source/ps/GameSetup/Paths.cpp 2015-02-14 04:45:13.000000000 +0300
++++ 0ad-0.0.20-alpha-new/source/ps/GameSetup/Paths.cpp 2016-11-03 16:23:47.241514876 +0300
+@@ -155,32 +155,8 @@
+
+ /*static*/ OsPath Paths::Root(const OsPath& argv0)
+ {
+-#if OS_ANDROID
+- return OsPath("/sdcard/0ad"); // TODO: this is kind of bogus
+-#else
+-
+- // get full path to executable
+- OsPath pathname = sys_ExecutablePathname(); // safe, but requires OS-specific implementation
+- if(pathname.empty()) // failed, use argv[0] instead
+- {
+- errno = 0;
+- pathname = wrealpath(argv0);
+- if(pathname.empty())
+- WARN_IF_ERR(StatusFromErrno());
+- }
+-
+- // make sure it's valid
+- if(!FileExists(pathname))
+- {
+- LOGERROR("Cannot find executable (expected at '%s')", pathname.string8());
+- WARN_IF_ERR(StatusFromErrno());
+- }
+-
+- for(size_t i = 0; i < 2; i++) // remove "system/name.exe"
+- pathname = pathname.Parent();
+- return pathname;
+-
+-#endif
++ UNUSED2(argv0);
++ return getenv("ZEROAD_ROOTDIR");
+ }
+
+ /*static*/ OsPath Paths::RootData(const OsPath& argv0)