Skip to content

Commit 0e50451

Browse files
committed
add box2d flatbuffers and webp
1 parent 3ca7a12 commit 0e50451

File tree

8 files changed

+496
-0
lines changed

8 files changed

+496
-0
lines changed

contrib/src/box2d/SHA512SUMS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dc63efa816a846b1e0413a49ffa67f8f88726a81f28b4cfadda50244763b5389ae96d379e4afef2d0ee87a2ffd132a5a344107b6eb0e11081e235d1c9e5ddad0 Box2D_v2.3.0.7z

contrib/src/box2d/rules.mak

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# box2d
2+
3+
BOX2D_VERSION := 2.3.0
4+
BOX2D_URL := https://github.com/andyque/Box2D.git
5+
6+
$(TARBALLS)/libbox2d-git.tar.xz:
7+
$(call download_git,$(BOX2D_URL),master)
8+
9+
.sum-box2d: libbox2d-git.tar.xz
10+
$(warning $@ not implemented)
11+
touch $@
12+
13+
box2d: libbox2d-git.tar.xz .sum-box2d
14+
$(UNPACK)
15+
$(MOVE)
16+
17+
18+
.box2d: box2d toolchain.cmake
19+
cd $</Box2D && $(HOSTVARS_PIC) $(CMAKE) . -DBOX2D_BUILD_EXAMPLES=0
20+
cd $</Box2D && $(MAKE) VERBOSE=1 install
21+
touch $@
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index a6f21cb..9ad952c 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -55,10 +55,10 @@ set(FlatBuffers_Sample_Text_SRCS
6+
7+
if(APPLE)
8+
set(CMAKE_CXX_FLAGS
9+
- "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall -pedantic -Werror -Wextra")
10+
+ "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall -pedantic -Wextra")
11+
elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
12+
set(CMAKE_CXX_FLAGS
13+
- "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra")
14+
+ "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Wextra")
15+
endif()
16+
17+
if(FLATBUFFERS_CODE_COVERAGE)
18+
@@ -69,7 +69,7 @@ endif()
19+
20+
include_directories(include)
21+
22+
-add_executable(flatc ${FlatBuffers_Compiler_SRCS})
23+
+add_library(flatbuffer STATIC ${FlatBuffers_Compiler_SRCS})
24+
25+
function(compile_flatbuffers_schema_to_cpp SRC_FBS)
26+
get_filename_component(SRC_FBS_DIR ${SRC_FBS} DIRECTORY)
27+
@@ -93,7 +93,7 @@ endif()
28+
29+
if(FLATBUFFERS_INSTALL)
30+
install(DIRECTORY include/flatbuffers DESTINATION include)
31+
- install(TARGETS flatc DESTINATION bin)
32+
+ install(TARGETS flatbuffer DESTINATION lib)
33+
endif()
34+
35+
if(FLATBUFFERS_BUILD_TESTS)

contrib/src/flatbuffers/rules.mak

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# flatbuffers
2+
3+
FLATBUFFERS_GITURL := https://github.com/google/flatbuffers.git
4+
5+
$(TARBALLS)/flatbuffers-git.tar.xz:
6+
$(call download_git,$(FLATBUFFERS_GITURL),master,1e4d28b)
7+
8+
9+
.sum-flatbuffers: flatbuffers-git.tar.xz
10+
$(warning $@ not implemented)
11+
touch $@
12+
13+
flatbuffers: flatbuffers-git.tar.xz .sum-flatbuffers
14+
$(UNPACK)
15+
$(APPLY) $(SRC)/flatbuffers/add-library.patch
16+
$(MOVE)
17+
18+
.flatbuffers: flatbuffers toolchain.cmake
19+
cd $< && $(HOSTVARS) ${CMAKE} -DFLATBUFFERS_BUILD_TESTS=OFF
20+
cd $< && $(MAKE) VERBOSE=1 install
21+
touch $@
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
From c162a3620a3d0d317f59af8ddc2d1605bf5ee4b3 Mon Sep 17 00:00:00 2001
2+
From: martell <[email protected]>
3+
Date: Sat, 11 Oct 2014 03:32:38 +0100
4+
Subject: [PATCH 1/3] unzip: add function unzOpenBuffer
5+
6+
---
7+
Makefile.am | 1 +
8+
unzip.c | 11 +++++++++++
9+
unzip.h | 2 ++
10+
3 files changed, 14 insertions(+)
11+
12+
diff --git a/Makefile.am b/Makefile.am
13+
index d83fee7..e2958e6 100644
14+
--- a/Makefile.am
15+
+++ b/Makefile.am
16+
@@ -19,6 +19,7 @@ libminizip_la_SOURCES = \
17+
ioapi.c \
18+
unzip.c \
19+
zip.c \
20+
+ ioapi_mem.c \
21+
${iowin32_src}
22+
23+
libminizip_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:0:0 -lz
24+
diff --git a/unzip.c b/unzip.c
25+
index ce02265..bb72a66 100644
26+
--- a/unzip.c
27+
+++ b/unzip.c
28+
@@ -26,6 +26,7 @@
29+
30+
#include "zlib.h"
31+
#include "unzip.h"
32+
+#include "ioapi_mem.h"
33+
34+
#ifdef STDC
35+
# include <stddef.h>
36+
@@ -581,6 +582,16 @@ extern unzFile ZEXPORT unzOpen64(const void *path)
37+
return unzOpenInternal(path, NULL, 1);
38+
}
39+
40+
+extern unzFile ZEXPORT unzOpenBuffer(const void* buffer, uLong size)
41+
+{
42+
+ char path[48] = {0};
43+
+ ourmemory_t FileMemory;
44+
+ zlib_filefunc64_32_def memory_file;
45+
+ sprintf(path, "%llx %lx", (unsigned long long)buffer, (unsigned long)size);
46+
+ fill_memory_filefunc(&memory_file, &FileMemory);
47+
+ return unzOpenInternal(path, &memory_file, 0);
48+
+}
49+
+
50+
extern int ZEXPORT unzClose(unzFile file)
51+
{
52+
unz64_s* s;
53+
diff --git a/unzip.h b/unzip.h
54+
index 22c830f..28fedb9 100644
55+
--- a/unzip.h
56+
+++ b/unzip.h
57+
@@ -143,6 +143,8 @@ extern unzFile ZEXPORT unzOpen64 OF((const void *path));
58+
open64_file_func callback. Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
59+
is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* does not describe the reality */
60+
61+
+extern unzFile ZEXPORT unzOpenBuffer OF((const void* buffer, uLong size));
62+
+/* Open a Zip file, like unzOpen, but from a buffer */
63+
extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def* pzlib_filefunc_def));
64+
/* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write operations */
65+
extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def* pzlib_filefunc_def));
66+
--
67+
2.1.2
68+

contrib/src/tinyxml2/android.patch

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 91c61a4..9a717e7 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -10,8 +10,8 @@ include(GNUInstallDirs)
6+
################################
7+
# set lib version here
8+
9+
-set(GENERIC_LIB_VERSION "2.2.0")
10+
-set(GENERIC_LIB_SOVERSION "2")
11+
+set(GENERIC_LIB_VERSION "2.2.0")
12+
+set(GENERIC_LIB_SOVERSION "2")
13+
14+
15+
################################
16+
@@ -51,17 +51,16 @@ if(BUILD_STATIC_LIBS)
17+
add_library(tinyxml2static STATIC tinyxml2.cpp tinyxml2.h)
18+
set_target_properties(tinyxml2static PROPERTIES OUTPUT_NAME tinyxml2)
19+
endif(BUILD_STATIC_LIBS)
20+
-add_library(tinyxml2 SHARED tinyxml2.cpp tinyxml2.h)
21+
+
22+
+################################
23+
+# Add targets
24+
+option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
25+
+add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
26+
set_target_properties(tinyxml2 PROPERTIES
27+
COMPILE_DEFINITIONS "TINYXML2_EXPORT"
28+
VERSION "${GENERIC_LIB_VERSION}"
29+
SOVERSION "${GENERIC_LIB_SOVERSION}")
30+
31+
-add_executable(test xmltest.cpp)
32+
-add_dependencies(test tinyxml2)
33+
-add_dependencies(test ${TARGET_DATA_COPY})
34+
-target_link_libraries(test tinyxml2)
35+
-
36+
37+
if(BUILD_STATIC_LIBS)
38+
install(TARGETS tinyxml2 tinyxml2static

0 commit comments

Comments
 (0)