cataclysm-dda{,-git}: refactoring

This commit is contained in:
Mitsuhiro Nakamura 2019-05-03 01:50:40 +09:00
parent 520dd5d71e
commit c2987f1ba8
3 changed files with 20 additions and 35 deletions

View File

@ -1,12 +1,13 @@
{ stdenv, fetchFromGitHub, pkgconfig, gettext, lua, ncurses
{ stdenv, fetchFromGitHub, pkgconfig, gettext, lua, ncurses, CoreFoundation
, tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa
, debug, runtimeShell
}:
let
inherit (stdenv.lib) optionals;
inherit (stdenv.lib) optionals optionalString;
cursesDeps = [ gettext lua ncurses ];
cursesDeps = [ gettext lua ncurses ]
++ optionals stdenv.isDarwin [ CoreFoundation ];
tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ]
++ optionals stdenv.isDarwin [ Cocoa ];
@ -30,8 +31,19 @@ let
"NATIVE=osx" "CLANG=1"
];
postInstall = optionalString tiles
( if !stdenv.isDarwin
then utils.installXDGAppLauncher
else utils.installMacOSAppLauncher
);
dontStrip = debug;
# https://hydra.nixos.org/build/65193254
# src/weather_data.cpp:203:1: fatal error: opening dependency file obj/tiles/weather_data.d: No such file or directory
# make: *** [Makefile:687: obj/tiles/weather_data.o] Error 1
enableParallelBuilding = false;
meta = with stdenv.lib; {
description = "A free, post apocalyptic, zombie infested rogue-like";
longDescription = ''

View File

@ -4,9 +4,8 @@
}:
let
inherit (stdenv.lib) optionals optionalString;
inherit (callPackage ./common.nix { inherit tiles Cocoa debug; }) common utils;
inherit (utils) fetchFromCleverRaven installXDGAppLauncher installMacOSAppLauncher;
inherit (callPackage ./common.nix { inherit tiles CoreFoundation Cocoa debug; }) common utils;
inherit (utils) fetchFromCleverRaven;
in
stdenv.mkDerivation (common // rec {
@ -18,24 +17,12 @@ stdenv.mkDerivation (common // rec {
sha256 = "00zzhx1mh1qjq668cga5nbrxp2qk6b82j5ak65skhgnlr6ii4ysc";
};
buildInputs = common.buildInputs
++ optionals stdenv.isDarwin [ CoreFoundation ];
patches = [ ./patches/fix_locale_dir.patch ];
postPatch = common.postPatch + ''
substituteInPlace lua/autoexec.lua --replace "/usr/share" "$out/share"
'';
postInstall = optionalString tiles
( if !stdenv.isDarwin
then installXDGAppLauncher
else installMacOSAppLauncher
);
# Disable, possible problems with hydra
#enableParallelBuilding = true;
meta = with stdenv.lib.maintainers; common.meta // {
maintainers = common.meta.maintainers ++ [ skeidel ];
};

View File

@ -4,9 +4,9 @@
}:
let
inherit (stdenv.lib) optionals optionalString substring;
inherit (callPackage ./common.nix { inherit tiles Cocoa debug; }) common utils;
inherit (utils) fetchFromCleverRaven installXDGAppLauncher installMacOSAppLauncher;
inherit (stdenv.lib) substring;
inherit (callPackage ./common.nix { inherit tiles CoreFoundation Cocoa debug; }) common utils;
inherit (utils) fetchFromCleverRaven;
in
stdenv.mkDerivation (common // rec {
@ -18,26 +18,12 @@ stdenv.mkDerivation (common // rec {
sha256 = "18yn0h6b4j9lx67sq1d886la3l6l7bqsnwj6mw2khidssiy18y0n";
};
buildInputs = common.buildInputs
++ optionals stdenv.isDarwin [ CoreFoundation ];
patches = [ ./patches/fix_locale_dir_git.patch ];
makeFlags = common.makeFlags ++ [
"VERSION=git-${version}-${substring 0 8 src.rev}"
];
postInstall = optionalString tiles
( if !stdenv.isDarwin
then installXDGAppLauncher
else installMacOSAppLauncher
);
# https://hydra.nixos.org/build/65193254
# src/weather_data.cpp:203:1: fatal error: opening dependency file obj/tiles/weather_data.d: No such file or directory
# make: *** [Makefile:687: obj/tiles/weather_data.o] Error 1
enableParallelBuilding = false;
meta = with stdenv.lib.maintainers; common.meta // {
maintainers = common.meta.maintainers ++ [ rardiol ];
};