zeroad: Split data from binaries again

The rootdir patch was lost in the update to 0.0.24b. Adding it allows
hydra to build the game. It can't when the binaries depend on the data
since the data is too big for hydra.

authored by Charlotte Van Petegem and committed by Jonathan Ringer 701664ea 7564a45b

+42 -7
+3 -7
pkgs/games/0ad/game.nix
··· 2 , pkg-config, spidermonkey_78, boost, icu, libxml2, libpng, libsodium 3 , libjpeg, zlib, curl, libogg, libvorbis, enet, miniupnpc 4 , openal, libGLU, libGL, xorgproto, libX11, libXcursor, nspr, SDL2 5 - , gloox, nvidia-texture-tools, zeroad-data 6 , withEditor ? true, wxGTK 7 }: 8 ··· 50 "-I${fmt.dev}/include" 51 ]; 52 53 configurePhase = '' 54 # Delete shipped libraries which we don't need. 55 rm -rf libraries/source/{enet,miniupnpc,nvtt,spidermonkey} ··· 62 ${lib.optionalString withEditor "--enable-atlas"} \ 63 --bindir="$out"/bin \ 64 --libdir="$out"/lib/0ad \ 65 - --datadir="$out"/share/0ad/data \ 66 --without-tests \ 67 -j $NIX_BUILD_CORES 68 popd ··· 84 85 # Copy l10n data. 86 install -Dm755 -t $out/share/0ad/data/l10n binaries/data/l10n/* 87 - 88 - # Link in game data from package 89 - ln -s ${zeroad-data}/share/0ad/data/config $out/share/0ad/data/config 90 - ln -s ${zeroad-data}/share/0ad/data/mods $out/share/0ad/data/mods 91 - ln -s ${zeroad-data}/share/0ad/data/tools $out/share/0ad/data/tools 92 93 # Copy libraries. 94 install -Dm644 -t $out/lib/0ad binaries/system/*.so
··· 2 , pkg-config, spidermonkey_78, boost, icu, libxml2, libpng, libsodium 3 , libjpeg, zlib, curl, libogg, libvorbis, enet, miniupnpc 4 , openal, libGLU, libGL, xorgproto, libX11, libXcursor, nspr, SDL2 5 + , gloox, nvidia-texture-tools 6 , withEditor ? true, wxGTK 7 }: 8 ··· 50 "-I${fmt.dev}/include" 51 ]; 52 53 + patches = [ ./rootdir_env.patch ]; 54 + 55 configurePhase = '' 56 # Delete shipped libraries which we don't need. 57 rm -rf libraries/source/{enet,miniupnpc,nvtt,spidermonkey} ··· 64 ${lib.optionalString withEditor "--enable-atlas"} \ 65 --bindir="$out"/bin \ 66 --libdir="$out"/lib/0ad \ 67 --without-tests \ 68 -j $NIX_BUILD_CORES 69 popd ··· 85 86 # Copy l10n data. 87 install -Dm755 -t $out/share/0ad/data/l10n binaries/data/l10n/* 88 89 # Copy libraries. 90 install -Dm644 -t $out/lib/0ad binaries/system/*.so
+39
pkgs/games/0ad/rootdir_env.patch
···
··· 1 + diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp 2 + index 474364e..bf084b4 100644 3 + --- a/source/ps/GameSetup/Paths.cpp 4 + +++ b/source/ps/GameSetup/Paths.cpp 5 + @@ -155,32 +155,8 @@ Paths::Paths(const CmdLineArgs& args) 6 + 7 + /*static*/ OsPath Paths::Root(const OsPath& argv0) 8 + { 9 + -#if OS_ANDROID 10 + - return OsPath("/sdcard/0ad"); // TODO: this is kind of bogus 11 + -#else 12 + - 13 + - // get full path to executable 14 + - OsPath pathname = sys_ExecutablePathname(); // safe, but requires OS-specific implementation 15 + - if(pathname.empty()) // failed, use argv[0] instead 16 + - { 17 + - errno = 0; 18 + - pathname = wrealpath(argv0); 19 + - if(pathname.empty()) 20 + - WARN_IF_ERR(StatusFromErrno()); 21 + - } 22 + - 23 + - // make sure it's valid 24 + - if(!FileExists(pathname)) 25 + - { 26 + - LOGERROR("Cannot find executable (expected at '%s')", pathname.string8()); 27 + - WARN_IF_ERR(StatusFromErrno()); 28 + - } 29 + - 30 + - for(size_t i = 0; i < 2; i++) // remove "system/name.exe" 31 + - pathname = pathname.Parent(); 32 + - return pathname; 33 + - 34 + -#endif 35 + + UNUSED2(argv0); 36 + + return OsPath(getenv("ZEROAD_ROOTDIR")); 37 + } 38 + 39 + /*static*/ OsPath Paths::RootData(const OsPath& argv0)