[Box2D] Update

Lubomir Rintel lkundrak at fedoraproject.org
Fri Feb 20 15:05:16 UTC 2015


commit eb311258d0b21e089a237c66b64c12add5434994
Author: Lubomir Rintel <lkundrak at v3.sk>
Date:   Fri Feb 20 16:05:07 2015 +0100

    Update

 .gitignore                          |   1 +
 Box2D-2.2.1-unbundle-freeglut.patch |  44 ------------
 Box2D-2.2.1-unbundle-glui.patch     |  52 --------------
 Box2D-2.3.1-cmake.patch             | 136 ++++++++++++++++++++++++++++++++++++
 Box2D.spec                          |  35 +++++-----
 sources                             |   2 +-
 6 files changed, 155 insertions(+), 115 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index bbcd89d..0c7b5d1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 /Box2D_v2.2.1.zip
+/Box2D-2.3.1.tar.gz
diff --git a/Box2D-2.3.1-cmake.patch b/Box2D-2.3.1-cmake.patch
new file mode 100644
index 0000000..8eb91aa
--- /dev/null
+++ b/Box2D-2.3.1-cmake.patch
@@ -0,0 +1,136 @@
+This fixes the CMake build. Fixed upstream here:
+https://code.google.com/p/box2d/source/detail?r=313
+
+This does not use the bundled glew and glfw.
+
+Lubomir Rintel <lkundrak at v3.sk>
+
+diff -urp Box2D-2.3.1/CMakeLists.txt Box2D-2.3.1.fix/CMakeLists.txt
+--- Box2D-2.3.1/CMakeLists.txt	2015-02-20 14:14:39.000000000 +0100
++++ Box2D-2.3.1.fix/CMakeLists.txt	2015-02-20 14:31:34.347669244 +0100
+@@ -26,8 +26,6 @@ if(BOX2D_BUILD_EXAMPLES)
+ 
+   # Testbed and dependencies.
+   find_package(OpenGL REQUIRED)
+-  add_subdirectory(freeglut)
+-  add_subdirectory(glui)
+   add_subdirectory(Testbed)
+ endif(BOX2D_BUILD_EXAMPLES)
+ 
+diff -urp Box2D-2.3.1/Testbed/CMakeLists.txt Box2D-2.3.1.fix/Testbed/CMakeLists.txt
+--- Box2D-2.3.1/Testbed/CMakeLists.txt	2015-02-20 14:14:39.000000000 +0100
++++ Box2D-2.3.1.fix/Testbed/CMakeLists.txt	2015-02-20 14:32:42.322404515 +0100
+@@ -1,13 +1,17 @@
+ # Some flags for Freeglut and GLUI.
+-add_definitions( -DFREEGLUT_EXPORTS -DFREEGLUT_STATIC -D_CRT_SECURE_NO_WARNINGS )
++add_definitions( -D_CRT_SECURE_NO_WARNINGS )
+ 
+ # Define the framework files.
+ set(Testbed_Framework_SRCS
+ 	Framework/Main.cpp
+-	Framework/Render.cpp
+-	Framework/Render.h
++	Framework/RenderGL3.cpp
++	Framework/RenderGL3.h
+ 	Framework/Test.cpp
+ 	Framework/Test.h
++	Framework/DebugDraw.cpp
++	Framework/DebugDraw.h
++	Framework/imgui.cpp
++	Framework/imgui.h
+ )
+ 
+ #define the test files.
+@@ -72,7 +76,7 @@ if(APPLE)
+ 	# We are not using the Apple's framework version, but X11's
+ 	include_directories( /usr/X11/include )
+ 	link_directories( /usr/X11/lib )
+-	set (OPENGL_LIBRARIES GL GLU GLUT X11)
++	set (OPENGL_LIBRARIES GL GLU X11)
+ elseif(WIN32)
+ 	set (ADDITIONAL_LIBRARIES winmm)
+ endif(APPLE)
+@@ -85,8 +89,8 @@ add_executable(Testbed
+ target_link_libraries (
+ 	Testbed
+ 	Box2D
+-	freeglut_static
+-	glui
++	glfw
++	GLEW
+ 	${ADDITIONAL_LIBRARIES}
+ 	${OPENGL_LIBRARIES}
+ ) 
+diff --git a/Testbed/Framework/Test.h b/Testbed/Framework/Test.h
+index 7e621d4..bb4cb13 100644
+--- a/Testbed/Framework/Test.h
++++ b/Testbed/Framework/Test.h
+@@ -25,7 +25,7 @@
+ #if defined(__APPLE__)
+ #include <OpenGL/gl3.h>
+ #else
+-#include <glew/glew.h>
++#include <GL/glew.h>
+ #endif
+ #include <glfw/glfw3.h>
+ 
+diff --git a/Testbed/Framework/DebugDraw.cpp b/Testbed/Framework/DebugDraw.cpp
+index 8299611..2a7da6b 100644
+--- a/Testbed/Framework/DebugDraw.cpp
++++ b/Testbed/Framework/DebugDraw.cpp
+@@ -21,10 +21,10 @@
+ #if defined(__APPLE_CC__)
+ #include <OpenGL/gl3.h>
+ #else
+-#include <glew/glew.h>
++#include <GL/glew.h>
+ #endif
+ 
+-#include <glfw/glfw3.h>
++#include <GLFW/glfw3.h>
+ #include <stdio.h>
+ #include <stdarg.h>
+ 
+diff --git a/Testbed/Framework/Main.cpp b/Testbed/Framework/Main.cpp
+index b494da9..79e2c05 100644
+--- a/Testbed/Framework/Main.cpp
++++ b/Testbed/Framework/Main.cpp
+@@ -24,10 +24,10 @@
+ #if defined(__APPLE__)
+ #include <OpenGL/gl3.h>
+ #else
+-#include <glew/glew.h>
++#include <GL/glew.h>
+ #endif
+ 
+-#include <glfw/glfw3.h>
++#include <GLFW/glfw3.h>
+ #include <stdio.h>
+ 
+ #ifdef _MSC_VER
+diff --git a/Testbed/Framework/RenderGL3.cpp b/Testbed/Framework/RenderGL3.cpp
+index 4613541..115cb93 100644
+--- a/Testbed/Framework/RenderGL3.cpp
++++ b/Testbed/Framework/RenderGL3.cpp
+@@ -25,7 +25,7 @@
+ #ifdef __APPLE__
+ #include <OpenGL/gl3.h>
+ #else
+-#include <glew/glew.h>
++#include <GL/glew.h>
+ #include <GL/gl.h>
+ #endif
+ 
+diff --git a/Testbed/Framework/Test.h b/Testbed/Framework/Test.h
+index bb4cb13..f6c69f3 100644
+--- a/Testbed/Framework/Test.h
++++ b/Testbed/Framework/Test.h
+@@ -27,7 +27,7 @@
+ #else
+ #include <GL/glew.h>
+ #endif
+-#include <glfw/glfw3.h>
++#include <GLFW/glfw3.h>
+ 
+ #include <stdlib.h>
+ 
diff --git a/Box2D.spec b/Box2D.spec
index 5c4e0cc..895d9c0 100644
--- a/Box2D.spec
+++ b/Box2D.spec
@@ -1,17 +1,19 @@
 Name: Box2D
-Version:  2.2.1
-Release:  7%{?dist}
+Version:  2.3.1
+Release:  1%{?dist}
 Summary: A 2D Physics Engine for Games
 
 Group: Development/Libraries
 License: zlib
 URL: http://box2d.org/
-#http://code.google.com/p/box2d/downloads
-#Not using URL since I can't find one code.google.com will produce.
-Source0: Box2D_v2.2.1.zip
-Patch0: Box2D-2.2.1-unbundle-freeglut.patch
-Patch1: Box2D-2.2.1-unbundle-glui.patch
-BuildRequires: cmake freeglut-devel libXi-devel glui-devel
+# "Google Code no longer allows for downloads, therefore you will have to use SVN to get v2.3.1"
+# <http://box2d.org/2014/04/box2d-v2-3-1-released/>
+# svn checkout http://box2d.googlecode.com/svn/tags/v2.3.1/Box2D Box2D-2.3.1
+# (^^^ beware only legacy IP works, IPv6 seems broken)
+# tar --exclude .svn -czf Box2D-2.3.1.tar.gz Box2D-2.3.1
+Source0: %{name}-%{version}.tar.gz
+Patch0: Box2D-2.3.1-cmake.patch
+BuildRequires: cmake libXi-devel glew-devel glfw-devel
 
 %package devel
 Summary: Development files for %{name}
@@ -33,26 +35,20 @@ we encourage you to give credit to Box2D in your product.
 These are the development files.
 
 %prep
-%setup -qn Box2D_v2.2.1
-%patch0 -p0 -b .freeglut
-%patch1 -p0 -b .glui
-rm -rf freeglut
-rm -rf glui
+%setup -q
+%patch0 -p1
+rm -rf glew glfw
 
 %build
 sed -i 's/\r//' License.txt
 sed -i 's/\r//' Readme.txt
 pushd Box2D
-%cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_EXE_LINKER_FLAGS="-lglut -lglui -lGLU" ..
+%cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON ..
 make
 
 %install
 pushd Box2D
 make install DESTDIR=%{buildroot}
-#ugly hack
-%if %{__isa_bits} == 64
-  mv %{buildroot}/usr/lib %{buildroot}/usr/lib64
-%endif
 
 find %{buildroot} -name '*.cmake' | xargs rm
 find %{buildroot} -name '*.a' | xargs rm
@@ -75,6 +71,9 @@ find %{buildroot} -name '*.a' | xargs rm
 
 
 %changelog
+* Fri Feb 20 2015 Lubomir Rintel <lkundrak at v3.sk> - 2.3.1-1
+- Update
+
 * Fri Aug 15 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.2.1-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 
diff --git a/sources b/sources
index 907f09c..2493703 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-9e9d32a34fb5554c47f0f9cade0fa611  Box2D_v2.2.1.zip
+ab0674782d4ef754ea2578a704dc2945  Box2D-2.3.1.tar.gz


More information about the scm-commits mailing list