Gentoo Archives: gentoo-commits

From: Johannes Huber <johu@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/yaml-cpp/, dev-cpp/yaml-cpp/files/
Date: Tue, 07 Jan 2020 21:41:40
Message-Id: 1578433283.4f0b8303610a5eeefa5e4aa1127a27c1993372df.johu@gentoo
1 commit: 4f0b8303610a5eeefa5e4aa1127a27c1993372df
2 Author: Johannes Huber <johu <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 7 21:40:11 2020 +0000
4 Commit: Johannes Huber <johu <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 7 21:41:23 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f0b8303
7
8 dev-cpp/yaml-cpp: fix ABI breakage
9
10 Adds a patch used in fedora to fix ABI breakage. Patch and issue spotted
11 by Attila Tóth <atoth <AT> atoth.sote.hu>.
12
13 Bug: https://bugs.gentoo.org/704948
14 Thanks-to: Attila Tóth <atoth <AT> atoth.sote.hu>
15 Package-Manager: Portage-2.3.84, Repoman-2.3.20
16 Signed-off-by: Johannes Huber <johu <AT> gentoo.org>
17
18 .../files/yaml-cpp-0.6.3-abi-breakage.patch | 57 ++++++++++++++++++++++
19 dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild | 45 +++++++++++++++++
20 2 files changed, 102 insertions(+)
21
22 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
23 new file mode 100644
24 index 00000000000..d9160856c47
25 --- /dev/null
26 +++ b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-abi-breakage.patch
27 @@ -0,0 +1,57 @@
28 +commit f5f288c7622d3547c29a8355b8ccda0155483b79
29 +Author: Till Hofmann <hofmann@××××××××××××××××.de>
30 +Date: Sun Nov 17 22:43:20 2019 +0100
31 +
32 + Revert "fix up static, so works as DLL (#559)"
33 +
34 + This reverts commit 774f25800e6f19f4b927023c85d1389af322da5e.
35 +
36 +diff --git a/include/yaml-cpp/node/detail/node_data.h b/include/yaml-cpp/node/detail/node_data.h
37 +index 82fb79a..50bcd74 100644
38 +--- a/include/yaml-cpp/node/detail/node_data.h
39 ++++ b/include/yaml-cpp/node/detail/node_data.h
40 +@@ -81,7 +81,7 @@ class YAML_CPP_API node_data {
41 + shared_memory_holder pMemory);
42 +
43 + public:
44 +- static const std::string& empty_scalar();
45 ++ static std::string empty_scalar;
46 +
47 + private:
48 + void compute_seq_size() const;
49 +diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h
50 +index 7a3deac..b363f86 100644
51 +--- a/include/yaml-cpp/node/impl.h
52 ++++ b/include/yaml-cpp/node/impl.h
53 +@@ -166,13 +166,13 @@ inline T Node::as(const S& fallback) const {
54 + inline const std::string& Node::Scalar() const {
55 + if (!m_isValid)
56 + throw InvalidNode(m_invalidKey);
57 +- return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar();
58 ++ return m_pNode ? m_pNode->scalar() : detail::node_data::empty_scalar;
59 + }
60 +
61 + inline const std::string& Node::Tag() const {
62 + if (!m_isValid)
63 + throw InvalidNode(m_invalidKey);
64 +- return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar();
65 ++ return m_pNode ? m_pNode->tag() : detail::node_data::empty_scalar;
66 + }
67 +
68 + inline void Node::SetTag(const std::string& tag) {
69 +diff --git a/src/node_data.cpp b/src/node_data.cpp
70 +index 6cfedfc..eba1ae4 100644
71 +--- a/src/node_data.cpp
72 ++++ b/src/node_data.cpp
73 +@@ -13,10 +13,7 @@
74 + namespace YAML {
75 + namespace detail {
76 +
77 +-const std::string& node_data::empty_scalar() {
78 +- static const std::string svalue;
79 +- return svalue;
80 +-}
81 ++std::string node_data::empty_scalar;
82 +
83 + node_data::node_data()
84 + : m_isDefined(false),
85
86 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
87 new file mode 100644
88 index 00000000000..8a579eada7c
89 --- /dev/null
90 +++ b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r1.ebuild
91 @@ -0,0 +1,45 @@
92 +# Copyright 1999-2020 Gentoo Authors
93 +# Distributed under the terms of the GNU General Public License v2
94 +
95 +EAPI=7
96 +
97 +CMAKE_ECLASS="cmake"
98 +inherit cmake-multilib
99 +
100 +DESCRIPTION="YAML parser and emitter in C++"
101 +HOMEPAGE="https://github.com/jbeder/yaml-cpp"
102 +SRC_URI="https://github.com/jbeder/${PN}/archive/${P}.tar.gz"
103 +
104 +LICENSE="MIT"
105 +SLOT="0/0.6"
106 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
107 +IUSE="test"
108 +
109 +# test breaks build
110 +# RESTRICT="!test? ( test )"
111 +RESTRICT+="test"
112 +
113 +DEPEND="test? ( dev-cpp/gtest )"
114 +
115 +S="${WORKDIR}/${PN}-${P}"
116 +
117 +PATCHES=( "${FILESDIR}/${P}-abi-breakage.patch" )
118 +
119 +src_prepare() {
120 + sed -i \
121 + -e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
122 + yaml-cpp.pc.cmake || die
123 +
124 + cmake_src_prepare
125 +}
126 +
127 +src_configure() {
128 + local mycmakeargs=(
129 + -DBUILD_SHARED_LIBS=ON
130 + -DYAML_BUILD_SHARED_LIBS=ON
131 + -DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
132 + -DYAML_CPP_BUILD_TESTS=$(usex test)
133 + )
134 +
135 + cmake-multilib_src_configure
136 +}