@@ -1,4 +1,4 @@
1−{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
1+{ fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
2SDL2_mixer, freetype, gettext, Cocoa, libicns }:
2SDL2_mixer, freetype, gettext, Cocoa, libicns }:
4stdenv.mkDerivation rec {
4stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
12 sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv";
12 sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv";
15− nativeBuildInputs = [ makeWrapper pkgconfig ]
15+ nativeBuildInputs = [ pkgconfig ]
16 ++ stdenv.lib.optionals stdenv.isDarwin [ libicns ];
16 ++ stdenv.lib.optionals stdenv.isDarwin [ libicns ];
18 buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ]
18 buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ]
@@ -23,8 +23,7 @@ stdenv.mkDerivation rec {
23 postPatch = ''
23 postPatch = ''
24 patchShebangs .
24 patchShebangs .
25 sed -i Makefile \
25 sed -i Makefile \
26− -e 's,-Werror,,g' \
26+ -e 's,-Werror,,g'
27− -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g'
29 sed '1i#include <cmath>' \
28 sed '1i#include <cmath>' \
30 -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
29 -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
@@ -32,6 +31,7 @@ stdenv.mkDerivation rec {
33 makeFlags = [
32 makeFlags = [
34 "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1"
33 "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1"
34+ # "LANGUAGES=all" # vanilla C:DDA installs all translations even without this flag!
35 ] ++ stdenv.lib.optionals stdenv.isDarwin [
35 ] ++ stdenv.lib.optionals stdenv.isDarwin [
36 "NATIVE=osx CLANG=1"
36 "NATIVE=osx CLANG=1"
37 "OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above
37 "OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above
@@ -42,10 +42,7 @@ stdenv.mkDerivation rec {
42 png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/*
42 png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/*
46− wrapProgram $out/bin/cataclysm-tiles \
47− --add-flags "--datadir $out/share/"
48− '' + stdenv.lib.optionalString stdenv.isDarwin ''
45+ postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
49 app=$out/Applications/Cataclysm.app
46 app=$out/Applications/Cataclysm.app
50 install -D -m 444 data/osx/Info.plist -t $app/Contents
47 install -D -m 444 data/osx/Info.plist -t $app/Contents
51 install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources
48 install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources