diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-06-22 15:01:47 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-06-22 16:57:59 +0000 |
commit | 633cab0ecb07627706c6b523e219490f019eaab5 (patch) | |
tree | 4fb472bdfe2723037dad53dc1b8a87c939015f5e /nixpkgs/pkgs/games/0ad | |
parent | ffb691c199e7e0cbc4e45e5310779c9e3f7c2a73 (diff) | |
parent | 432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff) | |
download | nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.gz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.bz2 nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.lz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.xz nixlib-633cab0ecb07627706c6b523e219490f019eaab5.tar.zst nixlib-633cab0ecb07627706c6b523e219490f019eaab5.zip |
Merge commit '432fc2d9a67f92e05438dff5fdc2b39d33f77997'
# Conflicts: # nixpkgs/pkgs/applications/editors/emacs/elisp-packages/elpa-generated.nix # nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/default.nix # nixpkgs/pkgs/applications/window-managers/sway/default.nix # nixpkgs/pkgs/build-support/rust/default.nix # nixpkgs/pkgs/development/go-modules/generic/default.nix
Diffstat (limited to 'nixpkgs/pkgs/games/0ad')
-rw-r--r-- | nixpkgs/pkgs/games/0ad/data.nix | 1 | ||||
-rw-r--r-- | nixpkgs/pkgs/games/0ad/game.nix | 11 | ||||
-rw-r--r-- | nixpkgs/pkgs/games/0ad/rootdir_env.patch | 39 |
3 files changed, 44 insertions, 7 deletions
diff --git a/nixpkgs/pkgs/games/0ad/data.nix b/nixpkgs/pkgs/games/0ad/data.nix index 5cb28b3f3bd6..9533af21b15d 100644 --- a/nixpkgs/pkgs/games/0ad/data.nix +++ b/nixpkgs/pkgs/games/0ad/data.nix @@ -19,6 +19,7 @@ stdenv.mkDerivation rec { description = "A free, open-source game of ancient warfare -- data files"; homepage = "https://play0ad.com/"; license = licenses.cc-by-sa-30; + maintainers = with maintainers; [ chvp ]; platforms = platforms.linux; hydraPlatforms = []; }; diff --git a/nixpkgs/pkgs/games/0ad/game.nix b/nixpkgs/pkgs/games/0ad/game.nix index bb3b7c0138af..feaf4347329c 100644 --- a/nixpkgs/pkgs/games/0ad/game.nix +++ b/nixpkgs/pkgs/games/0ad/game.nix @@ -2,7 +2,7 @@ , pkg-config, spidermonkey_78, boost, icu, libxml2, libpng, libsodium , libjpeg, zlib, curl, libogg, libvorbis, enet, miniupnpc , openal, libGLU, libGL, xorgproto, libX11, libXcursor, nspr, SDL2 -, gloox, nvidia-texture-tools, zeroad-data +, gloox, nvidia-texture-tools , withEditor ? true, wxGTK }: @@ -50,6 +50,8 @@ stdenv.mkDerivation rec { "-I${fmt.dev}/include" ]; + patches = [ ./rootdir_env.patch ]; + configurePhase = '' # Delete shipped libraries which we don't need. rm -rf libraries/source/{enet,miniupnpc,nvtt,spidermonkey} @@ -62,7 +64,6 @@ stdenv.mkDerivation rec { ${lib.optionalString withEditor "--enable-atlas"} \ --bindir="$out"/bin \ --libdir="$out"/lib/0ad \ - --datadir="$out"/share/0ad/data \ --without-tests \ -j $NIX_BUILD_CORES popd @@ -85,11 +86,6 @@ stdenv.mkDerivation rec { # Copy l10n data. install -Dm755 -t $out/share/0ad/data/l10n binaries/data/l10n/* - # Link in game data from package - ln -s ${zeroad-data}/share/0ad/data/config $out/share/0ad/data/config - ln -s ${zeroad-data}/share/0ad/data/mods $out/share/0ad/data/mods - ln -s ${zeroad-data}/share/0ad/data/tools $out/share/0ad/data/tools - # Copy libraries. install -Dm644 -t $out/lib/0ad binaries/system/*.so @@ -105,6 +101,7 @@ stdenv.mkDerivation rec { gpl2 lgpl21 mit cc-by-sa-30 licenses.zlib # otherwise masked by pkgs.zlib ]; + maintainers = with maintainers; [ chvp ]; platforms = subtractLists platforms.i686 platforms.linux; }; } diff --git a/nixpkgs/pkgs/games/0ad/rootdir_env.patch b/nixpkgs/pkgs/games/0ad/rootdir_env.patch new file mode 100644 index 000000000000..95463c7e2df4 --- /dev/null +++ b/nixpkgs/pkgs/games/0ad/rootdir_env.patch @@ -0,0 +1,39 @@ +diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp +index 474364e..bf084b4 100644 +--- a/source/ps/GameSetup/Paths.cpp ++++ b/source/ps/GameSetup/Paths.cpp +@@ -155,32 +155,8 @@ Paths::Paths(const CmdLineArgs& args) + + /*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 OsPath(getenv("ZEROAD_ROOTDIR")); + } + + /*static*/ OsPath Paths::RootData(const OsPath& argv0) |