aboutsummaryrefslogtreecommitdiff
path: root/fheroes2
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2011-01-02 02:07:27 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2011-01-02 02:07:27 +0100
commit0a95e15cdc87de0136734e784d487f9b03170bbb (patch)
treeadae83e51ba5b78869f51aa43cfe8ebfb762ec41 /fheroes2
downloadnanonote-ports-0a95e15cdc87de0136734e784d487f9b03170bbb.tar.gz
initial checkin of my nanonote ports feed, including a small README.
Diffstat (limited to 'fheroes2')
-rw-r--r--fheroes2/Makefile103
-rw-r--r--fheroes2/files/fheroes2.cfg90
-rw-r--r--fheroes2/patches/001-crosscompile.patch20
3 files changed, 213 insertions, 0 deletions
diff --git a/fheroes2/Makefile b/fheroes2/Makefile
new file mode 100644
index 0000000..820fcaa
--- /dev/null
+++ b/fheroes2/Makefile
@@ -0,0 +1,103 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fheroes2
+PKG_VERSION:=r1954
+PKG_RELEASE:=1
+
+PKG_SOURCE:=fheroes2-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/fheroes2
+PKG_MD5SUM:=612a4fe2d18b748bc4367ffddff734b5
+
+PKG_BUILD_DIR=$(BUILD_DIR)/fheroes2-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fheroes2
+ SECTION:=games
+ CATEGORY:=Games
+ DEPENDS:=+libsdl +libsdl-image +libpng +zlib
+ TITLE:=Free Heroes 2 Engine
+ URL:=http://sourceforge.net/projects/fheroes2/
+ MENU:=1
+endef
+
+define Package/fheroes2/config
+ menu "Configuration"
+ depends on PACKAGE_fheroes2
+
+ config FHEROES2_WITH_UNICODE
+ prompt "Unicode, internationalization and TTF support"
+ bool
+ select PACKAGE_libsdl-ttf
+ select PACKAGE_libintl
+
+ config FHEROES2_WITH_MUSIC
+ prompt "MIDI/OGG Music support"
+ bool
+ select PACKAGE_libsdl-mixer
+ endmenu
+endef
+
+define Package/fheroes2/description
+Free implementation of Heroes of the Might and Magic II engine.
+
+Note that SDL-mixer has built-in Timidity MIDI support (that also
+requires GUS patches of course) but apparently won't work with
+the HOMM2 game data since it uses XMI. So either compile without
+music support or get/render OGG versions of the music and place them
+under /usr/share/fheroes2/files/music and adapt fheroes2.cfg
+accordingly. Also make sure SDL-mixer is compiled with OGG music
+support. fheroes2 also supports external programs to play music
+when SDL-mixer support is disabled, so there may be other
+possibilities...
+endef
+
+MAKE_VARS := \
+ WITHOUT_AUDIOCD=y \
+ WITHOUT_NETWORK=y \
+ WITHOUT_EDITOR=y
+
+ifeq ($(CONFIG_FHEROES2_WITH_UNICODE),)
+
+MAKE_VARS += WITHOUT_UNICODE=y
+
+else
+
+EXTRA_CPPFLAGS += -I$(STAGING_DIR)/usr/lib/libintl/include
+EXTRA_LDFLAGS += -L$(STAGING_DIR)/usr/lib/libintl/lib -lintl
+
+# SDL_ttf depends on libfreetype but somehow the lib cannot be found automatically
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/host/bin/freetype-config --libs)
+
+endif
+
+ifeq ($(CONFIG_FHEROES2_WITH_MUSIC),)
+MAKE_VARS += WITHOUT_MIXER=y
+endif
+
+# SDL depends on DirectFB but somehow the libs are not not found automatically
+EXTRA_LDFLAGS += $(shell $(STAGING_DIR)/root-xburst/usr/bin/directfb-config --libs --prefix=$(STAGING_DIR)/usr)
+
+EXTRA_CPPFLAGS += \
+ -D'CONFIGURE_FHEROES2_DATA=\"/usr/share/fheroes2\"' \
+ -DWITH_KEYMAPPING -DWITHOUT_MOUSE
+
+define Build/Configure
+endef
+
+define Build/Compile
+ $(CONFIGURE_VARS) \
+ $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_VARS)
+endef
+
+define Package/fheroes2/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/fheroes2 $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/share/fheroes2
+ $(INSTALL_DATA) $(SOURCE)/files/fheroes2.cfg $(1)/usr/share/fheroes2/
+ $(INSTALL_DIR) $(1)/usr/share/fheroes2/data
+ $(INSTALL_DIR) $(1)/usr/share/fheroes2/maps
+ $(CP) -r $(PKG_BUILD_DIR)/files $(1)/usr/share/fheroes2/
+endef
+
+$(eval $(call BuildPackage,fheroes2))
diff --git a/fheroes2/files/fheroes2.cfg b/fheroes2/files/fheroes2.cfg
new file mode 100644
index 0000000..155da24
--- /dev/null
+++ b/fheroes2/files/fheroes2.cfg
@@ -0,0 +1,90 @@
+# Default config fheroes2.cfg options:
+#
+# path to directory data
+# data = /usr/share/fheroes2/data
+#
+# path to directory maps, you can set few maps
+# maps = maps
+# maps = /usr/share/fheroes2/maps
+#
+# use alternative resource
+# alt resource = off
+#
+# sound: on off
+sound = on
+#
+# music: on,midi,cd,ext,off
+music = on
+#
+# sound volume: 0 - 10
+# sound volume = 6
+#
+# music volume: 0 - 10
+# music volume = 6
+#
+# external play music command:
+# playmus command = ""
+#
+# video mode (640x480, 800x576, 1024x768, 1280x1024 or other divisible 32)
+videomode = 320x240
+#
+# current animation speed: 0 - 10
+animation = 10
+#
+# fullscreen: on off (F4 switch)
+fullscreen = on
+#
+# debug
+debug = off
+#
+# use ttf fonts
+unicode = on
+#
+# force lang
+# lang = en
+#
+# font name (only with unicode = on)
+# fonts normal = dejavusans.ttf
+# fonts small = dejavusans.ttf
+# fonts normal size = 15
+# fonts small size = 10
+#
+# fonts render engine: (blended/solid) (only with unicode = on)
+fonts render = blended
+#
+# network port:
+# port = 5154
+#
+# pocket pc emulation (set auto on for videomode < 640x480)
+pocket pc = on
+#
+# pocket pc options:
+# tap delay = 1050
+# pointer offset x = 0
+# pointer offset y = 0
+#
+# virtual key mapping:
+# key_273 = '.'
+# key_275 = '/'
+
+# see http://en.qi-hardware.com/wiki/Key_codes
+
+key_98 = ';'
+key_46 = '/'
+#key_33 = ','
+key_47 = '.'
+
+key_282 = '1'
+key_283 = '3'
+key_284 = '5'
+key_285 = '7'
+key_286 = '9'
+
+emulate mouse = on
+emulate mouse step = 5
+emulate mouse up = 273
+emulate mouse down = 274
+emulate mouse right = 275
+emulate mouse left = 276
+emulate press left = 292
+emulate press right = 293
diff --git a/fheroes2/patches/001-crosscompile.patch b/fheroes2/patches/001-crosscompile.patch
new file mode 100644
index 0000000..ad1f5c2
--- /dev/null
+++ b/fheroes2/patches/001-crosscompile.patch
@@ -0,0 +1,20 @@
+--- a/src/Makefile 2010-10-02 21:43:52.099078234 +0200
++++ b/src/Makefile 2010-10-02 23:46:44.197838553 +0200
+@@ -6,8 +6,8 @@
+ SDL_LIBS := $(shell sdl-config --libs)
+ SDL_FLAGS := $(shell sdl-config --cflags)
+
+-CFLAGS := $(CFLAGS) -Wall -fsigned-char -DWITH_KEYMAPPING
+-LDFLAGS :=
++CFLAGS := $(CFLAGS) $(CPPFLAGS) -Wall -fsigned-char -DWITH_KEYMAPPING
++LDFLAGS := $(LDFLAGS)
+ LIBS :=
+
+ ifdef DEBUG
+--- a/src/Makefile.unix 2010-10-02 21:43:38.669081686 +0200
++++ b/src/Makefile.unix 2010-10-02 21:43:47.457845197 +0200
+@@ -1,2 +1,2 @@
+-AR := ar
+-CXX := g++
++AR ?= ar
++CXX ?= g++