From 7ec9e958099f9042398921fd96e168fc0183fe69 Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Wed, 20 Apr 2011 19:22:21 +0800 Subject: [PATCH] new package: libtcod for ascii-paint --- libtcod/Makefile | 56 +++++++++++++ libtcod/patches/001-pass-openwrt-CFLAGS.patch | 84 +++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 libtcod/Makefile create mode 100644 libtcod/patches/001-pass-openwrt-CFLAGS.patch diff --git a/libtcod/Makefile b/libtcod/Makefile new file mode 100644 index 0000000..a9a26d0 --- /dev/null +++ b/libtcod/Makefile @@ -0,0 +1,56 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libtcod +PKG_REV:=522 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=svn +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://doryen.eptalys.net/svn-libtcod/branches/1.5.0/ +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/ + +include $(INCLUDE_DIR)/package.mk + +define Package/libtcod + MAINTAINER:="Xiangfu Liu" + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Libtcod + URL:=http://www.autistici.org/bakunin/libtcod/doc/ + DEPENDS:=+libpng +zlib +libsdl +endef + +define Package/libtcod/description + libtcod, a.k.a. “The Doryen Library”, is a free, fast, portable and uncomplicated API for roguelike developpers providing an advanced true color console, input, and lots of other utilities frequently used in roguelikes. +endef + +TARGET_CFLAGS+=-fPIC +TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +MAKE_VARS+=TEMP=$(PKG_BUILD_DIR)/obj + +define Build/Compile + $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \ + $(MAKE_FLAGS) \ + -f makefiles/makefile-linux \ + release +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libtcod.so* $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libtcodxx.so* $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libtcodgui.so* $(1)/usr/lib/ +endef + +define Package/libtcod/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libtcod.so* $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libtcodxx.so* $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libtcodgui.so* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libtcod)) diff --git a/libtcod/patches/001-pass-openwrt-CFLAGS.patch b/libtcod/patches/001-pass-openwrt-CFLAGS.patch new file mode 100644 index 0000000..84c9366 --- /dev/null +++ b/libtcod/patches/001-pass-openwrt-CFLAGS.patch @@ -0,0 +1,84 @@ +diff -Naur libtcod-r522/makefiles/makefile-linux libtcod-r522.mod/makefiles/makefile-linux +--- libtcod-r522/makefiles/makefile-linux 2010-02-12 03:54:10.000000000 +0800 ++++ libtcod-r522.mod/makefiles/makefile-linux 2011-04-20 19:20:36.595075461 +0800 +@@ -6,8 +6,8 @@ + + #dependencies + # SDL +-SDL_FLAGS=`sdl-config --cflags` +-SDL_LIBS=`sdl-config --libs` ++SDL_FLAGS?=`sdl-config --cflags` ++SDL_LIBS?=`sdl-config --libs` + + # ZLIB + ZLIB_FLAGS= +@@ -16,24 +16,24 @@ + # PNG + PNG_LIBS=-lpng + +-CFLAGS=$(FLAGS) -I$(INCDIR) -I$(INCDIR)/gui -Wall $(SDL_FLAGS) $(ZLIB_FLAGS) $(PNG_FLAGS) -fno-strict-aliasing +-TEMP=/tmp +-CC=gcc +-CPP=g++ ++CFLAGS:=$(CFLAGS) $(FLAGS) -I$(INCDIR) -I$(INCDIR)/gui -Wall $(SDL_FLAGS) $(ZLIB_FLAGS) $(PNG_FLAGS) -fno-strict-aliasing ++TEMP?=/tmp ++CC?=gcc ++CXX?=g++ + .SUFFIXES: a .o .h .c + + $(TEMP)/libtcod/release/%.o : $(SRCDIR)/%.c + $(CC) $(CFLAGS) -O2 -s -o $@ -c $< + $(TEMP)/libtcod/release/%.o : $(SRCDIR)/%.cpp +- $(CPP) $(CFLAGS) -O2 -s -o $@ -c $< ++ $(CXX) $(CFLAGS) -O2 -s -o $@ -c $< + $(TEMP)/libtcod/release/gui/%.o : $(SRCDIR)/gui/%.cpp +- $(CPP) $(CFLAGS) -O2 -s -o $@ -c $< ++ $(CXX) $(CFLAGS) -O2 -s -o $@ -c $< + $(TEMP)/libtcod/debug/%.o : $(SRCDIR)/%.c + $(CC) $(CFLAGS) -g -o $@ -c $< + $(TEMP)/libtcod/debug/%.o : $(SRCDIR)/%.cpp +- $(CPP) $(CFLAGS) -g -o $@ -c $< ++ $(CXX) $(CFLAGS) -g -o $@ -c $< + $(TEMP)/libtcod/debug/gui/%.o : $(SRCDIR)/gui/%.cpp +- $(CPP) $(CFLAGS) -g -o $@ -c $< ++ $(CXX) $(CFLAGS) -g -o $@ -c $< + + LIBOBJS_C_DEBUG= \ + $(TEMP)/libtcod/debug/bresenham_c.o \ +@@ -181,28 +181,28 @@ + mkdir -p $@ + + libtcod.a : $(LIBOBJS_C_DEBUG) +- ar r $@ $(LIBOBJS_C_DEBUG) ++ $(AR) r $@ $(LIBOBJS_C_DEBUG) + + libtcodxx.a : $(LIBOBJS_CPP_DEBUG) +- ar r $@ $(LIBOBJS_CPP_DEBUG) ++ $(AR) r $@ $(LIBOBJS_CPP_DEBUG) + + libtcod.so : $(TEMP)/libtcod/release $(LIBOBJS_C_RELEASE) +- gcc -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_C_RELEASE) $(ZLIB_LIBS) $(PNG_LIBS) $(SDL_LIBS) $(CFLAGS) $(OPENGL_LIB) ++ $(CC) -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_C_RELEASE) $(CFLAGS) $(OPENGL_LIB) $(PNG_LIBS) $(SDL_LIBS) $(ZLIB_LIBS) + + libtcodxx.so : $(TEMP)/libtcod/release $(LIBOBJS_CPP_RELEASE) +- gcc -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_CPP_RELEASE) -L. -ltcod $(CFLAGS) ++ $(CC) -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_CPP_RELEASE) -L. -ltcod $(CFLAGS) + + libtcodgui.so : $(TEMP)/libtcod/release/gui $(GUIOBJS_RELEASE) +- gcc -shared -Wl,-soname,$@ -o $@ $(GUIOBJS_RELEASE) -L. -ltcod -ltcodxx $(CFLAGS) ++ $(CC) -shared -Wl,-soname,$@ -o $@ $(GUIOBJS_RELEASE) -L. -ltcod -ltcodxx $(CFLAGS) + + libtcod_debug.so : $(TEMP)/libtcod/debug $(LIBOBJS_C_DEBUG) +- gcc -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_C_DEBUG) $(ZLIB_LIBS) $(PNG_LIBS) $(SDL_LIBS) $(CFLAGS) $(OPENGL_LIB) ++ $(CC) -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_C_DEBUG) $(ZLIB_LIBS) $(PNG_LIBS) $(SDL_LIBS) $(CFLAGS) $(OPENGL_LIB) + + libtcodxx_debug.so : $(TEMP)/libtcod/debug $(LIBOBJS_CPP_DEBUG) +- gcc -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_CPP_DEBUG) -L. -ltcod_debug $(CFLAGS) ++ $(CC) -shared -Wl,-soname,$@ -o $@ $(LIBOBJS_CPP_DEBUG) -L. -ltcod_debug $(CFLAGS) + + libtcodgui_debug.so : $(TEMP)/libtcod/debug/gui $(GUIOBJS_DEBUG) +- gcc -shared -Wl,-soname,$@ -o $@ $(GUIOBJS_DEBUG) -L. -ltcod_debug -ltcodxx_debug $(CFLAGS) ++ $(CC) -shared -Wl,-soname,$@ -o $@ $(GUIOBJS_DEBUG) -L. -ltcod_debug -ltcodxx_debug $(CFLAGS) + + clean : + \rm -f $(LIBOBJS_C_RELEASE) $(LIBOBJS_CPP_RELEASE) $(GUIOBJS_RELEASE) $(LIBOBJS_C_DEBUG) $(LIBOBJS_CPP_DEBUG) $(GUIOBJS_DEBUG) libtcod.a libtcodxx.a libtcod.so libtcodxx.so libtcodgui.so libtcod_debug.so libtcodxx_debug.so libtcodgui_debug.so libtcodpy.pyc