From 531baf82add9156fc17d704173a31d2326c6304d Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 23 Mar 2016 01:05:50 +0100 Subject: [PATCH] cataclysm-dda: build recipe enhancements & gcc5 support - Remove redundant platform check; meta.platforms is sufficient - Use postPatch rather than override patchPhase entirely - Strip -Werror - Move build-time only dependencies to nativeBuildInputs This also fixes gcc5 build, which fails due to a deprecated-declarations warning (see https://hydra.nixos.org/build/33117020/nixlog/2/raw). (cherry picked from commit 18b35bd7417368cebacefea4a10c920a8e5516c4) --- pkgs/games/cataclysm-dda/default.nix | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/pkgs/games/cataclysm-dda/default.nix b/pkgs/games/cataclysm-dda/default.nix index ed4aed35e115..3956c994531e 100644 --- a/pkgs/games/cataclysm-dda/default.nix +++ b/pkgs/games/cataclysm-dda/default.nix @@ -1,15 +1,7 @@ { fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf, SDL2_mixer, freetype, gettext }: -let architecture = - if stdenv.system == "i686-linux" then - "linux32" - else if stdenv.system == "x86_64-linux" then - "linux64" - else - abort "currently only linux 32-bit and 64-bit are supported"; - -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { version = "0.C"; name = "cataclysm-dda-${version}"; @@ -20,13 +12,15 @@ in stdenv.mkDerivation rec { sha256 = "03sdzsk4qdq99qckq0axbsvg1apn6xizscd8pwp5w6kq2fyj5xkv"; }; - buildInputs = [ makeWrapper pkgconfig ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ]; + nativeBuildInputs = [ makeWrapper pkgconfig ]; - patchPhase = '' + buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ]; + + postPatch = '' patchShebangs . - substituteAllInPlace lang/compile_mo.sh \ - --replace msgfmt ${gettext}/msgfmt - sed -i -e 's|DATA_PREFIX=$(PREFIX)/share/cataclysm-dda/|DATA_PREFIX=$(PREFIX)/share/|g' Makefile + sed -i Makefile \ + -e 's,-Werror,,g' \ + -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g' ''; makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";