Merge pull request #60785 from mnacamura/cdda-updates

cataclysm-dda{,-git}: bump version
This commit is contained in:
Silvan Mosberger 2019-05-26 23:25:51 +02:00 committed by GitHub
commit c6a9902b42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 76 deletions

View File

@ -1,12 +1,13 @@
{ stdenv, fetchFromGitHub, pkgconfig, gettext, lua, ncurses { stdenv, fetchFromGitHub, pkgconfig, gettext, ncurses, CoreFoundation
, tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa , tiles, SDL2, SDL2_image, SDL2_mixer, SDL2_ttf, freetype, Cocoa
, debug, runtimeShell , debug, runtimeShell
}: }:
let let
inherit (stdenv.lib) optionals; inherit (stdenv.lib) optionals optionalString;
cursesDeps = [ gettext lua ncurses ]; cursesDeps = [ gettext ncurses ]
++ optionals stdenv.isDarwin [ CoreFoundation ];
tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ] tilesDeps = [ SDL2 SDL2_image SDL2_mixer SDL2_ttf freetype ]
++ optionals stdenv.isDarwin [ Cocoa ]; ++ optionals stdenv.isDarwin [ Cocoa ];
@ -21,7 +22,7 @@ let
''; '';
makeFlags = [ makeFlags = [
"PREFIX=$(out)" "LUA=1" "USE_HOME_DIR=1" "LANGUAGES=all" "PREFIX=$(out)" "USE_HOME_DIR=1" "LANGUAGES=all"
] ++ optionals (!debug) [ ] ++ optionals (!debug) [
"RELEASE=1" "RELEASE=1"
] ++ optionals tiles [ ] ++ optionals tiles [
@ -30,8 +31,19 @@ let
"NATIVE=osx" "CLANG=1" "NATIVE=osx" "CLANG=1"
]; ];
postInstall = optionalString tiles
( if !stdenv.isDarwin
then utils.installXDGAppLauncher
else utils.installMacOSAppLauncher
);
dontStrip = debug; 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; { meta = with stdenv.lib; {
description = "A free, post apocalyptic, zombie infested rogue-like"; description = "A free, post apocalyptic, zombie infested rogue-like";
longDescription = '' longDescription = ''

View File

@ -1,50 +1,33 @@
{ stdenv, callPackage, ncurses { stdenv, callPackage, lua, CoreFoundation
, tiles ? true, Cocoa, libicns , tiles ? true, Cocoa
, debug ? false , debug ? false
}: }:
let let
inherit (stdenv.lib) optionals optionalString; inherit (callPackage ./common.nix { inherit tiles CoreFoundation Cocoa debug; }) common utils;
inherit (callPackage ./common.nix { inherit tiles Cocoa debug; }) common utils; inherit (utils) fetchFromCleverRaven;
inherit (utils) fetchFromCleverRaven installMacOSAppLauncher;
in in
stdenv.mkDerivation (common // rec { stdenv.mkDerivation (common // rec {
version = "0.C"; version = "0.D";
name = "cataclysm-dda-${version}"; name = "cataclysm-dda-${version}";
src = fetchFromCleverRaven { src = fetchFromCleverRaven {
rev = "${version}"; rev = "${version}";
sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv"; sha256 = "00zzhx1mh1qjq668cga5nbrxp2qk6b82j5ak65skhgnlr6ii4ysc";
}; };
nativeBuildInputs = common.nativeBuildInputs buildInputs = common.buildInputs ++ [ lua ];
++ optionals (tiles && stdenv.isDarwin) [ libicns ];
patches = [ ./patches/fix_locale_dir.patch ]; patches = [ ./patches/fix_locale_dir.patch ];
makeFlags = common.makeFlags postPatch = common.postPatch + ''
++ optionals stdenv.isDarwin [ substituteInPlace lua/autoexec.lua --replace "/usr/share" "$out/share"
"OSX_MIN=10.6" # SDL for macOS only supports deploying on 10.6 and above
] ++ optionals stdenv.cc.isGNU [
"WARNINGS+=-Wno-deprecated-declarations"
"WARNINGS+=-Wno-ignored-attributes"
] ++ optionals stdenv.cc.isClang [
"WARNINGS+=-Wno-inconsistent-missing-override"
];
NIX_CFLAGS_COMPILE = optionalString stdenv.cc.isClang "-Wno-user-defined-warnings";
postBuild = optionalString (tiles && stdenv.isDarwin) ''
# iconutil on macOS is not available in nixpkgs
png2icns data/osx/AppIcon.icns data/osx/AppIcon.iconset/*
''; '';
postInstall = optionalString (tiles && stdenv.isDarwin) makeFlags = common.makeFlags ++ [
installMacOSAppLauncher; "LUA=1"
];
# Disable, possible problems with hydra
#enableParallelBuilding = true;
meta = with stdenv.lib.maintainers; common.meta // { meta = with stdenv.lib.maintainers; common.meta // {
maintainers = common.meta.maintainers ++ [ skeidel ]; maintainers = common.meta.maintainers ++ [ skeidel ];

View File

@ -1,43 +1,29 @@
{ stdenv, callPackage { stdenv, callPackage, CoreFoundation
, tiles ? true, Cocoa, CoreFoundation , tiles ? true, Cocoa
, debug ? false , debug ? false
}: }:
let let
inherit (stdenv.lib) optionals optionalString substring; inherit (stdenv.lib) substring;
inherit (callPackage ./common.nix { inherit tiles Cocoa debug; }) common utils; inherit (callPackage ./common.nix { inherit tiles CoreFoundation Cocoa debug; }) common utils;
inherit (utils) fetchFromCleverRaven installXDGAppLauncher installMacOSAppLauncher; inherit (utils) fetchFromCleverRaven;
in in
stdenv.mkDerivation (common // rec { stdenv.mkDerivation (common // rec {
version = "2018-07-15"; version = "2019-05-03";
name = "cataclysm-dda-git-${version}"; name = "cataclysm-dda-git-${version}";
src = fetchFromCleverRaven { src = fetchFromCleverRaven {
rev = "e1e5d81"; rev = "65a05026e7306b5d1228dc6ed885c43447f128b5";
sha256 = "198wfj8l1p8xlwicj92cq237pzv2ha9pcf240y7ijhjpmlc9jkr1"; sha256 = "18yn0h6b4j9lx67sq1d886la3l6l7bqsnwj6mw2khidssiy18y0n";
}; };
buildInputs = common.buildInputs
++ optionals stdenv.isDarwin [ CoreFoundation ];
patches = [ ./patches/fix_locale_dir_git.patch ]; patches = [ ./patches/fix_locale_dir_git.patch ];
makeFlags = common.makeFlags ++ [ makeFlags = common.makeFlags ++ [
"VERSION=git-${version}-${substring 0 8 src.rev}" "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 // { meta = with stdenv.lib.maintainers; common.meta // {
maintainers = common.meta.maintainers ++ [ rardiol ]; maintainers = common.meta.maintainers ++ [ rardiol ];
}; };

View File

@ -1,20 +1,20 @@
diff --git a/src/translations.cpp b/src/translations.cpp diff --git a/src/translations.cpp b/src/translations.cpp
index 6520cfe..49f7b2c 100644 index 2585b7ec56..7bb005823c 100644
--- a/src/translations.cpp --- a/src/translations.cpp
+++ b/src/translations.cpp +++ b/src/translations.cpp
@@ -72,15 +72,11 @@ void set_language(bool reload_options) @@ -195,14 +195,12 @@ void set_language()
auto env = getenv( "LANGUAGE" );
// Step 2. Bind to gettext domain. locale_dir = std::string( FILENAMES["base_path"] + "lang/mo/" + ( env ? env : "none" ) +
const char *locale_dir; "/LC_MESSAGES/cataclysm-dda.mo" );
-#ifdef __linux__ -#elif (defined __linux__ || (defined MACOSX && !defined TILES))
+#else
if( !FILENAMES["base_path"].empty() ) { if( !FILENAMES["base_path"].empty() ) {
locale_dir = std::string(FILENAMES["base_path"] + "share/locale").c_str(); locale_dir = FILENAMES["base_path"] + "share/locale";
} else { } else {
locale_dir = "lang/mo"; locale_dir = "lang/mo";
} }
-#else -#else
- locale_dir = "lang/mo"; - locale_dir = "lang/mo";
-#endif // __linux__ #endif
bindtextdomain("cataclysm-dda", locale_dir); const char *locale_dir_char = locale_dir.c_str();
bind_textdomain_codeset("cataclysm-dda", "UTF-8");

View File

@ -1,12 +1,13 @@
diff --git a/src/translations.cpp b/src/translations.cpp diff --git a/src/translations.cpp b/src/translations.cpp
index 3a86291..e6c5f84 100644 index 0068a35785..c8034cbeac 100644
--- a/src/translations.cpp --- a/src/translations.cpp
+++ b/src/translations.cpp +++ b/src/translations.cpp
@@ -176,15 +176,11 @@ void set_language() @@ -202,14 +202,12 @@ void set_language()
auto env = getenv( "LANGUAGE" );
// Step 2. Bind to gettext domain. locale_dir = std::string( FILENAMES["base_path"] + "lang/mo/" + ( env ? env : "none" ) +
std::string locale_dir; "/LC_MESSAGES/cataclysm-dda.mo" );
-#if (defined __linux__ || (defined MACOSX && !defined TILES)) -#elif (defined(__linux__) || (defined(MACOSX) && !defined(TILES)))
+#else
if( !FILENAMES["base_path"].empty() ) { if( !FILENAMES["base_path"].empty() ) {
locale_dir = FILENAMES["base_path"] + "share/locale"; locale_dir = FILENAMES["base_path"] + "share/locale";
} else { } else {
@ -14,7 +15,6 @@ index 3a86291..e6c5f84 100644
} }
-#else -#else
- locale_dir = "lang/mo"; - locale_dir = "lang/mo";
-#endif // __linux__ #endif
const char *locale_dir_char = locale_dir.c_str(); const char *locale_dir_char = locale_dir.c_str();
bindtextdomain( "cataclysm-dda", locale_dir_char );

View File

@ -21256,8 +21256,7 @@ in
}; };
cataclysm-dda = callPackage ../games/cataclysm-dda { cataclysm-dda = callPackage ../games/cataclysm-dda {
inherit (darwin.apple_sdk.frameworks) Cocoa; inherit (darwin.apple_sdk.frameworks) CoreFoundation Cocoa;
ncurses = ncurses5;
}; };
cataclysm-dda-git = callPackage ../games/cataclysm-dda/git.nix { cataclysm-dda-git = callPackage ../games/cataclysm-dda/git.nix {