From a2df3ee29340cff2a92dd9dd9540f2761c806fc4 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Wed, 7 Feb 2018 00:01:15 +0900 Subject: cataclysm-dda{,-git}: styling --- pkgs/games/cataclysm-dda/default.nix | 30 ++++++++++++++++++------------ pkgs/games/cataclysm-dda/git.nix | 34 ++++++++++++++++++++-------------- 2 files changed, 38 insertions(+), 26 deletions(-) (limited to 'pkgs') diff --git a/pkgs/games/cataclysm-dda/default.nix b/pkgs/games/cataclysm-dda/default.nix index ae662232ba8a..a3adec384015 100644 --- a/pkgs/games/cataclysm-dda/default.nix +++ b/pkgs/games/cataclysm-dda/default.nix @@ -1,5 +1,6 @@ { fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, -SDL2_mixer, freetype, gettext, Cocoa, libicns, tiles ? true }: +SDL2_mixer, freetype, gettext, Cocoa, libicns, +tiles ? true }: stdenv.mkDerivation rec { version = "0.C"; @@ -15,9 +16,9 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ] ++ stdenv.lib.optionals (tiles && stdenv.isDarwin) [ libicns ]; - buildInputs = [ ncurses lua gettext ] - ++ stdenv.lib.optionals tiles [ SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype ] - ++ stdenv.lib.optionals (tiles && stdenv.isDarwin) [ Cocoa ]; + buildInputs = with stdenv.lib; [ ncurses lua gettext ] + ++ optionals tiles [ SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype ] + ++ optionals (tiles && stdenv.isDarwin) [ Cocoa ]; patches = [ ./patches/fix_locale_dir.patch ]; @@ -25,18 +26,23 @@ stdenv.mkDerivation rec { patchShebangs . ''; - makeFlags = [ - "PREFIX=$(out) LUA=1 RELEASE=1 USE_HOME_DIR=1" + makeFlags = with stdenv.lib; [ + "PREFIX=$(out)" + "LUA=1" + "RELEASE=1" + "USE_HOME_DIR=1" # "LANGUAGES=all" # vanilla C:DDA installs all translations even without this flag! - ] ++ stdenv.lib.optionals tiles [ - "TILES=1 SOUND=1" - ] ++ stdenv.lib.optionals stdenv.isDarwin [ - "NATIVE=osx CLANG=1" + ] ++ optionals tiles [ + "TILES=1" + "SOUND=1" + ] ++ optionals stdenv.isDarwin [ + "NATIVE=osx" + "CLANG=1" "OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above - ] ++ stdenv.lib.optionals stdenv.cc.isGNU [ + ] ++ optionals stdenv.cc.isGNU [ "WARNINGS+=-Wno-deprecated-declarations" "WARNINGS+=-Wno-ignored-attributes" - ] ++ stdenv.lib.optionals stdenv.cc.isClang [ + ] ++ optionals stdenv.cc.isClang [ "WARNINGS+=-Wno-inconsistent-missing-override" ]; diff --git a/pkgs/games/cataclysm-dda/git.nix b/pkgs/games/cataclysm-dda/git.nix index bad2338b2b84..fcc2481cb695 100644 --- a/pkgs/games/cataclysm-dda/git.nix +++ b/pkgs/games/cataclysm-dda/git.nix @@ -1,5 +1,6 @@ { fetchFromGitHub, stdenv, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, -SDL2_mixer, freetype, gettext, CoreFoundation, Cocoa, tiles ? true }: +SDL2_mixer, freetype, gettext, CoreFoundation, Cocoa, +tiles ? true }: stdenv.mkDerivation rec { version = "2017-12-09"; @@ -14,10 +15,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ ncurses lua gettext ] - ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation ] - ++ stdenv.lib.optionals tiles [ SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype ] - ++ stdenv.lib.optionals (tiles && stdenv.isDarwin) [ Cocoa ]; + buildInputs = with stdenv.lib; [ ncurses lua gettext ] + ++ optionals stdenv.isDarwin [ CoreFoundation ] + ++ optionals tiles [ SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype ] + ++ optionals (tiles && stdenv.isDarwin) [ Cocoa ]; patches = [ ./patches/fix_locale_dir_git.patch ]; @@ -27,20 +28,25 @@ stdenv.mkDerivation rec { -e "s,\(Exec=\)\(cataclysm-tiles\),\1$out/bin/\2," ''; - makeFlags = [ - "PREFIX=$(out) LUA=1 RELEASE=1 USE_HOME_DIR=1" + makeFlags = with stdenv.lib; [ + "PREFIX=$(out)" + "LUA=1" + "RELEASE=1" + "USE_HOME_DIR=1" "LANGUAGES=all" - "VERSION=git-${version}-${stdenv.lib.substring 0 8 src.rev}" - ] ++ stdenv.lib.optionals tiles [ - "TILES=1 SOUND=1" - ] ++ stdenv.lib.optionals stdenv.isDarwin [ - "NATIVE=osx CLANG=1" + "VERSION=git-${version}-${substring 0 8 src.rev}" + ] ++ optionals tiles [ + "TILES=1" + "SOUND=1" + ] ++ optionals stdenv.isDarwin [ + "NATIVE=osx" + "CLANG=1" ]; - postInstall = stdenv.lib.optionalString (tiles && !stdenv.isDarwin) '' + postInstall = with stdenv.lib; optionalString (tiles && !stdenv.isDarwin) '' install -D -m 444 data/xdg/com.cataclysmdda.cataclysm-dda.desktop -T $out/share/applications/cataclysm-dda.desktop install -D -m 444 data/xdg/cataclysm-dda.svg -t $out/share/icons/hicolor/scalable/apps - '' + stdenv.lib.optionalString (tiles && stdenv.isDarwin) '' + '' + optionalString (tiles && 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 -- cgit 1.4.1