Merge pull request #34144 from mnacamura/cdda-fix-share-dir

cataclysm-dda{,-git}: fix share directory

authored by

Jörg Thalheim and committed by
GitHub
bb7e2445 a3d6f38a

+10 -16
+5 -8
pkgs/games/cataclysm-dda/default.nix
··· 1 - { fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, 1 + { fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, 2 2 SDL2_mixer, freetype, gettext, Cocoa, libicns }: 3 3 4 4 stdenv.mkDerivation rec { ··· 12 12 sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv"; 13 13 }; 14 14 15 - nativeBuildInputs = [ makeWrapper pkgconfig ] 15 + nativeBuildInputs = [ pkgconfig ] 16 16 ++ stdenv.lib.optionals stdenv.isDarwin [ libicns ]; 17 17 18 18 buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ] ··· 23 23 postPatch = '' 24 24 patchShebangs . 25 25 sed -i Makefile \ 26 - -e 's,-Werror,,g' \ 27 - -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g' 26 + -e 's,-Werror,,g' 28 27 29 28 sed '1i#include <cmath>' \ 30 29 -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp ··· 32 31 33 32 makeFlags = [ 34 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 35 ] ++ stdenv.lib.optionals stdenv.isDarwin [ 36 36 "NATIVE=osx CLANG=1" 37 37 "OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above ··· 42 42 png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/* 43 43 ''; 44 44 45 - postInstall = '' 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 46 app=$out/Applications/Cataclysm.app 50 47 install -D -m 444 data/osx/Info.plist -t $app/Contents 51 48 install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources
+5 -8
pkgs/games/cataclysm-dda/git.nix
··· 1 - { fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, 1 + { fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, 2 2 SDL2_mixer, freetype, gettext, CoreFoundation, Cocoa }: 3 3 4 4 stdenv.mkDerivation rec { ··· 12 12 sha256 = "1a7kdmx76na4g65zra01qaq98lxp9j2dl9ddv09r0p5yxaizw68z"; 13 13 }; 14 14 15 - nativeBuildInputs = [ makeWrapper pkgconfig ]; 15 + nativeBuildInputs = [ pkgconfig ]; 16 16 17 17 buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ] 18 18 ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Cocoa ]; ··· 22 22 postPatch = '' 23 23 patchShebangs . 24 24 sed -i Makefile \ 25 - -e 's,-Werror,,g' \ 26 - -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g' 25 + -e 's,-Werror,,g' 27 26 28 27 sed '1i#include <cmath>' \ 29 28 -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp ··· 31 30 32 31 makeFlags = [ 33 32 "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1" 33 + "LANGUAGES=all" 34 34 ] ++ stdenv.lib.optionals stdenv.isDarwin [ 35 35 "NATIVE=osx CLANG=1" 36 36 ]; 37 37 38 - postInstall = '' 39 - wrapProgram $out/bin/cataclysm-tiles \ 40 - --add-flags "--datadir $out/share/cataclysm-dda/" 41 - '' + stdenv.lib.optionalString stdenv.isDarwin '' 38 + postInstall = stdenv.lib.optionalString stdenv.isDarwin '' 42 39 app=$out/Applications/Cataclysm.app 43 40 install -D -m 444 data/osx/Info.plist -t $app/Contents 44 41 install -D -m 444 data/osx/AppIcon.icns -t $app/Contents/Resources