1 |
commit: d05a0a16218bf86412d41a673bc9606448efa9fd |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 1 05:20:46 2022 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 1 08:13:04 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d05a0a16 |
7 |
|
8 |
dev-cpp/rapidyaml: initial import, version 0.3.0 |
9 |
|
10 |
Originally thought to make c4core a separate package, but upstream's |
11 |
rather custom cmake files complicate this and it feels more like |
12 |
a private library (same upstream). It also caused PCSX2 build to |
13 |
fail due to needing to link with c4core as well if it's not builtin. |
14 |
|
15 |
May need revisiting if another package ever depends on c4core directly |
16 |
or want to package the similar test deps (c4fs/c4log). |
17 |
|
18 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
19 |
|
20 |
dev-cpp/rapidyaml/Manifest | 4 ++ |
21 |
.../rapidyaml/files/rapidyaml-0.3.0-libdir.patch | 9 +++ |
22 |
.../files/rapidyaml-0.3.0-no-download.patch | 23 +++++++ |
23 |
.../files/rapidyaml-0.3.0-system-gtest.patch | 8 +++ |
24 |
.../files/rapidyaml-0.3.0-tests-no-install.patch | 18 +++++ |
25 |
dev-cpp/rapidyaml/metadata.xml | 12 ++++ |
26 |
dev-cpp/rapidyaml/rapidyaml-0.3.0.ebuild | 80 ++++++++++++++++++++++ |
27 |
7 files changed, 154 insertions(+) |
28 |
|
29 |
diff --git a/dev-cpp/rapidyaml/Manifest b/dev-cpp/rapidyaml/Manifest |
30 |
new file mode 100644 |
31 |
index 000000000000..c1afe3db7382 |
32 |
--- /dev/null |
33 |
+++ b/dev-cpp/rapidyaml/Manifest |
34 |
@@ -0,0 +1,4 @@ |
35 |
+DIST c4fs-1abba005074022f07d2d9d11ec6a786f2a1f1380.tar.gz 22104 BLAKE2B ea9a063de87962d620e98bad573b1eef9a65cffdacdeab241fd91982f3da93ab01b1bfd6fd87eac5def0b8523f6f2ce32e9321385fb07a6f108dcb68630af1f5 SHA512 00aa29f818a13301df3506ae2b0bc8b527a6d292eb09ccc69681c2ad92ec270aeb635680543dfe1e761a82206c97f8347337a152728eb49d918284e043d32096 |
36 |
+DIST c4log-b8b86f33fc7539661e302171ee6dcc4a17859e67.tar.gz 11983 BLAKE2B 8f2f18e85e01ffe76a2705d181260c7f1c0979009c09c6037097c7711d590f576816e39e869b30cad7b8134114eef55edad327e6224b09c6ba34dd389917af22 SHA512 a3f8f78ffe38426bab2f79748ecadb07e688d98ac75f907a9898ea93f0e7b1818253846412de24f4f755e0a7099aa886515cdd0b28b8c87786ad656a85bd3f9b |
37 |
+DIST rapidyaml-0.3.0-src.tgz 696476 BLAKE2B 30b077e3ddff56f68108a02545efc77ae3684273891f36db61b714a9af414f1f01d147a7132619647796c863ec6ae2f2586c8bfe9e1c2d3c6e7e99d11d41ee8e SHA512 52a469b18c484d8def9239f6f7697f3c3b7760855c7af68a36988cc5a8031e1f5f900819b2af9770722628d0c14fa2cc776d1c07db7a8e85602c4d00aa4199a2 |
38 |
+DIST yaml-test-suite-bcd49a2d4919c1b1ac3b9d6e5ebe6b140b5089e3.tar.gz 54806 BLAKE2B 6574bed549759a1f3df7bcaa8051ab5e37ebb6dec878e1935dbf8f5c234f852c9ea037f90cc7bb93306cc5b1cd95f6fa8df885e51131eae50c9187d360110185 SHA512 814a654b6b04cf4e9b89ae40ba7daddb8f013da96e929ed618764c55dd23a45d8a97c456f526548cd95d673bcada3650383c3626bbbd0caa3fbdbc4b94496a6f |
39 |
|
40 |
diff --git a/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-libdir.patch b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-libdir.patch |
41 |
new file mode 100644 |
42 |
index 000000000000..a10fbc49585e |
43 |
--- /dev/null |
44 |
+++ b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-libdir.patch |
45 |
@@ -0,0 +1,9 @@ |
46 |
+--- a/ext/c4core/cmake/c4Project.cmake |
47 |
++++ b/ext/c4core/cmake/c4Project.cmake |
48 |
+@@ -2643,4 +2643,4 @@ |
49 |
+ set(_RUNTIME_INSTALL_DIR bin/) |
50 |
+- set(_ARCHIVE_INSTALL_DIR lib/) |
51 |
+- set(_LIBRARY_INSTALL_DIR lib/) # TODO on Windows, ARCHIVE and LIBRARY dirs must be different to prevent name clashes |
52 |
++ set(_ARCHIVE_INSTALL_DIR lib/ CACHE STRING "") |
53 |
++ set(_LIBRARY_INSTALL_DIR lib/ CACHE STRING "") |
54 |
+ set(_INCLUDE_INSTALL_DIR include/) |
55 |
|
56 |
diff --git a/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-no-download.patch b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-no-download.patch |
57 |
new file mode 100644 |
58 |
index 000000000000..97c4926cd9d2 |
59 |
--- /dev/null |
60 |
+++ b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-no-download.patch |
61 |
@@ -0,0 +1,23 @@ |
62 |
+--- a/ext/testbm.cmake |
63 |
++++ b/ext/testbm.cmake |
64 |
+@@ -1,4 +1,2 @@ |
65 |
+ # these are used both for testing and benchmarking |
66 |
+-c4_require_subproject(c4fs REMOTE |
67 |
+- GIT_REPOSITORY https://github.com/biojppm/c4fs |
68 |
+- GIT_TAG master) |
69 |
++c4_require_subproject(c4fs SUBDIRECTORY ext/c4fs) |
70 |
+--- a/test/CMakeLists.txt |
71 |
++++ b/test/CMakeLists.txt |
72 |
+@@ -103,10 +103,5 @@ |
73 |
+ |
74 |
+- c4_require_subproject(c4log REMOTE |
75 |
+- GIT_REPOSITORY https://github.com/biojppm/c4log |
76 |
+- GIT_TAG master) |
77 |
++ c4_require_subproject(c4log SUBDIRECTORY ../ext/c4log) |
78 |
+ |
79 |
+- set(tsdir ${ed}/yaml-test-suite) |
80 |
+- c4_download_remote_proj(yaml-test-suite tsdir |
81 |
+- GIT_REPOSITORY https://github.com/yaml/yaml-test-suite |
82 |
+- GIT_TAG bcd49a2d4919c1b1ac3b9d6e5ebe6b140b5089e3) |
83 |
++ set(tsdir ${CMAKE_SOURCE_DIR}/ext/yaml-test-suite) |
84 |
+ set(suite_dir ${tsdir}/src) |
85 |
|
86 |
diff --git a/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-system-gtest.patch b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-system-gtest.patch |
87 |
new file mode 100644 |
88 |
index 000000000000..0e404f09d781 |
89 |
--- /dev/null |
90 |
+++ b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-system-gtest.patch |
91 |
@@ -0,0 +1,8 @@ |
92 |
+--- a/ext/c4core/cmake/c4Project.cmake |
93 |
++++ b/ext/c4core/cmake/c4Project.cmake |
94 |
+@@ -2762,2 +2762,5 @@ |
95 |
+ if(NOT TARGET gtest) |
96 |
++ find_package(GTest REQUIRED) |
97 |
++ endif() |
98 |
++ if(FALSE) |
99 |
+ c4_import_remote_proj(gtest ${CMAKE_CURRENT_BINARY_DIR}/ext/gtest |
100 |
|
101 |
diff --git a/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-tests-no-install.patch b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-tests-no-install.patch |
102 |
new file mode 100644 |
103 |
index 000000000000..97aeb72ee1a5 |
104 |
--- /dev/null |
105 |
+++ b/dev-cpp/rapidyaml/files/rapidyaml-0.3.0-tests-no-install.patch |
106 |
@@ -0,0 +1,18 @@ |
107 |
+--- a/ext/c4fs/CMakeLists.txt |
108 |
++++ b/ext/c4fs/CMakeLists.txt |
109 |
+@@ -18,6 +18,4 @@ |
110 |
+ ) |
111 |
+ |
112 |
+-c4_install_target(c4fs) |
113 |
+-c4_install_exports() |
114 |
+ |
115 |
+ c4_add_dev_targets() |
116 |
+--- a/ext/c4log/CMakeLists.txt |
117 |
++++ b/ext/c4log/CMakeLists.txt |
118 |
+@@ -21,6 +21,4 @@ |
119 |
+ ) |
120 |
+ |
121 |
+-c4_install_target(c4log) |
122 |
+-c4_install_exports() |
123 |
+ |
124 |
+ c4_add_dev_targets() |
125 |
|
126 |
diff --git a/dev-cpp/rapidyaml/metadata.xml b/dev-cpp/rapidyaml/metadata.xml |
127 |
new file mode 100644 |
128 |
index 000000000000..0955cf954630 |
129 |
--- /dev/null |
130 |
+++ b/dev-cpp/rapidyaml/metadata.xml |
131 |
@@ -0,0 +1,12 @@ |
132 |
+<?xml version="1.0" encoding="UTF-8"?> |
133 |
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> |
134 |
+<pkgmetadata> |
135 |
+ <maintainer type="person"> |
136 |
+ <email>ionen@g.o</email> |
137 |
+ <name>Ionen Wolkens</name> |
138 |
+ </maintainer> |
139 |
+ <upstream> |
140 |
+ <remote-id type="github">biojppm/rapidyaml</remote-id> |
141 |
+ <remote-id type="pypi">rapidyaml</remote-id> |
142 |
+ </upstream> |
143 |
+</pkgmetadata> |
144 |
|
145 |
diff --git a/dev-cpp/rapidyaml/rapidyaml-0.3.0.ebuild b/dev-cpp/rapidyaml/rapidyaml-0.3.0.ebuild |
146 |
new file mode 100644 |
147 |
index 000000000000..a31baebfcc2c |
148 |
--- /dev/null |
149 |
+++ b/dev-cpp/rapidyaml/rapidyaml-0.3.0.ebuild |
150 |
@@ -0,0 +1,80 @@ |
151 |
+# Copyright 2022 Gentoo Authors |
152 |
+# Distributed under the terms of the GNU General Public License v2 |
153 |
+ |
154 |
+EAPI=8 |
155 |
+ |
156 |
+inherit cmake |
157 |
+ |
158 |
+C4FS_COMMIT="1abba005074022f07d2d9d11ec6a786f2a1f1380" |
159 |
+C4LOG_COMMIT="b8b86f33fc7539661e302171ee6dcc4a17859e67" |
160 |
+YAMLTS_COMMIT="bcd49a2d4919c1b1ac3b9d6e5ebe6b140b5089e3" |
161 |
+C4FS_P="c4fs-${C4FS_COMMIT}" |
162 |
+C4LOG_P="c4log-${C4LOG_COMMIT}" |
163 |
+YAMLTS_P="yaml-test-suite-${YAMLTS_COMMIT}" |
164 |
+ |
165 |
+DESCRIPTION="Library to parse and emit YAML, and do it fast" |
166 |
+HOMEPAGE="https://github.com/biojppm/rapidyaml/" |
167 |
+SRC_URI=" |
168 |
+ https://github.com/biojppm/rapidyaml/releases/download/v${PV}/${P}-src.tgz |
169 |
+ test? ( |
170 |
+ https://github.com/biojppm/c4fs/archive/${C4FS_COMMIT}.tar.gz -> ${C4FS_P}.tar.gz |
171 |
+ https://github.com/biojppm/c4log/archive/${C4LOG_COMMIT}.tar.gz -> ${C4LOG_P}.tar.gz |
172 |
+ https://github.com/yaml/yaml-test-suite/archive/${YAMLTS_COMMIT}.tar.gz -> ${YAMLTS_P}.tar.gz |
173 |
+ )" |
174 |
+S="${WORKDIR}/${P}-src" |
175 |
+ |
176 |
+LICENSE="MIT Boost-1.0 BSD" |
177 |
+SLOT="0/${PV}" |
178 |
+KEYWORDS="~amd64 ~x86" |
179 |
+IUSE="debug test" |
180 |
+RESTRICT="!test? ( test )" |
181 |
+ |
182 |
+DEPEND="test? ( dev-cpp/gtest )" |
183 |
+ |
184 |
+PATCHES=( |
185 |
+ "${FILESDIR}"/${P}-libdir.patch |
186 |
+ "${FILESDIR}"/${P}-no-download.patch |
187 |
+ "${FILESDIR}"/${P}-system-gtest.patch |
188 |
+) |
189 |
+ |
190 |
+DOCS=( README.md ROADMAP.md changelog ) |
191 |
+ |
192 |
+src_prepare() { |
193 |
+ if use test; then |
194 |
+ mv ../${C4FS_P} ext/c4fs && |
195 |
+ rmdir ext/c4fs/ext/c4core && |
196 |
+ ln -s ../../c4core ext/c4fs/ext || die |
197 |
+ |
198 |
+ mv ../${C4LOG_P} ext/c4log && |
199 |
+ rmdir ext/c4log/ext/c4core && |
200 |
+ ln -s ../../c4core ext/c4log/ext || die |
201 |
+ |
202 |
+ mv ../${YAMLTS_P} ext/yaml-test-suite || die |
203 |
+ |
204 |
+ PATCHES+=( "${FILESDIR}"/${P}-tests-no-install.patch ) |
205 |
+ fi |
206 |
+ |
207 |
+ cmake_src_prepare |
208 |
+} |
209 |
+ |
210 |
+src_configure() { |
211 |
+ local mycmakeargs=( |
212 |
+ -DRYML_BUILD_API=no # TODO if a consumer needs it |
213 |
+ -DRYML_BUILD_TESTS=$(usex test) |
214 |
+ -DRYML_DBG=$(usex debug) |
215 |
+ -D_{ARCHIVE,LIBRARY}_INSTALL_DIR=$(get_libdir) |
216 |
+ ) |
217 |
+ |
218 |
+ cmake_src_configure |
219 |
+} |
220 |
+ |
221 |
+src_test() { |
222 |
+ cmake_build test |
223 |
+} |
224 |
+ |
225 |
+src_install() { |
226 |
+ cmake_src_install |
227 |
+ |
228 |
+ # remove shared private library that is statically linked |
229 |
+ rm "${ED}"/usr/$(get_libdir)/libc4core.so* || die |
230 |
+} |