new package box2d

this introduces a new dependency for unpacking the 7z archive from Box2D
This commit is contained in:
Martin Gerhardy 2015-06-29 08:34:40 +02:00
parent 6e6c2ab143
commit 3559d54844
3 changed files with 39 additions and 2 deletions

View File

@ -37,7 +37,7 @@ WGET := wget --no-check-certificate \
REQUIREMENTS := autoconf automake autopoint bash bison bzip2 cmake flex \
gcc g++ gperf intltoolize $(LIBTOOL) $(LIBTOOLIZE) \
$(MAKE) openssl $(PATCH) $(PERL) python ruby scons \
$(SED) $(SORT) unzip wget xz
$(SED) $(SORT) unzip wget xz 7z
PREFIX := $(PWD)/usr
LOG_DIR := $(PWD)/log
@ -138,8 +138,9 @@ UNPACK_ARCHIVE = \
$(if $(filter %.tar.lzma,$(1)),xz -dc -F lzma '$(1)' | tar xf -, \
$(if $(filter %.txz, $(1)),xz -dc '$(1)' | tar xf -, \
$(if $(filter %.tar.xz, $(1)),xz -dc '$(1)' | tar xf -, \
$(if $(filter %.7z, $(1)),7z x '$(1)', \
$(if $(filter %.zip, $(1)),unzip -q '$(1)', \
$(error Unknown archive format: $(1))))))))))
$(error Unknown archive format: $(1)))))))))))
UNPACK_PKG_ARCHIVE = \
$(call UNPACK_ARCHIVE,$(PKG_DIR)/$($(1)_FILE))

View File

@ -1093,6 +1093,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="package">boost</td>
<td class="website"><a href="http://www.boost.org/">Boost C++ Library</a></td>
</tr>
<tr>
<td class="package">box2d</td>
<td class="website"><a href="http://www.box2d.org/">Box2D</a></td>
</tr>
<tr>
<td class="package">bullet</td>
<td class="website"><a href="http://bulletphysics.org/">Bullet physics, version 2</a></td>

32
src/box2d.mk Normal file
View File

@ -0,0 +1,32 @@
# This file is part of MXE.
# See index.html for further information.
PKG := box2d
$(PKG)_IGNORE :=
$(PKG)_VERSION := 2.3.0
$(PKG)_CHECKSUM := 1d3ea1f872b3cab3ef5130a2404d74f9ff66f265
$(PKG)_SUBDIR := Box2D_v$($(PKG)_VERSION)/Box2D
$(PKG)_FILE := Box2D_v$($(PKG)_VERSION).7z
$(PKG)_URL := https://box2d.googlecode.com/files/$($(PKG)_FILE)
$(PKG)_DEPS := gcc
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://code.google.com/b/box2d/downloads/list?sort=-uploaded' | \
$(SED) -n 's,.*Box2D_v\([0-9][^<]*\)\.7z.*,\1,p' | \
grep -v 'rc' | \
head -1
endef
define $(PKG)_BUILD
mkdir '$(1).build'
cd '$(1).build' && cmake . \
-DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
-DBOX2D_INSTALL=ON \
-DBOX2D_BUILD_EXAMPLES=OFF \
$(if $(BUILD_SHARED), \
-DBOX2D_BUILD_SHARED=TRUE \
-DBOX2D_BUILD_STATIC=FALSE, \
-DBOX2D_BUILD_SHARED=FALSE) \
'$(1)'
$(MAKE) -C '$(1).build' -j '$(JOBS)' install VERBOSE=1
endef