summaryrefslogtreecommitdiff
path: root/nethack/Makefile
blob: e843bd44e05c4b3f23e4179e97634dbc3f35cb15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Copyright (C) 2009 Qi Hardware Inc.
# Author: Xiangfu Liu <xiangfu@sharism.cc>
# 
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=nethack
PKG_VERSION:=343

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tgz
PKG_SOURCE_URL:=http://downloads.sourceforge.net/project/nethack/nethack/3.4.3/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.4.3

include $(INCLUDE_DIR)/package.mk

define Package/nethack
    SECTION:=games
    CATEGORY:=Games
    DEPENDS:=nethack
    TITLE:=single player dungeon exploration game
    DEPENDS:=+libncurses
endef

define Package/nethack/description
    NetHack is a single player dungeon exploration game
endef

TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include
TARGET_LDFLAGS+= -Wl,-rpath-link=$(STAGING_DIR)/usr/lib

define Build/Prepare
	$(call Build/Prepare/Default)
	(mkdir -p $(PKG_BUILD_DIR)/jemarch-bin; \
	cd $(PKG_BUILD_DIR)/; \
	wget http://www.jemarch.net/downloads/nanonote/nethack-3.4.3-nanonote-bin.tar.gz; \
	tar xf nethack-3.4.3-nanonote-bin.tar.gz -C jemarch-bin/; \
	)
endef

define Build/Compile
	(cd $(PKG_BUILD_DIR)/sys/unix; \
	sh setup.sh; \
	cd ../../; \
	export CFLAGS="${TARGET_CFLAGS}";\
	export LDFLAGS="${TARGET_LDFLAGS}";\
	export PREFIX="${PKG_INSTALL_DIR}";\
	make;\
	)
endef

define Package/nethack/install
	$(INSTALL_DIR) \
		$(1)/usr/bin \
		$(1)/usr/lib/nethackdir

	$(INSTALL_BIN) \
		$(PKG_BUILD_DIR)/src/nethack \
		$(1)/usr/lib/nethackdir/

	$(CP) \
		$(PKG_BUILD_DIR)/jemarch-bin/nethack-3.4.3-nanonote-bin/lib/nethackdir/*
		$(1)/usr/lib/nethackdir/

	$(CP) \
		$(PKG_BUILD_DIR)/src/nethack \
		$(1)/usr/bin/
endef

$(eval $(call BuildPackage,nethack))