summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2014-07-29 13:20:18 -0500
committerJohn Wiegley <johnw@newartisans.com>2014-07-29 13:20:18 -0500
commit867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02 (patch)
tree1072d42868afda7b5010742309f04e9dafb039b7 /pkgs/games
parent559eaeb2d2b9197d36505a5563c7185ed6371f6f (diff)
parent826e96af0e9fb2f26043e75b6466dce9bdf7de61 (diff)
downloadnixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.tar
nixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.tar.gz
nixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.tar.bz2
nixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.tar.lz
nixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.tar.xz
nixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.tar.zst
nixpkgs-867d3fbf47e7ef2b4a87eeb29b88a6ee8e639c02.zip
Merge pull request #3372 from FlorentBecker/crawl
Add dungeon crawl stone soup 0.14
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/crawl/default.nix24
-rw-r--r--pkgs/games/crawl/makefile_fonts.patch20
-rw-r--r--pkgs/games/crawl/makefile_misc.patch39
-rw-r--r--pkgs/games/crawl/makefile_prefix.patch11
-rw-r--r--pkgs/games/crawl/makefile_rltiles.patch21
-rw-r--r--pkgs/games/crawl/makefile_rltiles2.patch10
-rw-r--r--pkgs/games/crawl/makefile_sdlimg.patch19
-rw-r--r--pkgs/games/crawl/makefile_sqlite.patch11
8 files changed, 155 insertions, 0 deletions
diff --git a/pkgs/games/crawl/default.nix b/pkgs/games/crawl/default.nix
new file mode 100644
index 00000000000..6cb48d85f85
--- /dev/null
+++ b/pkgs/games/crawl/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, sqlite, lua, which, zlib, pkgconfig, dejavu_fonts,
+  libpng, perl, SDL, SDL_image, ncurses, mesa}:
+
+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";
+      };
+
+   patches = [ ./makefile_fonts.patch ./makefile_sqlite.patch
+               ./makefile_rltiles.patch ./makefile_rltiles2.patch
+               ./makefile_misc.patch ./makefile_prefix.patch
+   ];
+
+   buildInputs = [stdenv pkgconfig lua zlib sqlite which libpng perl SDL
+                  dejavu_fonts SDL_image ncurses mesa];
+
+   preBuild = "cd source";
+
+   makeFlags = "TILES=y";
+
+   inherit dejavu_fonts sqlite SDL_image SDL;
+}
diff --git a/pkgs/games/crawl/makefile_fonts.patch b/pkgs/games/crawl/makefile_fonts.patch
new file mode 100644
index 00000000000..6c73407b65c
--- /dev/null
+++ b/pkgs/games/crawl/makefile_fonts.patch
@@ -0,0 +1,20 @@
+--- old/source/Makefile	2013-11-28 01:03:54.000000000 +0000
++++ new/source/Makefile	2014-02-05 14:04:32.531838188 +0000
+@@ -880,7 +880,7 @@
+     INSTALL_FONTS += $(PROPORTIONAL_FONT)
+   endif
+ else
+-  SYS_PROPORTIONAL_FONT = $(shell dir=/usr/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_PROPORTIONAL_FONT)|head -n 1)
++  SYS_PROPORTIONAL_FONT = $(shell dir=${dejavu_fonts}/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_PROPORTIONAL_FONT)|head -n 1)
+   ifeq (,$(SYS_PROPORTIONAL_FONT))
+     SYS_PROPORTIONAL_FONT = $(shell dir=/usr/local/share/fonts ; [ -d $$dir ] && find $$dir -iname $(OUR_PROPORTIONAL_FONT)|head -n 1)
+   endif
+@@ -903,7 +903,7 @@
+     INSTALL_FONTS += $(MONOSPACED_FONT)
+   endif
+ else
+-  SYS_MONOSPACED_FONT = $(shell dir=/usr/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_MONOSPACED_FONT)|head -n 1)
++  SYS_MONOSPACED_FONT = $(shell dir=${dejavu_fonts}/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_MONOSPACED_FONT)|head -n 1)
+   ifeq (,$(SYS_MONOSPACED_FONT))
+     SYS_MONOSPACED_FONT = $(shell dir=/usr/local/share/fonts; [ -d $$dir ] && find $$dir -iname $(OUR_MONOSPACED_FONT)|head -n 1)
+   endif
diff --git a/pkgs/games/crawl/makefile_misc.patch b/pkgs/games/crawl/makefile_misc.patch
new file mode 100644
index 00000000000..3849e79234b
--- /dev/null
+++ b/pkgs/games/crawl/makefile_misc.patch
@@ -0,0 +1,39 @@
+--- 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
+ 
diff --git a/pkgs/games/crawl/makefile_prefix.patch b/pkgs/games/crawl/makefile_prefix.patch
new file mode 100644
index 00000000000..869d703b125
--- /dev/null
+++ b/pkgs/games/crawl/makefile_prefix.patch
@@ -0,0 +1,11 @@
+--- 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
diff --git a/pkgs/games/crawl/makefile_rltiles.patch b/pkgs/games/crawl/makefile_rltiles.patch
new file mode 100644
index 00000000000..e08859c989b
--- /dev/null
+++ b/pkgs/games/crawl/makefile_rltiles.patch
@@ -0,0 +1,21 @@
+--- 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
diff --git a/pkgs/games/crawl/makefile_rltiles2.patch b/pkgs/games/crawl/makefile_rltiles2.patch
new file mode 100644
index 00000000000..2508ad0a54c
--- /dev/null
+++ b/pkgs/games/crawl/makefile_rltiles2.patch
@@ -0,0 +1,10 @@
+--- 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
diff --git a/pkgs/games/crawl/makefile_sdlimg.patch b/pkgs/games/crawl/makefile_sdlimg.patch
new file mode 100644
index 00000000000..e6c7101de72
--- /dev/null
+++ b/pkgs/games/crawl/makefile_sdlimg.patch
@@ -0,0 +1,19 @@
+--- 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
+ 
diff --git a/pkgs/games/crawl/makefile_sqlite.patch b/pkgs/games/crawl/makefile_sqlite.patch
new file mode 100644
index 00000000000..fbcb925d608
--- /dev/null
+++ b/pkgs/games/crawl/makefile_sqlite.patch
@@ -0,0 +1,11 @@
+--- old/source/Makefile	2014-04-14 12:46:35.401956673 +0000
++++ new/source/Makefile	2014-04-14 12:47:12.757006254 +0000
+@@ -259,7 +259,7 @@
+ LIBZ := contrib/install/$(ARCH)/lib/libz.a
+ 
+ ifndef CROSSHOST
+-	SQLITE_INCLUDE_DIR := /usr/include
++	SQLITE_INCLUDE_DIR := ${sqlite}/include
+ else
+ 	# This is totally wrong, works only with some old-style setups, and
+ 	# on some architectures of Debian/new FHS multiarch -- excluding, for