Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/yaml-cpp/files/, dev-cpp/yaml-cpp/
Date: Thu, 17 Jun 2021 12:44:54
Message-Id: 1623933869.21325ae1b77011e74729382cedc4ab4e9ca63220.soap@gentoo
1 commit: 21325ae1b77011e74729382cedc4ab4e9ca63220
2 Author: Alexey Sokolov <sokolov <AT> google <DOT> com>
3 AuthorDate: Thu Jun 17 12:44:29 2021 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 17 12:44:29 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21325ae1
7
8 dev-cpp/yaml-cpp: enable tests, take package
9
10 Closes: https://github.com/gentoo/gentoo/pull/21230
11 Package-Manager: Portage-3.0.18, Repoman-3.0.2
12 Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
13 Signed-off-by: David Seifert <soap <AT> gentoo.org>
14
15 dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-gtest.patch | 44 ++++++++++++++++++++++
16 dev-cpp/yaml-cpp/metadata.xml | 9 ++++-
17 dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r4.ebuild | 46 +++++++++++++++++++++++
18 3 files changed, 98 insertions(+), 1 deletion(-)
19
20 diff --git a/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-gtest.patch b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-gtest.patch
21 new file mode 100644
22 index 00000000000..51f2a7b563f
23 --- /dev/null
24 +++ b/dev-cpp/yaml-cpp/files/yaml-cpp-0.6.3-gtest.patch
25 @@ -0,0 +1,44 @@
26 +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
27 +index 0a669d5..bc8bbdd 100644
28 +--- a/test/CMakeLists.txt
29 ++++ b/test/CMakeLists.txt
30 +@@ -7,22 +7,7 @@ if(MSVC)
31 + set(CMAKE_STATIC_LIBRARY_PREFIX "")
32 + endif()
33 +
34 +-ExternalProject_Add(
35 +- googletest_project
36 +- SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.8.0"
37 +- INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/prefix"
38 +- CMAKE_ARGS
39 +- -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
40 +- -DBUILD_GMOCK=ON
41 +- -Dgtest_force_shared_crt=ON
42 +-)
43 +-
44 +-add_library(gmock UNKNOWN IMPORTED)
45 +-set_target_properties(gmock PROPERTIES
46 +- IMPORTED_LOCATION
47 +- ${PROJECT_BINARY_DIR}/test/prefix/lib/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}
48 +-)
49 +-
50 ++find_package(GTest REQUIRED CONFIG)
51 + find_package(Threads)
52 +
53 + include_directories(SYSTEM "${PROJECT_BINARY_DIR}/test/prefix/include")
54 +@@ -56,14 +41,12 @@ set_target_properties(run-tests PROPERTIES
55 + CXX_STANDARD_REQUIRED ON
56 + )
57 +
58 +-add_dependencies(run-tests googletest_project)
59 +-
60 + set_target_properties(run-tests PROPERTIES
61 + COMPILE_FLAGS "${yaml_c_flags} ${yaml_cxx_flags} ${yaml_test_flags}"
62 + )
63 + target_link_libraries(run-tests
64 + yaml-cpp
65 +- gmock
66 ++ GTest::gmock
67 + ${CMAKE_THREAD_LIBS_INIT})
68 +
69 + add_test(yaml-test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/run-tests)
70
71 diff --git a/dev-cpp/yaml-cpp/metadata.xml b/dev-cpp/yaml-cpp/metadata.xml
72 index 60dee465819..66302b48567 100644
73 --- a/dev-cpp/yaml-cpp/metadata.xml
74 +++ b/dev-cpp/yaml-cpp/metadata.xml
75 @@ -1,7 +1,14 @@
76 <?xml version="1.0" encoding="UTF-8"?>
77 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
78 <pkgmetadata>
79 - <!-- maintainer-needed -->
80 + <maintainer type="person" proxied="yes">
81 + <email>alexey+gentoo@××××××××.org</email>
82 + <name>Alexey Sokolov</name>
83 + </maintainer>
84 + <maintainer type="project" proxied="proxy">
85 + <email>proxy-maint@g.o</email>
86 + <name>Proxy Maintainers</name>
87 + </maintainer>
88 <upstream>
89 <remote-id type="github">jbeder/yaml-cpp</remote-id>
90 </upstream>
91
92 diff --git a/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r4.ebuild b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r4.ebuild
93 new file mode 100644
94 index 00000000000..4992372c536
95 --- /dev/null
96 +++ b/dev-cpp/yaml-cpp/yaml-cpp-0.6.3-r4.ebuild
97 @@ -0,0 +1,46 @@
98 +# Copyright 1999-2021 Gentoo Authors
99 +# Distributed under the terms of the GNU General Public License v2
100 +
101 +EAPI=7
102 +
103 +CMAKE_ECLASS="cmake"
104 +inherit cmake-multilib
105 +
106 +DESCRIPTION="YAML parser and emitter in C++"
107 +HOMEPAGE="https://github.com/jbeder/yaml-cpp"
108 +SRC_URI="https://github.com/jbeder/yaml-cpp/archive/${P}.tar.gz"
109 +S="${WORKDIR}/yaml-cpp-${P}"
110 +
111 +LICENSE="MIT"
112 +SLOT="0/0.6"
113 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
114 +IUSE="test"
115 +RESTRICT="!test? ( test )"
116 +
117 +DEPEND="test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )"
118 +
119 +PATCHES=(
120 + "${FILESDIR}/${P}-abi-breakage.patch"
121 + "${FILESDIR}/${P}-CVE-2017-11692.patch"
122 + "${FILESDIR}/${P}-fix-overflows.patch"
123 + "${FILESDIR}/${P}-gtest.patch"
124 +)
125 +
126 +src_prepare() {
127 + sed -i \
128 + -e 's:INCLUDE_INSTALL_ROOT_DIR:INCLUDE_INSTALL_DIR:g' \
129 + yaml-cpp.pc.cmake || die
130 + rm -r test/gtest-* || die
131 +
132 + cmake_src_prepare
133 +}
134 +
135 +src_configure() {
136 + local mycmakeargs=(
137 + -DYAML_BUILD_SHARED_LIBS=ON
138 + -DYAML_CPP_BUILD_TOOLS=OFF # Don't have install rule
139 + -DYAML_CPP_BUILD_TESTS=$(usex test)
140 + )
141 +
142 + cmake-multilib_src_configure
143 +}