Commit 8a10d5b0 authored by Andreas Tille's avatar Andreas Tille

Refresh patches

parent 5f091eca
......@@ -6,12 +6,10 @@ Subject: Workaround bug in googletest, fixing bug #812284
test/CMakeLists.txt | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 61f1f7f..2083d5e 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -13,6 +13,19 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR
set(yaml_test_flags "-Wno-c99-extensions -Wno-variadic-macros -Wno-sign-compare")
@@ -23,6 +23,19 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" O
endif()
endif()
+# In some cases gTest segfaults with GCC >= 6.0.0. This is a dirty fix.
......
......@@ -4,52 +4,10 @@ Bug-Debian: https://bugs.debian.org/835417
Origin: upstream, https://github.com/jbeder/yaml-cpp/commit/b426fafff
Last-Update: 2016-10-11
--- a/include/yaml-cpp/node/impl.h
+++ b/include/yaml-cpp/node/impl.h
@@ -142,7 +142,7 @@
template <typename T, typename S>
inline const T Node::as(const S& fallback) const {
if (!m_isValid)
- throw InvalidNode();
+ return fallback;
return as_if<T, S>(*this)(fallback);
}
@@ -275,26 +275,26 @@
inline const_iterator Node::begin() const {
if (!m_isValid)
- throw InvalidNode();
+ return const_iterator();
return m_pNode ? const_iterator(m_pNode->begin(), m_pMemory)
: const_iterator();
}
inline iterator Node::begin() {
if (!m_isValid)
- throw InvalidNode();
+ return iterator();
return m_pNode ? iterator(m_pNode->begin(), m_pMemory) : iterator();
}
inline const_iterator Node::end() const {
if (!m_isValid)
- throw InvalidNode();
+ return const_iterator();
return m_pNode ? const_iterator(m_pNode->end(), m_pMemory) : const_iterator();
}
inline iterator Node::end() {
if (!m_isValid)
- throw InvalidNode();
+ return iterator();
return m_pNode ? iterator(m_pNode->end(), m_pMemory) : iterator();
}
--- a/test/node/node_test.cpp
+++ b/test/node/node_test.cpp
@@ -73,6 +73,12 @@
EXPECT_EQ(2, node.size());
@@ -131,6 +131,12 @@ TEST(NodeTest, UndefinedConstNodeWithFal
EXPECT_EQ(cn["undefined"].as<int>(3), 3);
}
+TEST(NodeTest, UndefinedConstNodeWithFallback) {
......@@ -61,10 +19,12 @@ Last-Update: 2016-10-11
TEST(NodeTest, MapIteratorWithUndefinedValues) {
Node node;
node["key"] = "value";
@@ -84,6 +90,32 @@
EXPECT_EQ(1, count);
}
@@ -167,6 +173,32 @@ TEST(NodeTest, IteratorOnConstUndefinedN
count++;
}
EXPECT_EQ(0, count);
+}
+
+TEST(NodeTest, ConstIteratorOnConstUndefinedNode) {
+ Node node;
+ const Node& cn = node;
......@@ -89,8 +49,6 @@ Last-Update: 2016-10-11
+ count++;
+ }
+ EXPECT_EQ(0, count);
+}
+
}
TEST(NodeTest, SimpleSubkeys) {
Node node;
node["device"]["udid"] = "12345";
......@@ -10,18 +10,11 @@ Last-Update: 2015-11-29
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -251,18 +251,21 @@
if(WIN32)
set(_library_dir bin) # .dll are in PATH, like executables
else()
- set(_library_dir lib)
+ set(_library_dir ${CMAKE_INSTALL_PREFIX}/lib)
endif()
@@ -262,7 +262,10 @@ endif()
set(INCLUDE_INSTALL_ROOT_DIR include)
set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_ROOT_DIR}/yaml-cpp)
-set(LIB_INSTALL_DIR "${_library_dir}${LIB_SUFFIX}")
-set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}")
+SET(LIB_INSTALL_DIR "${_library_dir}${LIB_SUFFIX}" CACHE
+ "Directory relative to CMAKE_INSTALL_PREFIX in which to install libraries"
+ STRING)
......@@ -29,41 +22,3 @@ Last-Update: 2015-11-29
set(_INSTALL_DESTINATIONS
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
)
@@ -298,7 +301,7 @@
endif()
endif()
-install(TARGETS yaml-cpp ${_INSTALL_DESTINATIONS})
+install(TARGETS yaml-cpp EXPORT yaml-cpp-targets ${_INSTALL_DESTINATIONS})
install(
DIRECTORY ${header_directory}
DESTINATION ${INCLUDE_INSTALL_DIR}
@@ -314,9 +317,22 @@
set(CONFIG_INCLUDE_DIRS "${YAML_CPP_SOURCE_DIR}/include")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in
"${PROJECT_BINARY_DIR}/yaml-cpp-config.cmake" @ONLY)
+
+set(INSTALL_CMAKE_DIR ${LIB_INSTALL_DIR}/cmake/yaml-cpp)
+file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${CMAKE_INSTALL_PREFIX}/include")
+set(CONFIG_INCLUDE_DIRS "\${YAML_CPP_CMAKE_DIR}/${REL_INCLUDE_DIR}")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config.cmake.in
+ "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake" @ONLY)
+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp-config-version.cmake.in
"${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" @ONLY)
+install(FILES
+ "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/yaml-cpp-config.cmake"
+ "${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
+install(EXPORT yaml-cpp-targets DESTINATION ${INSTALL_CMAKE_DIR})
+
if(UNIX)
set(PC_FILE ${CMAKE_BINARY_DIR}/yaml-cpp.pc)
configure_file("yaml-cpp.pc.cmake" ${PC_FILE} @ONLY)
Author: Lifeng Sun <lifongsun@gmail.com>
Last-Update: Fri, 30 Aug 2013 18:29:05 +0800
Description: remove multiarch path in yaml-cpp.pc
--- a/yaml-cpp.pc.cmake
+++ b/yaml-cpp.pc.cmake
@@ -1,11 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@LIB_INSTALL_DIR@
includedir=${prefix}/@INCLUDE_INSTALL_ROOT_DIR@
Name: Yaml-cpp
Description: A YAML parser and emitter for C++
Version: @YAML_CPP_VERSION@
Requires:
-Libs: -L${libdir} -lyaml-cpp
+Libs: -lyaml-cpp
Cflags: -I${includedir}
......@@ -5,7 +5,7 @@ Last-Update: 2016-10-11
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -100,6 +100,7 @@
@@ -106,6 +106,7 @@ set(library_sources
${contrib_private_headers}
)
add_sources(${library_sources})
......
pkgconfig.patch
install-cmake-dev-files.patch
reproducible-build.patch
0003-Workaround-bug-in-googletest-fixing-bug-812284.patch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment