diff --git a/CMakeExternals/raptor2-2.0.14.patch.txt b/CMakeExternals/raptor2-2.0.14.patch.txt new file mode 100644 index 0000000000..c592d44af1 --- /dev/null +++ b/CMakeExternals/raptor2-2.0.14.patch.txt @@ -0,0 +1,179 @@ +diff -ruN '--exclude=*~' raptor2-2.0.14/CMakeLists.txt raptor2-2.0.14-patched/CMakeLists.txt +--- raptor2-2.0.14/CMakeLists.txt 2014-01-30 05:07:24.000000000 +0100 ++++ raptor2-2.0.14-patched/CMakeLists.txt 2014-10-28 19:18:11.841191108 +0100 +@@ -30,12 +30,24 @@ + FIND_PACKAGE(LibXslt) + #FIND_PACKAGE(YAJL) + +-INCLUDE_DIRECTORIES( +- ${CURL_INCLUDE_DIRS} +- ${EXPAT_INCLUDE_DIRS} +- ${LIBXML2_INCLUDE_DIR} +- ${LIBXSLT_INCLUDE_DIR} +-) ++IF(CURL_FOUND) ++ INCLUDE_DIRECTORIES( ++ ${CURL_INCLUDE_DIRS} ++ ) ++ENDIF() ++ ++IF(LIBXML2_FOUND) ++ INCLUDE_DIRECTORIES( ++ ${EXPAT_INCLUDE_DIRS} ++ ${LIBXML2_INCLUDE_DIR} ++ ) ++ENDIF() ++ ++IF(LIBXSLT_FOUND) ++ INCLUDE_DIRECTORIES( ++ ${LIBXSLT_INCLUDE_DIR} ++ ) ++ENDIF() + + ################################################################ + +@@ -89,6 +101,15 @@ + CHECK_TYPE_SIZE("unsigned long" SIZEOF_UNSIGNED_LONG) + CHECK_TYPE_SIZE("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG) + ++CHECK_C_SOURCE_COMPILES(" ++int main() {char *function_name = __func__; return 0;}" ++ HAVE___FUNC__ ++) ++CHECK_C_SOURCE_COMPILES(" ++int main() {char *function_name = __FUNCTION__; return 0;}" ++ HAVE___FUNCTION__ ++) ++ + IF(LIBXML2_FOUND) + + SET(CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIR}) +@@ -152,6 +173,9 @@ + SET(BUILD_SHARED_LIBS OFF CACHE BOOL + "Build shared libraries instead of static ones.") + ++SET(RAPTOR_ENABLE_TESTING TRUE CACHE BOOL ++ "Enable unit tests") ++ + IF(BUILD_SHARED_LIBS) + SET(RAPTOR_STATIC FALSE) + ELSE(BUILD_SHARED_LIBS) +@@ -273,9 +297,9 @@ + # + # but we don't have a good way of knowing where the third-party DLLs are. + # +-IF(CMAKE_GENERATOR MATCHES "Makefiles") ++IF(RAPTOR_ENABLE_TESTING AND CMAKE_GENERATOR MATCHES "Makefiles") + ENABLE_TESTING() +-ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") ++ENDIF(RAPTOR_ENABLE_TESTING AND CMAKE_GENERATOR MATCHES "Makefiles") + + SUBDIRS(src) + SUBDIRS(utils) +@@ -335,21 +359,23 @@ + ENDIF(rapper_status EQUAL 0 OR rapper_status EQUAL 2) + + IF(NOT rdfdiff_status EQUAL 0) +- MESSAGE(FATAL_ERROR "Test failed.") ++ MESSAGE(FATAL_ERROR \"Test failed.\") + ENDIF(NOT rdfdiff_status EQUAL 0) + ") + + ADD_TEST(${NAME} ${CMAKE_COMMAND} -P test-${NAME}.cmake) + ENDMACRO(RAPPER_RDFDIFF_TEST NAME RAPPER_COMMAND RAPPER_OUTPUT RDFDIFF_COMMAND) + +-SUBDIRS(tests/feeds) +-SUBDIRS(tests/grddl) +-SUBDIRS(tests/json) +-SUBDIRS(tests/ntriples) +-SUBDIRS(tests/rdfa) +-SUBDIRS(tests/rdfa11) +-SUBDIRS(tests/rdfxml) +-SUBDIRS(tests/trig) +-#SUBDIRS(tests/turtle) # TODO ++IF(RAPTOR_ENABLE_TESTING) ++ SUBDIRS(tests/feeds) ++ SUBDIRS(tests/grddl) ++ SUBDIRS(tests/json) ++ SUBDIRS(tests/ntriples) ++ SUBDIRS(tests/rdfa) ++ SUBDIRS(tests/rdfa11) ++ SUBDIRS(tests/rdfxml) ++ SUBDIRS(tests/trig) ++ #SUBDIRS(tests/turtle) # TODO ++ENDIF(RAPTOR_ENABLE_TESTING) + + # end raptor/CMakeLists.txt +diff -ruN '--exclude=*~' raptor2-2.0.14/src/CMakeLists.txt raptor2-2.0.14-patched/src/CMakeLists.txt +--- raptor2-2.0.14/src/CMakeLists.txt 2013-02-26 01:09:21.000000000 +0100 ++++ raptor2-2.0.14-patched/src/CMakeLists.txt 2014-10-28 19:19:21.803185851 +0100 +@@ -118,6 +118,7 @@ + ADD_LIBRARY(raptor2 + raptor_avltree.c + raptor_concepts.c ++ raptor_escaped.c + raptor_general.c + raptor_iostream.c + raptor_json_writer.c +@@ -125,6 +126,7 @@ + raptor_log.c + raptor_memstr.c + raptor_namespace.c ++ raptor_ntriples.c + raptor_option.c + raptor_parse.c + raptor_qname.c +@@ -183,6 +185,8 @@ + COMPILE_DEFINITIONS "LIBRDFA_IN_RAPTOR;RAPTOR_INTERNAL;${LIBXML2_DEFINITIONS};${LIBXSLT_DEFINITIONS}" + ) + ++IF(RAPTOR_ENABLE_TESTING) ++ + ADD_EXECUTABLE(turtle_lexer_test turtle_lexer.c) + TARGET_LINK_LIBRARIES(turtle_lexer_test raptor2) + +@@ -291,6 +295,8 @@ + ) + ENDIF(RAPTOR_PARSER_RDFXML) + ++ENDIF(RAPTOR_ENABLE_TESTING) ++ + # Generate pkg-config metadata file + # + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc +diff -ruN '--exclude=*~' raptor2-2.0.14/src/raptor_config_cmake.h.in raptor2-2.0.14-patched/src/raptor_config_cmake.h.in +--- raptor2-2.0.14/src/raptor_config_cmake.h.in 2012-08-10 19:31:53.000000000 +0200 ++++ raptor2-2.0.14-patched/src/raptor_config_cmake.h.in 2014-10-28 18:59:01.342277564 +0100 +@@ -44,6 +44,9 @@ + #define SIZEOF_UNSIGNED_LONG @SIZEOF_UNSIGNED_LONG@ + #define SIZEOF_UNSIGNED_LONG_LONG @SIZEOF_UNSIGNED_LONG_LONG@ + ++#cmakedefine HAVE___FUNC__ ++#cmakedefine HAVE___FUNCTION__ ++ + #cmakedefine HAVE_XMLCTXTUSEOPTIONS + #cmakedefine HAVE_XMLSAX2INTERNALSUBSET + #cmakedefine RAPTOR_LIBXML_ENTITY_ETYPE +@@ -87,8 +90,9 @@ + # define _CRT_SECURE_NO_DEPRECATE + + # ifdef _MSC_VER +-# if _MSC_VER >= 1300 ++# if (_MSC_VER >= 1300) && !defined(__func__) + # define __func__ __FUNCTION__ ++# define HAVE___FUNC__ + # else + /* better than nothing */ + # define raptor_str(s) #s +@@ -126,6 +130,11 @@ + /* These prevent parsedate.c from declaring malloc() and free() */ + # define YYMALLOC malloc + # define YYFREE free ++ ++# if !defined(YY_NO_UNISTD_H) ++# define YY_NO_UNISTD_H ++# endif ++ + #endif + + /* end raptor_config.h */