mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 23:22:37 +00:00
crawl: fix, update, add console version
This commit is contained in:
parent
969349c975
commit
2c0ad22666
@ -1,24 +1,53 @@
|
||||
{ stdenv, fetchurl, sqlite, lua, which, zlib, pkgconfig, dejavu_fonts,
|
||||
libpng, perl, SDL, SDL_image, ncurses, mesa}:
|
||||
{ stdenv, fetchurl, which, sqlite, lua5_1, perl, zlib, pkgconfig, ncurses
|
||||
, dejavu_fonts, libpng, SDL, SDL_image, mesa, freetype
|
||||
, tileMode ? true
|
||||
}:
|
||||
|
||||
let version = "0.15.2";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "crawl-0.14.1";
|
||||
src = fetchurl {
|
||||
url = "http://downloads.sourceforge.net/project/crawl-ref/Stone%20Soup/0.14.1/stone_soup-0.14.1-nodeps.tar.xz";
|
||||
sha256 = "91726d0224b93ba26b5d4bd3762bc5aabe1f02974ea6c937be89dc6c6ab7a4dd";
|
||||
};
|
||||
name = "crawl-${version}" + (if tileMode then "-tiles" else "");
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/crawl-ref/Stone%20Soup/${version}/stone_soup-${version}-nodeps.tar.xz";
|
||||
sha256 = "1qi1g8w0sxmwrv96hnay20gpwp1xn2xcq1cw9iwn1yq112484fp9";
|
||||
};
|
||||
|
||||
patches = [ ./makefile_fonts.patch ./makefile_sqlite.patch
|
||||
./makefile_rltiles.patch ./makefile_rltiles2.patch
|
||||
./makefile_misc.patch ./makefile_prefix.patch
|
||||
];
|
||||
patches = [ ./makefile_fonts.patch ./makefile_sqlite.patch ];
|
||||
|
||||
buildInputs = [stdenv pkgconfig lua zlib sqlite which libpng perl SDL
|
||||
dejavu_fonts SDL_image ncurses mesa];
|
||||
nativeBuildInputs = [ pkgconfig which perl ];
|
||||
|
||||
preBuild = "cd source";
|
||||
# Still unstable with luajit
|
||||
buildInputs = [ lua5_1 zlib sqlite ncurses ]
|
||||
++ stdenv.lib.optionals tileMode
|
||||
[ libpng SDL SDL_image freetype mesa ];
|
||||
|
||||
makeFlags = "TILES=y";
|
||||
preBuild = ''
|
||||
cd source
|
||||
# Related to issue #1963
|
||||
sed -i 's/-fuse-ld=gold//g' Makefile
|
||||
for i in util/*.pl; do
|
||||
patchShebangs $i
|
||||
done
|
||||
patchShebangs util/gen-mi-enum
|
||||
'';
|
||||
|
||||
inherit dejavu_fonts sqlite SDL_image SDL;
|
||||
makeFlags = [ "prefix=$(out)" "FORCE_CC=gcc" "FORCE_CXX=g++" "HOSTCXX=g++"
|
||||
"SAVEDIR=~/.crawl" "sqlite=${sqlite}" ]
|
||||
++ stdenv.lib.optionals tileMode [ "TILES=y" "dejavu_fonts=${dejavu_fonts}" ];
|
||||
|
||||
postInstall = if tileMode then "mv $out/bin/crawl $out/bin/crawl-tiles" else "";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Open-source, single-player, role-playing roguelike game";
|
||||
longDescription = ''
|
||||
Open-source, single-player, role-playing roguelike game of exploration and
|
||||
treasure-hunting in dungeons filled with dangerous and unfriendly monsters
|
||||
in a quest to rescue the mystifyingly fabulous Orb of Zot.
|
||||
'';
|
||||
platforms = platforms.linux;
|
||||
licenses = with licenses; [ gpl2Plus bsd2 bsd3 mit zlib cc0 ];
|
||||
maintainers = maintainers.abbradar;
|
||||
};
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
--- old/source/Makefile 2014-05-05 23:22:48.051952484 +0200
|
||||
+++ new/source/Makefile 2014-05-05 23:20:46.576617833 +0200
|
||||
@@ -71,6 +71,9 @@
|
||||
|
||||
GAME = crawl
|
||||
|
||||
+
|
||||
+CFLAGS := $(NIX_CFLAGS_COMPILE)
|
||||
+
|
||||
# Disable GNU Make implicit rules and variables. Leaving them enabled will slow
|
||||
# down MinGW and Cygwin builds by a very VERY noticeable degree. Besides, we have
|
||||
# _explicit_ rules defined for everything. So we don't need them.
|
||||
@@ -979,7 +983,7 @@
|
||||
ifdef ANDROID
|
||||
CFLAGS := $(CFOPTIMIZE) $(CFOTHERS) $(CFWARN) $(CFLAGS)
|
||||
else
|
||||
-CFLAGS := $(CFOPTIMIZE) $(CFOTHERS) $(CFWARN)
|
||||
+CFLAGS := $(CFOPTIMIZE) $(CFOTHERS) $(CFWARN) $(CFLAGS)
|
||||
endif
|
||||
CFLAGS_L := $(CFOPTIMIZE_L) $(DEFINES_L) $(CFWARN_L) $(INCLUDES_L) $(CFOTHERS_L)
|
||||
ALL_CFLAGS := $(CFLAGS) $(CFLAGS_L)
|
||||
@@ -1392,7 +1396,7 @@
|
||||
$(RM) -r $(DOXYGEN_HTML_GEN)
|
||||
|
||||
$(GAME): $(OBJECTS) $(EXTRA_OBJECTS) $(CONTRIB_LIBS) dat/dlua/tags.lua
|
||||
- +$(QUIET_LINK)$(CXX) $(LDFLAGS) $(EXTRA_OBJECTS) $(OBJECTS) -o $(GAME) $(LIBS)
|
||||
+ g++ $(LDFLAGS) $(EXTRA_OBJECTS) $(OBJECTS) -o $(GAME) $(LIBS)
|
||||
|
||||
debug: all
|
||||
debug-lite: all
|
||||
@@ -1492,7 +1496,7 @@
|
||||
$(QUIET_GEN)util/gen-luatags.pl
|
||||
|
||||
mi-enum.h: mon-info.h util/gen-mi-enum
|
||||
- $(QUIET_GEN)util/gen-mi-enum
|
||||
+ perl util/gen-mi-enum
|
||||
|
||||
$(RLTILES)/dc-unrand.txt: art-data.h
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- old/source/Makefile 2014-05-06 08:52:24.752163702 +0200
|
||||
+++ new/source/Makefile 2014-05-06 09:08:01.992018819 +0200
|
||||
@@ -344,7 +344,7 @@
|
||||
endif
|
||||
|
||||
chroot_prefix :=
|
||||
-prefix :=
|
||||
+prefix := $(out)
|
||||
|
||||
ifeq ($(patsubst %/local,%,$(patsubst %/,%,$(prefix))),/usr)
|
||||
FHS := yes
|
@ -1,21 +0,0 @@
|
||||
--- old/source/rltiles/Makefile 2014-04-17 10:17:31.596400123 +0000
|
||||
+++ new/source/rltiles/Makefile 2014-04-17 14:36:07.263108690 +0000
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
ifdef TILES
|
||||
ifndef CONTRIB_SDL
|
||||
- SDL_CFLAGS := $(shell sdl-config --cflags 2> /dev/null || echo "-I../contrib/install/$(ARCH)/include/SDL")
|
||||
+ SDL_CFLAGS := $(shell sdl-config --cflags 2> /dev/null)
|
||||
+ SDL_IMG_CFLAGS := $(shell pkg-config --cflags-only-I SDL_image 2> /dev/null)
|
||||
SDL_LDFLAGS := $(shell sdl-config --libs 2> /dev/null && echo "-lSDL_image" || echo "../contrib/install/$(ARCH)/lib/libSDL.a ../contrib/install/$(ARCH)/lib/libSDLmain.a ../contrib/install/$(ARCH)/lib/libSDL_image.a")
|
||||
else
|
||||
SDL_CFLAGS := -I../contrib/install/$(ARCH)/include/SDL
|
||||
@@ -35,7 +36,7 @@
|
||||
PNG_LIB := ../contrib/install/$(ARCH)/lib/libpng.a ../contrib/install/$(ARCH)/lib/libz.a
|
||||
endif
|
||||
|
||||
- CFLAGS += $(SDL_CFLAGS) $(PNG_INCLUDE)
|
||||
+ CFLAGS += $(SDL_CFLAGS) $(SDL_IMG_CFLAGS) $(PNG_INCLUDE) -I$(SDL_image)/include -I$(SDL)/include
|
||||
LDFLAGS += $(SDL_LDFLAGS) $(PNG_LIB)
|
||||
|
||||
CFLAGS += -DUSE_TILE
|
@ -1,10 +0,0 @@
|
||||
--- old/source/rltiles/Makefile 2014-05-05 23:22:48.054952469 +0200
|
||||
+++ new/source/rltiles/Makefile 2014-05-05 22:45:07.742667726 +0200
|
||||
@@ -142,6 +128,6 @@
|
||||
$(QUIET_HOSTCXX)$(HOSTCXX) $(CFLAGS) -MMD -c $< -o $@
|
||||
|
||||
$(TILEGEN): $(OBJECTS)
|
||||
- $(QUIET_HOSTLINK)$(HOSTCXX) $(OBJECTS) -o $@ $(LDFLAGS)
|
||||
+ g++ $(OBJECTS) -o $@ $(LDFLAGS)
|
||||
|
||||
.PHONY: all clean distclean
|
@ -1,19 +0,0 @@
|
||||
--- old/source/Makefile 2014-04-14 13:00:22.331058910 +0000
|
||||
+++ new/source/Makefile 2014-04-14 13:02:11.102204544 +0000
|
||||
@@ -672,6 +672,7 @@
|
||||
FREETYPE_LDFLAGS := $(shell $(PKGCONFIG) freetype2 --libs-only-L) $(shell $(PKGCONFIG) freetype2 --libs-only-l)
|
||||
|
||||
SDL_INCLUDE := $(shell $(PKGCONFIG) sdl --cflags-only-I)
|
||||
+SDL_IMG_INCLUDE := $(shell $(PKGCONFIG) SDL_image --cflags-only-I)
|
||||
SDL_CFLAGS := $(shell $(PKGCONFIG) sdl --cflags-only-other)
|
||||
SDL_LDFLAGS := $(shell $(PKGCONFIG) sdl --libs-only-L) $(shell $(PKGCONFIG) sdl --libs-only-l)
|
||||
|
||||
@@ -694,7 +695,7 @@
|
||||
endif
|
||||
|
||||
DEFINES_L += $(PNG_CFLAGS) $(FREETYPE_CFLAGS) $(SDL_CFLAGS)
|
||||
-INCLUDES_L += $(PNG_INCLUDE) $(FREETYPE_INCLUDE) $(SDL_INCLUDE)
|
||||
+INCLUDES_L += $(PNG_INCLUDE) $(FREETYPE_INCLUDE) $(SDL_INCLUDE) $(SDL_IMG_INCLUDE)
|
||||
|
||||
endif # TILES
|
||||
|
@ -667,7 +667,11 @@ let
|
||||
flex = flex_2_5_35;
|
||||
};
|
||||
|
||||
crawl = callPackage ../games/crawl { lua = lua5; };
|
||||
crawlTiles = callPackage ../games/crawl { };
|
||||
|
||||
crawl = callPackage ../games/crawl {
|
||||
tileMode = false;
|
||||
};
|
||||
|
||||
cv = callPackage ../tools/misc/cv { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user