diff --git a/pkgs/games/cataclysm-dda/default.nix b/pkgs/games/cataclysm-dda/default.nix index 550d557e57e..be6f3265430 100644 --- a/pkgs/games/cataclysm-dda/default.nix +++ b/pkgs/games/cataclysm-dda/default.nix @@ -1,4 +1,4 @@ -{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, +{ fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, freetype, gettext, Cocoa, libicns }: stdenv.mkDerivation rec { @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv"; }; - nativeBuildInputs = [ makeWrapper pkgconfig ] + nativeBuildInputs = [ pkgconfig ] ++ stdenv.lib.optionals stdenv.isDarwin [ libicns ]; buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ] @@ -23,8 +23,7 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs . sed -i Makefile \ - -e 's,-Werror,,g' \ - -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g' + -e 's,-Werror,,g' sed '1i#include ' \ -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp @@ -32,6 +31,7 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1" + # "LANGUAGES=all" # vanilla C:DDA installs all translations even without this flag! ] ++ stdenv.lib.optionals stdenv.isDarwin [ "NATIVE=osx CLANG=1" "OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above @@ -42,10 +42,7 @@ stdenv.mkDerivation rec { png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/* ''; - postInstall = '' - wrapProgram $out/bin/cataclysm-tiles \ - --add-flags "--datadir $out/share/" - '' + stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = stdenv.lib.optionalString stdenv.isDarwin '' app=$out/Applications/Cataclysm.app install -D -m 444 data/osx/Info.plist -t $app/Contents install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources diff --git a/pkgs/games/cataclysm-dda/git.nix b/pkgs/games/cataclysm-dda/git.nix index 264dc8b65a0..3d8ec7d6844 100644 --- a/pkgs/games/cataclysm-dda/git.nix +++ b/pkgs/games/cataclysm-dda/git.nix @@ -1,4 +1,4 @@ -{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, +{ fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, freetype, gettext, CoreFoundation, Cocoa }: stdenv.mkDerivation rec { @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { sha256 = "1a7kdmx76na4g65zra01qaq98lxp9j2dl9ddv09r0p5yxaizw68z"; }; - nativeBuildInputs = [ makeWrapper pkgconfig ]; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Cocoa ]; @@ -22,8 +22,7 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs . sed -i Makefile \ - -e 's,-Werror,,g' \ - -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g' + -e 's,-Werror,,g' sed '1i#include ' \ -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp @@ -31,14 +30,12 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1" + "LANGUAGES=all" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "NATIVE=osx CLANG=1" ]; - postInstall = '' - wrapProgram $out/bin/cataclysm-tiles \ - --add-flags "--datadir $out/share/cataclysm-dda/" - '' + stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = stdenv.lib.optionalString stdenv.isDarwin '' app=$out/Applications/Cataclysm.app install -D -m 444 data/osx/Info.plist -t $app/Contents install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources