-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* libucl: add version 0.9.0 * link math lib * remove glib types
- Loading branch information
Showing
5 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
recipes/libucl/all/patches/0002-0.9.0-cmake-add-install+use-find_package.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 1e23994..c67a5b8 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -5,12 +5,15 @@ SET(LIBUCL_VERSION_MAJOR 0) | ||
SET(LIBUCL_VERSION_MINOR 9) | ||
SET(LIBUCL_VERSION_PATCH 0) | ||
|
||
-SET(LIBUCL_VERSION | ||
- "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") | ||
+SET(LIBUCL_VERSION "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") | ||
|
||
INCLUDE(CheckCCompilerFlag) | ||
INCLUDE(CheckCSourceCompiles) | ||
-INCLUDE(FindOpenSSL) | ||
+IF(ENABLE_URL_SIGN) | ||
+ FIND_PACKAGE(OpenSSL REQUIRED) | ||
+ SET(HAVE_OPENSSL 1) | ||
+ ADD_DEFINITIONS(-DHAVE_OPENSSL) | ||
+ENDIF(ENABLE_URL_SIGN) | ||
INCLUDE(GNUInstallDirs) | ||
|
||
OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) | ||
@@ -135,30 +138,10 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
|
||
IF(ENABLE_URL_INCLUDE MATCHES "ON") | ||
- FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib | ||
- PATHS | ||
- ~/Library/Frameworks | ||
- /Library/Frameworks | ||
- /usr/local | ||
- /usr | ||
- /sw | ||
- /opt/local | ||
- /opt/csw | ||
- /opt | ||
- DOC "Path where the libfetch library can be found") | ||
- IF(LIBFETCH_LIBRARY) | ||
- FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include | ||
- /opt/include | ||
- /usr/local/include | ||
- DOC "Path to libfetch header") | ||
- ELSE(LIBFETCH_LIBRARY) | ||
- # Try to find libcurl | ||
- FIND_PACKAGE(CURL) | ||
- IF(NOT CURL_FOUND) | ||
- MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") | ||
- ENDIF(NOT CURL_FOUND) | ||
- ENDIF(LIBFETCH_LIBRARY) | ||
-ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") | ||
+ FIND_PACKAGE(CURL REQUIRED) | ||
+ ADD_DEFINITIONS(-DCURL_FOUND) | ||
+ SET(CURL_LIBRARIES CURL::libcurl) | ||
+ENDIF() | ||
|
||
set(SYNC_BUILTINS_TEST_SOURCE [====[ | ||
int main() | ||
@@ -249,35 +232,24 @@ TARGET_COMPILE_DEFINITIONS(ucl | ||
${UCL_COMPILE_DEFS} | ||
) | ||
|
||
-IF(ENABLE_LUA MATCHES "ON") | ||
- IF(ENABLE_LUAJIT MATCHES "ON") | ||
- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") | ||
- IF(NOT LUA_FOUND) | ||
- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") | ||
- ELSE(NOT LUA_FOUND) | ||
- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") | ||
- ENDIF(NOT LUA_FOUND) | ||
- ELSE(ENABLE_LUAJIT MATCHES "ON") | ||
- FindLua(VERSION_MAJOR "5" VERSION_MINOR "2" ROOT "${LUA_ROOT}") | ||
- IF(NOT LUA_FOUND) | ||
- FindLua(VERSION_MAJOR "5" VERSION_MINOR "1" ROOT "${LUA_ROOT}") | ||
- ENDIF(NOT LUA_FOUND) | ||
- IF(NOT LUA_FOUND) | ||
- MESSAGE(FATAL_ERROR "Lua not found, lua support is required") | ||
- ELSE(NOT LUA_FOUND) | ||
- INCLUDE_DIRECTORIES("${LUA_INCLUDE_DIR}") | ||
- ENDIF(NOT LUA_FOUND) | ||
- ENDIF(ENABLE_LUAJIT MATCHES "ON") | ||
+IF(ENABLE_LUA OR ENABLE_LUAJIT) | ||
SET(UCL_LUA_SRC lua/lua_ucl.c) | ||
ADD_LIBRARY(lua-ucl ${LIB_TYPE} ${UCL_LUA_SRC}) | ||
ADD_LIBRARY(ucl::lua ALIAS lua-ucl) | ||
+ TARGET_LINK_LIBRARIES(lua-ucl ucl) | ||
IF(ENABLE_LUAJIT MATCHES "ON") | ||
- TARGET_LINK_LIBRARIES(lua-ucl "${LUAJIT_LIBRARY}") | ||
+ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) | ||
ELSE(ENABLE_LUAJIT MATCHES "ON") | ||
- TARGET_LINK_LIBRARIES(lua-ucl "${LUA_LIBRARY}") | ||
+ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) | ||
ENDIF(ENABLE_LUAJIT MATCHES "ON") | ||
- TARGET_LINK_LIBRARIES(lua-ucl ucl) | ||
TARGET_INCLUDE_DIRECTORIES(lua-ucl PUBLIC include PRIVATE src uthash) | ||
+ IF(ENABLE_LUA) | ||
+ FIND_PACKAGE(lua REQUIRED CONFIG) | ||
+ TARGET_LINK_LIBRARIES(lua-ucl lua::lua) | ||
+ ELSEIF(ENABLE_LUAJIT) | ||
+ FIND_PACKAGE(luajit REQUIRED CONFIG) | ||
+ TARGET_LINK_LIBRARIES(lua-ucl luajit::luajit) | ||
+ ENDIF() | ||
SET_TARGET_PROPERTIES(lua-ucl PROPERTIES | ||
VERSION ${LIBUCL_VERSION} | ||
SOVERSION ${LIBUCL_VERSION_MAJOR} | ||
@@ -306,8 +278,11 @@ ENDIF(UNIX) | ||
SET_TARGET_PROPERTIES(ucl PROPERTIES | ||
PUBLIC_HEADER "${UCLHDR}") | ||
|
||
-INSTALL(TARGETS ucl EXPORT uclConfig DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
- PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
+INSTALL(TARGETS ucl EXPORT uclConfig | ||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
IF(ENABLE_UTILS MATCHES "ON") | ||
ADD_SUBDIRECTORY(utils) |
32 changes: 32 additions & 0 deletions
32
recipes/libucl/all/patches/0006-0.9.0-remove-glib-types.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/lua/lua_ucl.c b/lua/lua_ucl.c | ||
index c2e39c4..d6be69e 100644 | ||
--- a/lua/lua_ucl.c | ||
+++ b/lua/lua_ucl.c | ||
@@ -406,7 +406,6 @@ ucl_object_lua_fromtable (lua_State *L, int idx, ucl_string_flags_t flags) | ||
|
||
/* Table iterate */ | ||
if (is_array) { | ||
- int i; | ||
|
||
if (!is_implicit) { | ||
top = ucl_object_typed_new (UCL_ARRAY); | ||
@@ -416,7 +415,7 @@ ucl_object_lua_fromtable (lua_State *L, int idx, ucl_string_flags_t flags) | ||
top = NULL; | ||
} | ||
|
||
- for (i = 1; i <= max; i ++) { | ||
+ for (size_t i = 1; i <= max; i ++) { | ||
lua_pushinteger (L, i); | ||
lua_gettable (L, idx); | ||
|
||
@@ -886,8 +885,8 @@ lua_ucl_parser_parse_text (lua_State *L) | ||
t = lua_touserdata (L, 2); | ||
} | ||
else if (lua_type (L, 2) == LUA_TSTRING) { | ||
- const gchar *s; | ||
- gsize len; | ||
+ const char *s; | ||
+ size_t len; | ||
static struct _rspamd_lua_text st_t; | ||
|
||
s = lua_tolstring (L, 2, &len); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
versions: | ||
"0.9.0": | ||
folder: all | ||
"0.8.2": | ||
folder: all | ||
"0.8.1": | ||
|