Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-i18n/opencc/files/, app-i18n/opencc/
Date: Sun, 27 Dec 2020 18:39:21
Message-Id: 1609094352.3f3756b5e3919e295b2751523e2291fb41686d4a.floppym@gentoo
1 commit: 3f3756b5e3919e295b2751523e2291fb41686d4a
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Sat Dec 26 04:00:00 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 27 18:39:12 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f3756b5
7
8 app-i18n/opencc: Use system libraries.
9
10 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 .../files/opencc-1.1.1-system_libraries.patch | 94 +++++++++++++++++
14 .../files/opencc-1.1.2-system_libraries.patch | 111 +++++++++++++++++++++
15 app-i18n/opencc/opencc-1.1.1.ebuild | 32 ++++--
16 app-i18n/opencc/opencc-9999.ebuild | 32 ++++--
17 4 files changed, 249 insertions(+), 20 deletions(-)
18
19 diff --git a/app-i18n/opencc/files/opencc-1.1.1-system_libraries.patch b/app-i18n/opencc/files/opencc-1.1.1-system_libraries.patch
20 new file mode 100644
21 index 00000000000..ee0527f2235
22 --- /dev/null
23 +++ b/app-i18n/opencc/files/opencc-1.1.1-system_libraries.patch
24 @@ -0,0 +1,94 @@
25 +https://github.com/BYVoid/OpenCC/issues/547
26 +
27 +--- /CMakeLists.txt
28 ++++ /CMakeLists.txt
29 +@@ -28,7 +28,12 @@
30 + option(ENABLE_GTEST "Build all tests." OFF)
31 + option(ENABLE_BENCHMARK "Build benchmark tests." OFF)
32 + option(ENABLE_DARTS "Build DartsDict (ocd format)." ON)
33 +-option(BUILD_BUNDLED_LIBMARISA "" ON)
34 ++option(USE_SYSTEM_DARTS "Use system version of Darts" OFF)
35 ++option(USE_SYSTEM_GOOGLE_BENCHMARK "Use system version of Google Benchmark" OFF)
36 ++option(USE_SYSTEM_GTEST "Use system version of GoogleTest" OFF)
37 ++option(USE_SYSTEM_MARISA "Use system version of Marisa" OFF)
38 ++option(USE_SYSTEM_RAPIDJSON "Use system version of RapidJSON" OFF)
39 ++option(USE_SYSTEM_TCLAP "Use system version of TCLAP" OFF)
40 +
41 + ######## Package information
42 + set (PACKAGE_URL https://github.com/BYVoid/Opencc)
43 +@@ -172,7 +177,7 @@
44 +
45 + ######## Dependencies
46 +
47 +-if(BUILD_BUNDLED_LIBMARISA)
48 ++if(NOT USE_SYSTEM_MARISA)
49 + message(STATUS "Use bundled marisa library.")
50 + add_subdirectory(deps/marisa-0.2.5)
51 + else()
52 +@@ -194,12 +199,16 @@
53 + ######## Testing
54 +
55 + if (ENABLE_GTEST)
56 +- add_subdirectory(deps/gtest-1.11.0)
57 ++ if(NOT USE_SYSTEM_GTEST)
58 ++ add_subdirectory(deps/gtest-1.11.0)
59 ++ endif()
60 + enable_testing()
61 + endif()
62 +
63 + if (ENABLE_BENCHMARK)
64 + set(BENCHMARK_ENABLE_TESTING OFF)
65 +- add_subdirectory(deps/google-benchmark)
66 ++ if(NOT USE_SYSTEM_GOOGLE_BENCHMARK)
67 ++ add_subdirectory(deps/google-benchmark)
68 ++ endif()
69 + enable_testing()
70 + endif()
71 +--- /src/CMakeLists.txt
72 ++++ /src/CMakeLists.txt
73 +@@ -1,7 +1,13 @@
74 + include (GenerateExportHeader)
75 +-include_directories(../deps/marisa-0.2.5/include)
76 +-include_directories(../deps/rapidjson-1.1.0)
77 +-include_directories(../deps/tclap-1.2.2)
78 ++if(NOT USE_SYSTEM_MARISA)
79 ++ include_directories(../deps/marisa-0.2.5/include)
80 ++endif()
81 ++if(NOT USE_SYSTEM_RAPIDJSON)
82 ++ include_directories(../deps/rapidjson-1.1.0)
83 ++endif()
84 ++if(NOT USE_SYSTEM_TCLAP)
85 ++ include_directories(../deps/tclap-1.2.2)
86 ++endif()
87 +
88 + # Library
89 +
90 +@@ -72,7 +78,9 @@
91 + )
92 +
93 + if (ENABLE_DARTS)
94 +- include_directories(../deps/darts-clone)
95 ++ if(NOT USE_SYSTEM_DARTS)
96 ++ include_directories(../deps/darts-clone)
97 ++ endif()
98 + set(
99 + LIBOPENCC_HEADERS
100 + ${LIBOPENCC_HEADERS}
101 +--- /test/CMakeLists.txt
102 ++++ /test/CMakeLists.txt
103 +@@ -1,4 +1,3 @@
104 +-include_directories(../deps/libdarts/src)
105 + include_directories(../src)
106 +
107 + set(CONFIG_TEST
108 +@@ -27,7 +26,9 @@
109 + )
110 + endif()
111 +
112 +- include_directories(../deps/gtest-1.7.0/include)
113 ++ if(NOT USE_SYSTEM_GTEST)
114 ++ include_directories(../deps/gtest-1.7.0/include)
115 ++ endif()
116 + set(UNITTESTS
117 + CommandLineConvertTest
118 + )
119
120 diff --git a/app-i18n/opencc/files/opencc-1.1.2-system_libraries.patch b/app-i18n/opencc/files/opencc-1.1.2-system_libraries.patch
121 new file mode 100644
122 index 00000000000..e0b624a63e9
123 --- /dev/null
124 +++ b/app-i18n/opencc/files/opencc-1.1.2-system_libraries.patch
125 @@ -0,0 +1,111 @@
126 +https://github.com/BYVoid/OpenCC/issues/547
127 +
128 +--- /CMakeLists.txt
129 ++++ /CMakeLists.txt
130 +@@ -28,8 +28,14 @@
131 + option(ENABLE_GTEST "Build all tests." OFF)
132 + option(ENABLE_BENCHMARK "Build benchmark tests." OFF)
133 + option(ENABLE_DARTS "Build DartsDict (ocd format)." ON)
134 +-option(BUILD_BUNDLED_LIBMARISA "" ON)
135 + option(BUILD_PYTHON "Build python library" OFF)
136 ++option(USE_SYSTEM_DARTS "Use system version of Darts" OFF)
137 ++option(USE_SYSTEM_GOOGLE_BENCHMARK "Use system version of Google Benchmark" OFF)
138 ++option(USE_SYSTEM_GTEST "Use system version of GoogleTest" OFF)
139 ++option(USE_SYSTEM_MARISA "Use system version of Marisa" OFF)
140 ++option(USE_SYSTEM_PYBIND11 "Use system version of pybind11" OFF)
141 ++option(USE_SYSTEM_RAPIDJSON "Use system version of RapidJSON" OFF)
142 ++option(USE_SYSTEM_TCLAP "Use system version of TCLAP" OFF)
143 +
144 + ######## Package information
145 + set (PACKAGE_URL https://github.com/BYVoid/Opencc)
146 +@@ -173,7 +179,7 @@
147 +
148 + ######## Dependencies
149 +
150 +-if(BUILD_BUNDLED_LIBMARISA)
151 ++if(NOT USE_SYSTEM_MARISA)
152 + message(STATUS "Use bundled marisa library.")
153 + add_subdirectory(deps/marisa-0.2.5)
154 + else()
155 +@@ -195,20 +201,30 @@
156 + ######## Testing
157 +
158 + if (ENABLE_GTEST)
159 +- add_subdirectory(deps/gtest-1.11.0)
160 ++ if(NOT USE_SYSTEM_GTEST)
161 ++ add_subdirectory(deps/gtest-1.11.0)
162 ++ endif()
163 + enable_testing()
164 + endif()
165 +
166 + if (ENABLE_BENCHMARK)
167 + set(BENCHMARK_ENABLE_TESTING OFF)
168 +- add_subdirectory(deps/google-benchmark)
169 ++ if(NOT USE_SYSTEM_GOOGLE_BENCHMARK)
170 ++ add_subdirectory(deps/google-benchmark)
171 ++ endif()
172 + enable_testing()
173 + endif()
174 +
175 + ######## Python
176 +
177 + if (BUILD_PYTHON)
178 +- add_subdirectory(deps/pybind11-2.5.0)
179 ++ if(USE_SYSTEM_PYBIND11)
180 ++ include(pybind11Config)
181 ++ include(pybind11Common)
182 ++ include(pybind11Tools)
183 ++ else()
184 ++ add_subdirectory(deps/pybind11-2.5.0)
185 ++ endif()
186 + pybind11_add_module(opencc_clib src/py_opencc.cpp)
187 + target_link_libraries(opencc_clib PRIVATE libopencc)
188 + endif()
189 +--- /src/CMakeLists.txt
190 ++++ /src/CMakeLists.txt
191 +@@ -1,7 +1,13 @@
192 + include (GenerateExportHeader)
193 +-include_directories(../deps/marisa-0.2.5/include)
194 +-include_directories(../deps/rapidjson-1.1.0)
195 +-include_directories(../deps/tclap-1.2.2)
196 ++if(NOT USE_SYSTEM_MARISA)
197 ++ include_directories(../deps/marisa-0.2.5/include)
198 ++endif()
199 ++if(NOT USE_SYSTEM_RAPIDJSON)
200 ++ include_directories(../deps/rapidjson-1.1.0)
201 ++endif()
202 ++if(NOT USE_SYSTEM_TCLAP)
203 ++ include_directories(../deps/tclap-1.2.2)
204 ++endif()
205 +
206 + # Library
207 +
208 +@@ -72,7 +78,9 @@
209 + )
210 +
211 + if (ENABLE_DARTS)
212 +- include_directories(../deps/darts-clone)
213 ++ if(NOT USE_SYSTEM_DARTS)
214 ++ include_directories(../deps/darts-clone)
215 ++ endif()
216 + set(
217 + LIBOPENCC_HEADERS
218 + ${LIBOPENCC_HEADERS}
219 +--- /test/CMakeLists.txt
220 ++++ /test/CMakeLists.txt
221 +@@ -1,4 +1,3 @@
222 +-include_directories(../deps/libdarts/src)
223 + include_directories(../src)
224 +
225 + set(CONFIG_TEST
226 +@@ -27,7 +26,9 @@
227 + )
228 + endif()
229 +
230 +- include_directories(../deps/gtest-1.7.0/include)
231 ++ if(NOT USE_SYSTEM_GTEST)
232 ++ include_directories(../deps/gtest-1.7.0/include)
233 ++ endif()
234 + set(UNITTESTS
235 + CommandLineConvertTest
236 + )
237
238 diff --git a/app-i18n/opencc/opencc-1.1.1.ebuild b/app-i18n/opencc/opencc-1.1.1.ebuild
239 index 21a2b29d193..6fd7527c0a9 100644
240 --- a/app-i18n/opencc/opencc-1.1.1.ebuild
241 +++ b/app-i18n/opencc/opencc-1.1.1.ebuild
242 @@ -20,13 +20,7 @@ else
243 SRC_URI="https://github.com/BYVoid/OpenCC/archive/ver.${PV}.tar.gz -> ${P}.tar.gz"
244 fi
245
246 -# OpenCC: Apache-2.0
247 -# deps/darts-clone: BSD-2
248 -# deps/gtest-1.11.0: BSD
249 -# deps/marisa-0.2.5: || ( BSD-2 LGPL-2.1+ )
250 -# deps/rapidjson-1.1.0: MIT
251 -# deps/tclap-1.2.2: MIT
252 -LICENSE="Apache-2.0 BSD-2 MIT || ( BSD-2 LGPL-2.1+ ) test? ( BSD )"
253 +LICENSE="Apache-2.0"
254 SLOT="0/1.1"
255 KEYWORDS="~amd64 ~x86"
256 IUSE="doc test"
257 @@ -34,8 +28,15 @@ RESTRICT="!test? ( test )"
258
259 BDEPEND="${PYTHON_DEPS}
260 doc? ( app-doc/doxygen )"
261 -DEPEND=""
262 -RDEPEND=""
263 +DEPEND="dev-cpp/tclap
264 + dev-libs/darts
265 + dev-libs/marisa:0=
266 + dev-libs/rapidjson
267 + test? (
268 + dev-cpp/benchmark
269 + dev-cpp/gtest
270 + )"
271 +RDEPEND="dev-libs/marisa:0="
272
273 if [[ "${PV}" != "9999" ]]; then
274 S="${WORKDIR}/OpenCC-ver.${PV}"
275 @@ -43,21 +44,32 @@ fi
276
277 PATCHES=(
278 "${FILESDIR}/${PN}-1.1.0-parallel_build.patch"
279 + "${FILESDIR}/${PN}-1.1.1-system_libraries.patch"
280 )
281
282 DOCS=(AUTHORS NEWS.md README.md)
283
284 src_prepare() {
285 + rm -r deps || die
286 +
287 cmake_src_prepare
288
289 sed -e "s:\${DIR_SHARE_OPENCC}/doc:share/doc/${PF}:" -i doc/CMakeLists.txt || die
290 }
291
292 src_configure() {
293 + local -x CXXFLAGS="${CXXFLAGS} -I${ESYSROOT}/usr/include/rapidjson"
294 +
295 local mycmakeargs=(
296 -DBUILD_DOCUMENTATION=$(usex doc ON OFF)
297 - -DBUILD_SHARED_LIBS=ON
298 + -DENABLE_BENCHMARK=$(usex test ON OFF)
299 -DENABLE_GTEST=$(usex test ON OFF)
300 + -DUSE_SYSTEM_DARTS=ON
301 + -DUSE_SYSTEM_GOOGLE_BENCHMARK=ON
302 + -DUSE_SYSTEM_GTEST=ON
303 + -DUSE_SYSTEM_MARISA=ON
304 + -DUSE_SYSTEM_RAPIDJSON=ON
305 + -DUSE_SYSTEM_TCLAP=ON
306 )
307
308 cmake_src_configure
309
310 diff --git a/app-i18n/opencc/opencc-9999.ebuild b/app-i18n/opencc/opencc-9999.ebuild
311 index 9f285d735f5..87734540550 100644
312 --- a/app-i18n/opencc/opencc-9999.ebuild
313 +++ b/app-i18n/opencc/opencc-9999.ebuild
314 @@ -20,13 +20,7 @@ else
315 SRC_URI="https://github.com/BYVoid/OpenCC/archive/ver.${PV}.tar.gz -> ${P}.tar.gz"
316 fi
317
318 -# OpenCC: Apache-2.0
319 -# deps/darts-clone: BSD-2
320 -# deps/gtest-1.11.0: BSD
321 -# deps/marisa-0.2.5: || ( BSD-2 LGPL-2.1+ )
322 -# deps/rapidjson-1.1.0: MIT
323 -# deps/tclap-1.2.2: MIT
324 -LICENSE="Apache-2.0 BSD-2 MIT || ( BSD-2 LGPL-2.1+ ) test? ( BSD )"
325 +LICENSE="Apache-2.0"
326 SLOT="0/1.1"
327 KEYWORDS=""
328 IUSE="doc test"
329 @@ -34,8 +28,15 @@ RESTRICT="!test? ( test )"
330
331 BDEPEND="${PYTHON_DEPS}
332 doc? ( app-doc/doxygen )"
333 -DEPEND=""
334 -RDEPEND=""
335 +DEPEND="dev-cpp/tclap
336 + dev-libs/darts
337 + dev-libs/marisa:0=
338 + dev-libs/rapidjson
339 + test? (
340 + dev-cpp/benchmark
341 + dev-cpp/gtest
342 + )"
343 +RDEPEND="dev-libs/marisa:0="
344
345 if [[ "${PV}" != "9999" ]]; then
346 S="${WORKDIR}/OpenCC-ver.${PV}"
347 @@ -43,21 +44,32 @@ fi
348
349 PATCHES=(
350 "${FILESDIR}/${PN}-1.1.0-parallel_build.patch"
351 + "${FILESDIR}/${PN}-1.1.2-system_libraries.patch"
352 )
353
354 DOCS=(AUTHORS NEWS.md README.md)
355
356 src_prepare() {
357 + rm -r deps || die
358 +
359 cmake_src_prepare
360
361 sed -e "s:\${DIR_SHARE_OPENCC}/doc:share/doc/${PF}:" -i doc/CMakeLists.txt || die
362 }
363
364 src_configure() {
365 + local -x CXXFLAGS="${CXXFLAGS} -I${ESYSROOT}/usr/include/rapidjson"
366 +
367 local mycmakeargs=(
368 -DBUILD_DOCUMENTATION=$(usex doc ON OFF)
369 - -DBUILD_SHARED_LIBS=ON
370 + -DENABLE_BENCHMARK=$(usex test ON OFF)
371 -DENABLE_GTEST=$(usex test ON OFF)
372 + -DUSE_SYSTEM_DARTS=ON
373 + -DUSE_SYSTEM_GOOGLE_BENCHMARK=ON
374 + -DUSE_SYSTEM_GTEST=ON
375 + -DUSE_SYSTEM_MARISA=ON
376 + -DUSE_SYSTEM_RAPIDJSON=ON
377 + -DUSE_SYSTEM_TCLAP=ON
378 )
379
380 cmake_src_configure