mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
Box2D: Improved recipes now with _devel (#1108)
This commit is contained in:
committed by
Jérôme Duval
parent
8331c5b96f
commit
8bc699abdf
@@ -1,44 +0,0 @@
|
||||
SUMMARY="A 2D Physics Engine for Games"
|
||||
DESCRIPTION="Box2D is a feature rich 2D rigid body physics engine, written in C++. \
|
||||
It has been used in many games, including Crayon Physics Deluxe, \
|
||||
winner of the 2008 Independant Game Festival Grand Prize"
|
||||
HOMEPAGE="http://www.box2d.org"
|
||||
COPYRIGHT="2007-2009 Erin Catto"
|
||||
LICENSE="MIT"
|
||||
REVISION="2"
|
||||
SOURCE_URI="http://box2d.googlecode.com/files/Box2D_v2.1.2.zip"
|
||||
CHECKSUM_SHA256="3b351c3e51c6bf78c3e48a2b51260297f3f309fde389c9bfc21ebd484efbba54"
|
||||
SOURCE_DIR="Box2D_v2.1.2"
|
||||
PATCHES="box2d-2.1.2.patch"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 ?x86 !x86_64"
|
||||
|
||||
PROVIDES="
|
||||
box2d
|
||||
"
|
||||
REQUIRES="
|
||||
haiku
|
||||
"
|
||||
|
||||
BUILD_REQUIRES=""
|
||||
BUILD_PREREQUIRES="
|
||||
haiku_devel
|
||||
cmd:make
|
||||
cmd:cmake
|
||||
cmd:gcc
|
||||
devel:libgl
|
||||
devel:libglu
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cd Box2D
|
||||
cmake .
|
||||
make
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd Box2D
|
||||
make install
|
||||
}
|
||||
@@ -5,27 +5,34 @@ winner of the 2008 Independant Game Festival Grand Prize"
|
||||
HOMEPAGE="http://www.box2d.org"
|
||||
COPYRIGHT="2007-2015 Erin Catto"
|
||||
LICENSE="MIT"
|
||||
REVISION="2"
|
||||
REVISION="3"
|
||||
SOURCE_URI="https://github.com/erincatto/Box2D/archive/v2.3.1.zip"
|
||||
CHECKSUM_SHA256="1f04be518804a9879281a105a3c1511840371c96194b156eea5ad040d2805b46"
|
||||
SOURCE_DIR="Box2D-2.3.1"
|
||||
PATCHES="box2d-2.3.1.patch"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
|
||||
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
box2d$secondaryArchSuffix
|
||||
cmd:box2d$secondaryArchSuffix
|
||||
box2d$secondaryArchSuffix = $portVersion compat >= 2.0
|
||||
lib:libBox2D$secondaryArchSuffix
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
box2d${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libBox2D$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_devel="
|
||||
box2d$secondaryArchSuffix == $portVersion base
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libgl$secondaryArchSuffix
|
||||
devel:libglu$secondaryArchSuffix
|
||||
devel:libGL$secondaryArchSuffix
|
||||
devel:libGLU$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:make
|
||||
@@ -36,7 +43,8 @@ BUILD_PREREQUIRES="
|
||||
BUILD()
|
||||
{
|
||||
cd Box2D
|
||||
cmake . $cmakeDirArgs
|
||||
cmake . -DBOX2D_INCLUDE_DIR=$includeDir -DBOX2D_LIBRARY_DIRS=$libDir \
|
||||
-DBOX2D_BUILD_EXAMPLES=Off -DBOX2D_BUILD_SHARED=On
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
@@ -44,4 +52,7 @@ INSTALL()
|
||||
{
|
||||
cd Box2D
|
||||
make install
|
||||
|
||||
prepareInstalledDevelLib libBox2D
|
||||
packageEntries devel $developDir
|
||||
}
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
diff --git a/Box2D/CMakeLists.txt b/Box2D/CMakeLists.txt
|
||||
index a8ad550..17b3069 100644
|
||||
--- a/Box2D/CMakeLists.txt
|
||||
+++ b/Box2D/CMakeLists.txt
|
||||
@@ -26,7 +26,9 @@ if(BOX2D_BUILD_EXAMPLES)
|
||||
|
||||
# Testbed and dependencies.
|
||||
find_package(OpenGL REQUIRED)
|
||||
+if(NOT HAIKU) # Haiku has glut, so no need for freeglut
|
||||
add_subdirectory(freeglut)
|
||||
+endif(NOT HAIKU)
|
||||
add_subdirectory(glui)
|
||||
add_subdirectory(Testbed)
|
||||
endif(BOX2D_BUILD_EXAMPLES)
|
||||
diff --git a/Box2D/Testbed/CMakeLists.txt b/Box2D/Testbed/CMakeLists.txt
|
||||
index d1be5c0..ad716e4 100644
|
||||
--- a/Box2D/Testbed/CMakeLists.txt
|
||||
+++ b/Box2D/Testbed/CMakeLists.txt
|
||||
@@ -72,10 +72,19 @@ add_executable(Testbed
|
||||
${Testbed_Tests_SRCS}
|
||||
)
|
||||
|
||||
-target_link_libraries (
|
||||
- Testbed
|
||||
- Box2D
|
||||
- freeglut_static
|
||||
- glui
|
||||
- ${OPENGL_LIBRARIES}
|
||||
-)
|
||||
+if(HAIKU) # Haiku has glut, so no need for freeglut
|
||||
+ target_link_libraries (
|
||||
+ Testbed
|
||||
+ Box2D
|
||||
+ glui
|
||||
+ ${OPENGL_LIBRARIES}
|
||||
+)
|
||||
+else(HAIKU)
|
||||
+ target_link_libraries (
|
||||
+ Testbed
|
||||
+ Box2D
|
||||
+ freeglut_static
|
||||
+ glui
|
||||
+ ${OPENGL_LIBRARIES}
|
||||
+)
|
||||
+endif(HAIKU)
|
||||
diff --git a/Box2D/Testbed/Framework/Render.cpp b/Box2D/Testbed/Framework/Render.cpp
|
||||
index 3a6c680..b406367 100644
|
||||
--- a/Box2D/Testbed/Framework/Render.cpp
|
||||
+++ b/Box2D/Testbed/Framework/Render.cpp
|
||||
@@ -18,12 +18,16 @@
|
||||
|
||||
#include "Render.h"
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <GL/glut.h>
|
||||
+#else
|
||||
#include "freeglut/GL/glut.h"
|
||||
+#endif
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
|
||||
-#include <cstring>
|
||||
+#include <cstring>
|
||||
|
||||
void DebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
|
||||
{
|
||||
diff --git a/Box2D/Testbed/Framework/Test.cpp b/Box2D/Testbed/Framework/Test.cpp
|
||||
index 9e6a935..f43ee39 100644
|
||||
--- a/Box2D/Testbed/Framework/Test.cpp
|
||||
+++ b/Box2D/Testbed/Framework/Test.cpp
|
||||
@@ -19,7 +19,11 @@
|
||||
#include "Test.h"
|
||||
#include "Render.h"
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <GL/glut.h>
|
||||
+#else
|
||||
#include "freeglut/GL/glut.h"
|
||||
+#endif
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
diff --git a/Box2D/Testbed/Tests/TestEntries.cpp b/Box2D/Testbed/Tests/TestEntries.cpp
|
||||
index e12c102..1ca1db1 100644
|
||||
--- a/Box2D/Testbed/Tests/TestEntries.cpp
|
||||
+++ b/Box2D/Testbed/Tests/TestEntries.cpp
|
||||
@@ -18,7 +18,11 @@
|
||||
|
||||
#include "../Framework/Test.h"
|
||||
#include "../Framework/Render.h"
|
||||
+#ifdef __HAIKU__
|
||||
+#include <GL/glut.h>
|
||||
+#else
|
||||
#include "../../freeglut/GL/glut.h"
|
||||
+#endif
|
||||
#include <cstring>
|
||||
|
||||
#include "ApplyForce.h"
|
||||
diff --git a/Box2D/glui/GL/glui.h b/Box2D/glui/GL/glui.h
|
||||
index a412a77..66a846e 100644
|
||||
--- a/Box2D/glui/GL/glui.h
|
||||
+++ b/Box2D/glui/GL/glui.h
|
||||
@@ -49,6 +49,8 @@
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <GLUT/glut.h>
|
||||
+ #elif __HAIKU__
|
||||
+ #include <GL/glut.h>
|
||||
#else
|
||||
#include "../../freeglut/GL/glut.h"
|
||||
//#include <GL/glut.h>
|
||||
diff --git a/Box2D/glui/algebra3.cpp b/Box2D/glui/algebra3.cpp
|
||||
index ddc18f4..47f93b3 100644
|
||||
--- a/Box2D/glui/algebra3.cpp
|
||||
+++ b/Box2D/glui/algebra3.cpp
|
||||
@@ -830,11 +830,7 @@ vec4 operator*(float d, const vec4 &a)
|
||||
|
||||
vec4 operator*(const mat4 &a, const vec4 &v)
|
||||
{
|
||||
- #define ROWCOL(i) \
|
||||
- a.v[i].n[0]*v.n[VX] + \
|
||||
- a.v[i].n[1]*v.n[VY] + \
|
||||
- a.v[i].n[2]*v.n[VZ] + \
|
||||
- a.v[i].n[3]*v.n[VW]
|
||||
+ #define ROWCOL(i) a.v[i].n[0]*v.n[VX] + a.v[i].n[1]*v.n[VY] + a.v[i].n[2]*v.n[VZ] + a.v[i].n[3]*v.n[VW]
|
||||
|
||||
return vec4(ROWCOL(0), ROWCOL(1), ROWCOL(2), ROWCOL(3));
|
||||
|
||||
@@ -1107,8 +1103,7 @@ mat3 operator-(const mat3 &a, const mat3 &b)
|
||||
|
||||
mat3 operator*(const mat3 &a, const mat3 &b)
|
||||
{
|
||||
- #define ROWCOL(i, j) \
|
||||
- a.v[i].n[0]*b.v[0][j] + a.v[i].n[1]*b.v[1][j] + a.v[i].n[2]*b.v[2][j]
|
||||
+ #define ROWCOL(i, j) a.v[i].n[0]*b.v[0][j] + a.v[i].n[1]*b.v[1][j] + a.v[i].n[2]*b.v[2][j]
|
||||
|
||||
return mat3(
|
||||
vec3(ROWCOL(0,0), ROWCOL(0,1), ROWCOL(0,2)),
|
||||
@@ -1413,11 +1408,7 @@ mat4 operator-(const mat4 &a, const mat4 &b)
|
||||
|
||||
mat4 operator*(const mat4 &a, const mat4 &b)
|
||||
{
|
||||
- #define ROWCOL(i, j) \
|
||||
- a.v[i].n[0]*b.v[0][j] + \
|
||||
- a.v[i].n[1]*b.v[1][j] + \
|
||||
- a.v[i].n[2]*b.v[2][j] + \
|
||||
- a.v[i].n[3]*b.v[3][j]
|
||||
+ #define ROWCOL(i, j) a.v[i].n[0]*b.v[0][j] + a.v[i].n[1]*b.v[1][j] + a.v[i].n[2]*b.v[2][j] + a.v[i].n[3]*b.v[3][j]
|
||||
|
||||
return mat4(
|
||||
vec4(ROWCOL(0,0), ROWCOL(0,1), ROWCOL(0,2), ROWCOL(0,3)),
|
||||
diff --git a/Box2D/glui/glui_internal.h b/Box2D/glui/glui_internal.h
|
||||
index 20efc6f..8f450e1 100644
|
||||
--- a/Box2D/glui/glui_internal.h
|
||||
+++ b/Box2D/glui/glui_internal.h
|
||||
@@ -74,8 +74,7 @@
|
||||
|
||||
/************ check if a 2D point lies within a 2D box ***************/
|
||||
#ifndef PT_IN_BOX
|
||||
-#define PT_IN_BOX( x, y, lo_x, hi_x, lo_y, hi_y ) \
|
||||
-( IN_BOUNDS(x,lo_x,hi_x) AND IN_BOUNDS(y,lo_y,hi_y) )
|
||||
+#define PT_IN_BOX( x, y, lo_x, hi_x, lo_y, hi_y ) ( IN_BOUNDS(x,lo_x,hi_x) AND IN_BOUNDS(y,lo_y,hi_y) )
|
||||
#endif
|
||||
|
||||
/****** check if value lies on proper side of another value *****/
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
diff --git a/Box2D/CMakeLists.txt b/Box2D/CMakeLists.txt
|
||||
index a8ad550..17b3069 100644
|
||||
--- a/Box2D/CMakeLists.txt
|
||||
+++ b/Box2D/CMakeLists.txt
|
||||
@@ -26,7 +26,9 @@ if(BOX2D_BUILD_EXAMPLES)
|
||||
|
||||
# Testbed and dependencies.
|
||||
find_package(OpenGL REQUIRED)
|
||||
+ if(NOT HAIKU) # Haiku has glut, so no need for freeglut. Disable GLUI because it's not ported.
|
||||
add_subdirectory(freeglut)
|
||||
add_subdirectory(glui)
|
||||
add_subdirectory(Testbed)
|
||||
+ endif(NOT HAIKU)
|
||||
endif(BOX2D_BUILD_EXAMPLES)
|
||||
diff --git a/Box2D/Box2D/CMakeLists.txt b/Box2D/Box2D/CMakeLists.txt
|
||||
--- a/Box2D/Box2D/CMakeLists.txt
|
||||
+++ b/Box2D/Box2D/CMakeLists.txt
|
||||
@@ -207,8 +207,8 @@
|
||||
# install build system hooks for third-party apps
|
||||
install(EXPORT Box2D-targets DESTINATION ${LIB_INSTALL_DIR}/Box2D)
|
||||
|
||||
- set (BOX2D_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include)
|
||||
+ set (BOX2D_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/develop/headers )
|
||||
- set (BOX2D_INCLUDE_DIRS ${BOX2D_INCLUDE_DIR} )
|
||||
+ set (BOX2D_INCLUDE_DIRS ${BOX2D_INCLUDE_DIR} )
|
||||
- set (BOX2D_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR})
|
||||
+ set (BOX2D_LIBRARY_DIRS ${CMAKE_INSTALL_PREFIX}/develop/lib )
|
||||
set (BOX2D_LIBRARY Box2D)
|
||||
set (BOX2D_LIBRARIES ${BOX2D_LIBRARY})
|
||||
@@ -185,12 +185,12 @@
|
||||
if(BOX2D_INSTALL)
|
||||
# install headers
|
||||
- install(FILES ${BOX2D_General_HDRS} DESTINATION include/Box2D)
|
||||
+ install(FILES ${BOX2D_General_HDRS} DESTINATION develop/headers/Box2D)
|
||||
- install(FILES ${BOX2D_Collision_HDRS} DESTINATION include/Box2D/Collision)
|
||||
+ install(FILES ${BOX2D_Collision_HDRS} DESTINATION develop/headers/Box2D/Collision)
|
||||
- install(FILES ${BOX2D_Shapes_HDRS} DESTINATION include/Box2D/Collision/Shapes)
|
||||
+ install(FILES ${BOX2D_Shapes_HDRS} DESTINATION develop/headers/Box2D/Collision/Shapes)
|
||||
- install(FILES ${BOX2D_Common_HDRS} DESTINATION include/Box2D/Common)
|
||||
+ install(FILES ${BOX2D_Common_HDRS} DESTINATION develop/headers/Box2D/Common)
|
||||
- install(FILES ${BOX2D_Dynamics_HDRS} DESTINATION include/Box2D/Dynamics)
|
||||
+ install(FILES ${BOX2D_Dynamics_HDRS} DESTINATION develop/headers/Box2D/Dynamics)
|
||||
- install(FILES ${BOX2D_Contacts_HDRS} DESTINATION include/Box2D/Dynamics/Contacts)
|
||||
+ install(FILES ${BOX2D_Contacts_HDRS} DESTINATION develop/headers/Box2D/Dynamics/Contacts)
|
||||
- install(FILES ${BOX2D_Joints_HDRS} DESTINATION include/Box2D/Dynamics/Joints)
|
||||
+ install(FILES ${BOX2D_Joints_HDRS} DESTINATION develop/headers/Box2D/Dynamics/Joints)
|
||||
- install(FILES ${BOX2D_Rope_HDRS} DESTINATION include/Box2D/Rope)
|
||||
+ install(FILES ${BOX2D_Rope_HDRS} DESTINATION develop/headers/Box2D/Rope)
|
||||
|
||||
# install libraries
|
||||
Reference in New Issue
Block a user