summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Huber <johu@gentoo.org>2020-01-07 22:40:11 +0100
committerJohannes Huber <johu@gentoo.org>2020-01-07 22:41:23 +0100
commit4f0b8303610a5eeefa5e4aa1127a27c1993372df (patch)
treeb1f7f3da1953af02355cc35e2776cae03b0017e7 /dev-cpp/yaml-cpp
parentnet-wireless/srslte: filter -Werror (diff)
downloadgentoo-4f0b8303610a5eeefa5e4aa1127a27c1993372df.tar.gz
gentoo-4f0b8303610a5eeefa5e4aa1127a27c1993372df.tar.bz2
gentoo-4f0b8303610a5eeefa5e4aa1127a27c1993372df.zip
dev-cpp/yaml-cpp: fix ABI breakage
Adds a patch used in fedora to fix ABI breakage. Patch and issue spotted by Attila Tóth <atoth@atoth.sote.hu>. Bug: https://bugs.gentoo.org/704948 Thanks-to: Attila Tóth <atoth@atoth.sote.hu> Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Johannes Huber <johu@gentoo.org>
Diffstat (limited to 'dev-cpp/yaml-cpp')
-rw-r--r--dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch57
-rw-r--r--dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild45
2 files changed, 102 insertions, 0 deletions
diff --git a/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch
new file mode 100644
index 000000000000..d9160856c47f
--- /dev/null
+++ b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch
@@ -0,0 +1,57 @@
+commit f5f288c7622d3547c29a8355b8ccda0155483b79
+Author: Till Hofmann <hofmann@kbsg.rwth-aachen.de>
+Date: Sun Nov 17 22:43:20 2019 +0100
+
+ Revert "fix up static, so works as DLL (#559)"
+
+ This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e.
+
+diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h
+index 82fb79a..50bcd74 100644
+--- a/include/yaml-cpp/node/detail/node_data.h
++++ b/include/yaml-cpp/node/detail/node_data.h
+@@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
+ shared_memory_holder pMemory);
+
+ public:
+- static const std::string& empty_scalar();
++ static std::string empty_scalar;
+
+ private:
+ void compute_seq_size() const;
+diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h
+index 7a3deac..b363f86 100644
+--- a/include/yaml-cpp/node/impl.h
++++ b/include/yaml-cpp/node/impl.h
+@@ -166,13 +166,13 @@ inline T Node::as(const S& fallback) const {
+ inline const std::string& Node::Scalar() const {
+ if (!m_isValid)
+ throw InvalidNode(m_invalidKey);
+- return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar();
++ return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
+ }
+
+ inline const std::string& Node::Tag() const {
+ if (!m_isValid)
+ throw InvalidNode(m_invalidKey);
+- return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar();
++ return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
+ }
+
+ inline void Node::SetTag(const std::string& tag) {
+diff --git a/src/node_data.cpp b/src/node_data.cpp
+index 6cfedfc..eba1ae4 100644
+--- a/src/node_data.cpp
++++ b/src/node_data.cpp
+@@ -13,10 +13,7 @@
+ namespace YAML {
+ namespace detail {
+
+-const std::string& node_data::empty_scalar() {
+- static const std::string svalue;
+- return svalue;
+-}
++std::string node_data::empty_scalar;
+
+ node_data::node_data()
+ : m_isDefined(false),
diff --git a/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild
new file mode 100644
index 000000000000..8a579eada7c4
--- /dev/null
+++ b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS="cmake"
+inherit cmake-multilib
+
+DESCRIPTION="YAML parser and emitter in C++"
+HOMEPAGE="https://github.com/jbeder/yaml-cpp"
+SRC_URI="https://github.com/jbeder/${PN}/archive/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0/0.6"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+
+# test breaks build
+# RESTRICT="!test? ( test )"
+RESTRICT+="test"
+
+DEPEND="test? ( dev-cpp/gtest )"
+
+S="${WORKDIR}/${PN}-${P}"
+
+PATCHES=( "${FILESDIR}/${P}-abi-breakage.patch" )
+
+src_prepare() {
+ sed -i \
+ -e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
+ yaml-cpp.pc.cmake || die
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+ -DYAML_BUILD_SHARED_LIBS=ON
+ -DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
+ -DYAML_CPP_BUILD_TESTS=$(usex test)
+ )
+
+ cmake-multilib_src_configure
+}