Date:2011-05-29 13:55:53 (9 years 1 month ago)
Author:David K├╝hling
Commit:47070570b84063ed491835a22362104d7e71af67
Message:new package: liballegro: a lightweight game and multimedia library

Files: liballegro/Makefile (1 diff)
liballegro/patches/010-shooter-gfx-mode.patch (1 diff)

Change Details

liballegro/Makefile
1#
2# Copyright (C) David Kuehling <dvdkhlng TA gmx TOD de>
3#
4# License GPLv2 or later. NO WARRANTY.
5#
6# OpenWRT package for the Allegro game and multimedia library
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=liballegro
11PKG_VERSION:=4.4.2
12PKG_RELEASE:=1
13PKG_SOURCE:=allegro-$(PKG_VERSION).tar.gz
14PKG_SOURCE_URL:=@SF/alleg/allegro/$(PKG_VERSION)
15PKG_BUILD_DIR = $(BUILD_DIR)/allegro-$(PKG_VERSION)
16HOST_BUILD_DIR = $(BUILD_DIR_HOST)/allegro-$(PKG_VERSION)
17
18PKG_MD5SUM:=4db71b0460fc99926ae91d223199c2e6
19PKG_INSTALL:=1
20
21PKG_FIXUP:=libtool
22PKG_REMOVE_FILES:=
23
24PKG_BUILD_DEPENDS:=liballegro/host
25
26include $(INCLUDE_DIR)/host-build.mk
27include $(INCLUDE_DIR)/package.mk
28include $(INCLUDE_DIR)/cmake.mk
29
30define Package/liballegro/Default
31  SUBMENU:=Liballegro
32  SECTION:=libs
33  CATEGORY:=Libraries
34  TITLE:=The Allegro Game Programming Library
35  URL:=alleg.sf.net
36# SUBMENU:=Editors
37endef
38
39define Package/liballegro/Default/description
40Allegro is a cross-platform library for computer games and multimedia
41programming.
42endef
43
44define Package/liballegro
45$(call Package/liballegro/Default)
46  DEPENDS:=
47  TITLE+= (library)
48endef
49
50define Package/liballegro/description
51$(call Package/liballegro/Default/description)
52 This package contains the Allegro library
53endef
54
55define Package/liballegro-data
56$(call Package/liballegro/Default)
57  TITLE+= (data)
58endef
59
60define Package/liballegro-data/description
61$(call Package/liballegro/Default/description)
62 This package contains various data files that are used by the Allegro library.
63endef
64
65define Package/liballegro-demo
66$(call Package/liballegro/Default)
67  TITLE+= (demo)
68  DEPENDS:=+liballegro
69endef
70
71define Package/liballegro-demo/description
72$(call Package/liballegro/Default/description)
73 This package contains the Allegro demo game.
74endef
75
76define Package/liballegro-setup
77$(call Package/liballegro/Default)
78  TITLE+= (setup)
79  DEPENDS:=+liballegro
80endef
81
82define Package/liballegro-setup/description
83$(call Package/liballegro/Default/description)
84 This package contains the Allegro setup program
85endef
86
87define Package/liballegro-utils
88$(call Package/liballegro/Default)
89  TITLE+= (utils)
90endef
91
92define Package/liballegro-utils/description
93$(call Package/liballegro/Default/description)
94 This package contains the setup and test tool that ship with Allegro.
95endef
96
97HOST_CONFIGURE_ARGS +=
98CONFIGURE_ARGS +=
99
100TARGET_CPPFLAGS +=
101
102define Build/Prepare
103    $(call Build/Prepare/Default)
104endef
105
106HOST_CMAKE_FLAGS= \
107    -DCMAKE_INSTALL_PREFIX=$(STAGING_DIR_HOST) \
108    -DRT_LIBRARY= \
109    -DDL_LIBRARY= \
110    -DWANT_TOOLS=on \
111    -DWANT_TESTS=off \
112    -DWANT_MODULES=off \
113    -DWANT_EXAMPLES=off \
114    -DWANT_ALLEGROGL=off \
115    -DWANT_LOADPNG=off \
116    -DWANT_LOGG=off \
117    -DWANT_JPGALLEG=off \
118    -DWANT_X11=off \
119    -DWANT_LINUX_CONSOLE=on \
120    -DWANT_LINUX_FBCON=off \
121    -DWANT_LINUX_VGA=off \
122    -DWANT_LINUX_SVGALIB=off \
123    -DWANT_ALSA=off \
124    -DWANT_OSS=off \
125    -DWANT_JACK=off \
126    -DWANT_SGIAUDIO=off
127
128define Host/Configure
129    cd $(HOST_BUILD_DIR) && cmake $(HOST_CMAKE_FLAGS) .
130endef
131
132## On the host, we only need to compile the allegro develpment tools:
133## dat&friends
134define Host/Compile
135    $(call Host/Compile/Default, VERBOSE=1 -j4)
136endef
137
138define Host/Install
139    $(call Host/Install/Default)
140# $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib-src/make-docfile $(STAGING_DIR_HOST)/bin/liballegro-make-docfile
141# $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/prefix-args $(STAGING_DIR_HOST)/bin/liballegro-prefix-args
142endef
143
144# workaround for cmake.mk bug
145ifneq ($(CONFIG_CCACHE),)
146  CMAKE_C_COMPILER:=ccache
147  CMAKE_CXX_COMPILER:=ccache
148endif
149
150EXTRA_CFLAGS = -DSETUP_SCREEN_W=320 -DSETUP_SCREEN_H=240
151TARGET_LDFLAGS = -ldl -lrt
152
153CMAKE_OPTIONS = \
154    -DRT_LIBRARY= \
155    -DALLEGRO_USE_CONSTRUCTOR_EXITCODE=0 \
156    -DRT_LIBRARY= \
157    -DDL_LIBRARY= \
158    -DWANT_TOOLS=on \
159    -DWANT_TESTS=on \
160    -DWANT_MODULES=on \
161    -DWANT_EXAMPLES=on \
162    -DWANT_ALLEGROGL=off \
163    -DWANT_LOADPNG=on \
164    -DWANT_LOGG=off \
165    -DWANT_JPGALLEG=off \
166    -DWANT_X11=off \
167    -DWANT_LINUX_CONSOLE=on \
168    -DWANT_LINUX_FBCON=on \
169    -DWANT_LINUX_VGA=off \
170    -DWANT_LINUX_SVGALIB=off \
171    -DWANT_ALSA=on \
172    -DWANT_OSS=off \
173    -DWANT_JACK=off \
174    -DWANT_SGIAUDIO=off
175
176MAKE_FLAGS += -j4
177
178define Build/Configure
179    $(call Build/Configure/Default)
180endef
181
182define Build/Compile
183    $(call Build/Compile/Default)
184    $(call Build/Compile/Default -C PKG_BUILD_DIR)
185# ln -sf $(STAGING_DIR_HOST)/bin/liballegro-make-docfile $(PKG_BUILD_DIR)/lib-src/make-docfile
186endef
187
188define Build/Install
189    $(call Build/Install/Default)
190    #$(INSTALL_DATA) ./files/... $(PKG_INSTALL_DIR)/usr/share/..
191endef
192
193define Build/InstallDev
194    $(INSTALL_DIR) $(1)/usr/include/
195    $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
196
197    $(INSTALL_DIR) $(1)/usr/lib
198    $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
199    $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* \
200        $(1)/usr/lib/
201    $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
202        $(1)/usr/lib/pkgconfig/
203# $(SED) 's,-I$$$${includedir},,g' $(1)/usr/lib/pkgconfig/plplotd.pc
204# $(SED) 's,-L$$$${libdir},,g' $(1)/usr/lib/pkgconfig/plplotd.pc
205endef
206
207define Package/liballegro/install
208    $(INSTALL_DIR) $(1)/usr
209    $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr
210endef
211
212define Package/liballegro-data/install
213    $(INSTALL_DIR) $(1)/
214    $(CP) $(PKG_INSTALL_DIR)/usr/share $(1)/usr
215endef
216
217define Package/liballegro-demo/install
218    $(INSTALL_DIR) $(1)/usr/bin
219    $(INSTALL_DIR) $(1)/usr/share/allegro/shooter
220    $(INSTALL_DIR) $(1)/usr/share/allegro/skater
221    $(CP) $(PKG_BUILD_DIR)/demos/shooter/shooter $(1)/usr/bin/
222    $(CP) $(PKG_BUILD_DIR)/demos/shooter/demo.dat $(1)/usr/share/allegro/shooter/
223    $(CP) $(PKG_BUILD_DIR)/demos/skater/skater $(1)/usr/bin/
224    $(CP) $(PKG_BUILD_DIR)/demos/skater/demo.dat $(1)/usr/share/allegro/skater/
225endef
226
227define Package/liballegro-setup/install
228    $(INSTALL_DIR) $(1)/usr/bin
229    $(INSTALL_DIR) $(1)/usr/share/allegro/
230    $(CP) $(PKG_BUILD_DIR)/setup/setup $(1)/usr/bin/
231    $(CP) $(PKG_BUILD_DIR)/setup/setup.dat $(1)/usr/share/allegro/
232endef
233
234define Package/liballegro-utils/install
235    $(INSTALL_DIR) $(1)/usr/bin
236    $(CP) $(PKG_INSTALL_DIR)/usr/bin $(1)/usr
237endef
238
239
240$(eval $(call HostBuild))
241$(eval $(call BuildPackage,liballegro))
242#$(eval $(call BuildPackage,liballegro-data))
243$(eval $(call BuildPackage,liballegro-demo))
244$(eval $(call BuildPackage,liballegro-setup))
245$(eval $(call BuildPackage,liballegro-utils))
246
247
248# The following comments configure the Emacs editor. Just ignore them.
249# Local Variables:
250# compile-command: "make -C ~/h/src/qi/openwrt-xburst package/liballegro/compile -j2 V=99"
251# End:
liballegro/patches/010-shooter-gfx-mode.patch
1Index: allegro-4.4.2/demos/shooter/demo.c
2===================================================================
3--- allegro-4.4.2.orig/demos/shooter/demo.c 2011-05-29 12:56:58.000000000 +0200
4@@ -90,9 +90,9 @@
5       allegro_message("Error initialising joystick\n%s\n", allegro_error);
6       install_joystick(JOY_TYPE_NONE);
7    }
8-
9- if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
10- if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
11+ set_color_depth(32);
12+ if (set_gfx_mode(GFX_AUTODETECT, 320, 240, 0, 0) != 0) {
13+ if (set_gfx_mode(GFX_SAFE, 320, 240, 0, 0) != 0) {
14          set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
15          allegro_message("Unable to set any graphic mode\n%s\n",
16                          allegro_error);

Archive Download the corresponding diff file



interactive