numptyphysics (0.2+svn156-1) use_system_libbox2d.patch

Summary

 Makefile.am  |   39 ++-------------------------------------
 configure.in |    3 +++
 2 files changed, 5 insertions(+), 37 deletions(-)

    
download this patch

Patch contents

Description: Use system version of libbox2d-dev to build.
 Should be reworked to detect libbox2d dinamically, this way it could
 be incorporated upstream.

Forwarded: no
Author: Leo 'costela' Antunes <costela@debian.org>

Index: numptyphysics-0.2+svn156/Makefile.am
===================================================================
--- numptyphysics-0.2+svn156.orig/Makefile.am	2010-04-08 11:45:23.000000000 +0200
+++ numptyphysics-0.2+svn156/Makefile.am	2010-06-20 15:04:59.000000000 +0200
@@ -1,6 +1,4 @@
 bin_PROGRAMS = numptyphysics
-noinst_LIBRARIES = libbox2d.a
-INCLUDES = -IBox2D/Include
 
 desktopentry_DATA = data/numptyphysics.desktop
 serviceentry_DATA = data/numptyphysics.service
@@ -32,8 +30,8 @@
 	OsFreeDesktop.cpp \
 	OsWin32.cpp
 
-numptyphysics_CPPFLAGS = -IXX $(SDL_CFLAGS) $(HILDON_CFLAGS)
-numptyphysics_LDADD = libbox2d.a $(SDL_LIBS) $(HILDON_LIBS)
+numptyphysics_CPPFLAGS = -IXX $(SDL_CFLAGS) $(HILDON_CFLAGS) $(BOX2D_CFLAGS)
+numptyphysics_LDADD = $(SDL_LIBS) $(HILDON_LIBS) $(BOX2D_LIBS)
 
 numptyphysics_DATA = \
 	data/C00_Title.npz \
@@ -61,36 +59,3 @@
 	data/femkeklaver.ttf
 
 
-libbox2d_a_SOURCES = \
-	Box2D/Source/Collision/b2Distance.cpp \
-	Box2D/Source/Collision/b2TimeOfImpact.cpp \
-	Box2D/Source/Collision/b2CollideCircle.cpp \
-	Box2D/Source/Collision/b2CollidePoly.cpp \
-	Box2D/Source/Collision/Shapes/b2PolygonShape.cpp \
-	Box2D/Source/Collision/Shapes/b2CircleShape.cpp \
-	Box2D/Source/Collision/Shapes/b2Shape.cpp \
-	Box2D/Source/Collision/b2PairManager.cpp \
-	Box2D/Source/Collision/b2Collision.cpp \
-	Box2D/Source/Collision/b2BroadPhase.cpp \
-	Box2D/Source/Dynamics/b2WorldCallbacks.cpp \
-	Box2D/Source/Dynamics/Joints/b2PrismaticJoint.cpp \
-	Box2D/Source/Dynamics/Joints/b2MouseJoint.cpp \
-	Box2D/Source/Dynamics/Joints/b2GearJoint.cpp \
-	Box2D/Source/Dynamics/Joints/b2Joint.cpp \
-	Box2D/Source/Dynamics/Joints/b2PulleyJoint.cpp \
-	Box2D/Source/Dynamics/Joints/b2DistanceJoint.cpp \
-	Box2D/Source/Dynamics/Joints/b2RevoluteJoint.cpp \
-	Box2D/Source/Dynamics/Contacts/b2CircleContact.cpp \
-	Box2D/Source/Dynamics/Contacts/b2PolyAndCircleContact.cpp \
-	Box2D/Source/Dynamics/Contacts/b2Contact.cpp \
-	Box2D/Source/Dynamics/Contacts/b2PolyContact.cpp \
-	Box2D/Source/Dynamics/Contacts/b2ContactSolver.cpp \
-	Box2D/Source/Dynamics/b2Island.cpp \
-	Box2D/Source/Dynamics/b2Body.cpp \
-	Box2D/Source/Dynamics/b2ContactManager.cpp \
-	Box2D/Source/Dynamics/b2World.cpp \
-	Box2D/Source/Common/b2BlockAllocator.cpp \
-	Box2D/Source/Common/b2StackAllocator.cpp \
-	Box2D/Source/Common/b2Settings.cpp \
-	Box2D/Source/Common/b2Math.cpp
-
Index: numptyphysics-0.2+svn156/configure.in
===================================================================
--- numptyphysics-0.2+svn156.orig/configure.in	2010-02-22 22:51:55.000000000 +0100
+++ numptyphysics-0.2+svn156/configure.in	2010-06-20 15:04:59.000000000 +0200
@@ -9,6 +9,8 @@
 AC_PROG_INSTALL
 AC_PROG_RANLIB
 
+PKG_PROG_PKG_CONFIG
+
 # Check for SDL
 AC_CHECK_HEADER(
 	SDL/SDL.h,
@@ -73,6 +75,7 @@
 AC_SUBST(icon_64x64dir)
 AC_SUBST(icon_scalabledir)
 
+PKG_CHECK_MODULES(BOX2D, box2d >= 2.0.0)
 
 AC_CHECK_LIB(stdc++, main)
 AC_CHECK_LIB(X11, main)