Browse Source

initial import of the lua sandbox environment

Jaromil 2 years ago
commit
aec97cdb6f
5 changed files with 29 additions and 0 deletions
  1. 3 0
      .gitmodules
  2. 4 0
      Makefile
  3. 8 0
      build/apply-patches
  4. 13 0
      build/lua_sandbox_static.patch
  5. 1 0
      lib/lua_sandbox

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
1
+[submodule "lib/lua_sandbox"]
2
+	path = lib/lua_sandbox
3
+	url = https://github.com/mozilla-services/lua_sandbox

+ 4 - 0
Makefile

@@ -0,0 +1,4 @@
1
+all:
2
+	./build/apply-patches
3
+	cd lib/lua_sandbox && cmake .
4
+	make -C lib/lua_sandbox

+ 8 - 0
build/apply-patches

@@ -0,0 +1,8 @@
1
+#!/bin/sh
2
+
3
+# small script to apply patches to submodules
4
+
5
+# enable static build of lua_sandbox
6
+if ! grep STATIC lib/lua_sandbox/src/CMakeLists.txt > /dev/null; then
7
+	cd lib/lua_sandbox && patch -p1 < ../build/lua_sandbox_static.patch && cd -
8
+fi

+ 13 - 0
build/lua_sandbox_static.patch

@@ -0,0 +1,13 @@
1
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
2
+index beff13e..64a0f43 100644
3
+--- a/src/CMakeLists.txt
4
++++ b/src/CMakeLists.txt
5
+@@ -55,7 +55,7 @@ luasandbox_output.c
6
+ luasandbox_serialize.c
7
+ )
8
+ 
9
+-add_library(luasandbox SHARED ${LUA_SANDBOX_SRC} ${LUA_SRC})
10
++add_library(luasandbox STATIC ${LUA_SANDBOX_SRC} ${LUA_SRC})
11
+ set_target_properties(luasandbox PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 0)
12
+ target_link_libraries(luasandbox luasandboxutil ${CMAKE_DL_LIBS})
13
+ if(LIBM_LIBRARY)

+ 1 - 0
lib/lua_sandbox

@@ -0,0 +1 @@
1
+Subproject commit ab5e32758506b8278382a7705ff7e9fd50418379