diff options
Diffstat (limited to 'app-i18n/opencc')
-rw-r--r-- | app-i18n/opencc/Manifest | 1 | ||||
-rw-r--r-- | app-i18n/opencc/opencc-1.1.7-r1.ebuild | 121 |
2 files changed, 122 insertions, 0 deletions
diff --git a/app-i18n/opencc/Manifest b/app-i18n/opencc/Manifest index 767714904f1a..bd7a16df35b1 100644 --- a/app-i18n/opencc/Manifest +++ b/app-i18n/opencc/Manifest @@ -1,5 +1,6 @@ DIST opencc-1.1.4.tar.gz 2806887 BLAKE2B 150fd83818616de42e535f349b2574ff3319e41618e522583a57a00ab08b7f28db6e8f4fa4a0d4dbe027753b5be87065b2015542251986c6301ad441c4bf4c98 SHA512 ab8e7e6a0cc71106cf09eb32899fa8620b946a406f042d75a2444096e0b383cb1993d6c2d12cd7862e71854da4cd5893442bce51df84c32ed09fdfb4a2846f46 DIST opencc-1.1.7.tar.gz 3311712 BLAKE2B 158a4ea5707ade583d326b0e4441640cbaae2ccb1c89c4ccfaeb8b8dd6f1d427a7f5fcaae7ac0bd6fca3208c65fe24577f6b6ba9c7fec1a499936ef83887d181 SHA512 26e4b12238f853b0fa91f9f0d9af7985bf04a0763185cc3b50b69ba99a2d80091b8c3160176d0d4cd348fbf1a680bfd80dc740dc60c938a256dc2dac8ef49f15 EBUILD opencc-1.1.4.ebuild 1585 BLAKE2B d8d1d3f49e839eafa6ace24e9d65742922ccf61ee7659c2e8a9acfdf8de1fb1d4f10ad1d72784538421243db765684ed9d9b3193250f4b82f4c41d128fc2e62b SHA512 70b260dd9da2569fb0bd40a863082bf9cb55e87e6520ff5309c5fc0cb39b7acaec34297a0eeee23fdb1cd9c59856c1beb498dc338224c4421cbd75aa51fb91d8 +EBUILD opencc-1.1.7-r1.ebuild 2840 BLAKE2B a6bb93ce61b7b2d0f9e628673bba0c7c6ac99804eb3e726b020bc7b634910163a1c8598560a8871c1e0ace42af3b33df70162da12bcb87446524e81de2cd76fc SHA512 d6b6cc0e6e67e9e1f3491cc5d6ddf861ed37f12c013ff60d97e29defc4f215e87bf30ad9a9773b9a068f3f6c35af1c3f68a6660bf84725b2389dfa23366c1a6d EBUILD opencc-1.1.7.ebuild 1374 BLAKE2B 0f99b303c360c7475c0bb50a4222f982e16e395ecdedd270a63a0d3106dc3ce407d21a2852686103a1695679146009a9766a2df2d36492e97d8de5daeec3dafa SHA512 946d901b2a3bf380256edda03b5f43e3168e11773b3f60de19586b90a6ae90bae173a05749c1fed47c64cc6bd6b49a0686a61b57b1bb52db39da3d1ad5063cd1 MISC metadata.xml 476 BLAKE2B 4f02f06aa7aca103fff825675453e36a256f130b086992df550aab3dee3c155a48667d00df171053b417b20873a6ed8f1142c9efcfdd8e0994fafa7c1aec5e0b SHA512 c1a73732105a87bf3bca8af82d027b5a0dc0b379e7f8b1fbd301ee6a1f0e986ce8db9542394fc87f885a8736d82836b574a956601bb244172912f58455f39bfb diff --git a/app-i18n/opencc/opencc-1.1.7-r1.ebuild b/app-i18n/opencc/opencc-1.1.7-r1.ebuild new file mode 100644 index 000000000000..89372cdb262c --- /dev/null +++ b/app-i18n/opencc/opencc-1.1.7-r1.ebuild @@ -0,0 +1,121 @@ +# Copyright 2010-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..13} ) +DISTUTILS_EXT=1 +DISTUTILS_OPTIONAL=1 +DISTUTILS_SINGLE_IMPL=1 +DISTUTILS_USE_PEP517=setuptools + +inherit cmake distutils-r1 + +DESCRIPTION="Library for conversion between Traditional and Simplified Chinese characters" +HOMEPAGE="https://github.com/BYVoid/OpenCC" +SRC_URI="https://github.com/BYVoid/OpenCC/archive/ver.${PV}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/OpenCC-ver.${PV}" + +LICENSE="Apache-2.0" +SLOT="0/1.1" +KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~riscv ~x86" +IUSE="doc python test" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +RESTRICT="!test? ( test )" + +RDEPEND="dev-libs/marisa + python? ( ${PYTHON_DEPS} ) +" +DEPEND="${RDEPEND} + dev-cpp/tclap + dev-libs/darts + dev-libs/rapidjson +" +BDEPEND="${PYTHON_DEPS} + doc? ( app-text/doxygen ) + python? ( + ${DISTUTILS_DEPS} + app-admin/chrpath + $(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]') + test? ( $(python_gen_cond_dep 'dev-python/pytest[${PYTHON_USEDEP}]') ) + ) + test? ( + dev-cpp/gtest + !hppa? ( !sparc? ( dev-cpp/benchmark ) ) + ) +" + +DOCS=( AUTHORS NEWS.md README.md ) + +pkg_setup() { + use python && python-single-r1_pkg_setup +} + +src_prepare() { + rm -r deps || die + + sed -e "s:\${DIR_SHARE_OPENCC}/doc:share/doc/${PF}:" -i doc/CMakeLists.txt || die + + cmake_src_prepare + use python && distutils-r1_src_prepare +} + +src_configure() { + local mycmakeargs=( + -DBUILD_DOCUMENTATION=$(usex doc) + -DBUILD_PYTHON=$(usex python) + -DENABLE_BENCHMARK=$(if use test && has_version -d dev-cpp/benchmark; then echo ON; else echo OFF; fi) + -DENABLE_GTEST=$(usex test) + -DUSE_SYSTEM_DARTS=ON + -DUSE_SYSTEM_GOOGLE_BENCHMARK=ON + -DUSE_SYSTEM_GTEST=ON + -DUSE_SYSTEM_MARISA=ON + -DUSE_SYSTEM_PYBIND11=ON + -DUSE_SYSTEM_RAPIDJSON=ON + -DUSE_SYSTEM_TCLAP=ON + ) + + cmake_src_configure + use python && distutils-r1_src_configure +} + +src_compile() { + cmake_src_compile + if use python; then + cp "${BUILD_DIR}"/opencc_clib.*.so python/opencc/clib/ + distutils-r1_src_compile + fi +} + +python_test() { + epytest +} + +src_test() { + cmake_src_test + if use python; then + cd "${BUILD_DIR}_${EPYTHON}/install/usr/lib/${EPYTHON}/site-packages/opencc/clib" || die + mkdir -p share/opencc || die + cp "${S}/data/config"/*.json share/opencc/ || die + pushd "${S}" || die + + distutils-r1_src_test + + popd || die + rm -r share/ || die + fi +} + +src_install() { + cmake_src_install + if use python; then + distutils-r1_src_install + + # Hack to make opencc's python binding to use system opencc's configs + dodir "/usr/lib/${EPYTHON}/site-packages/opencc/clib/share" + dosym -r /usr/share/opencc "/usr/lib/${EPYTHON}/site-packages/opencc/clib/share/opencc" + + # Remove insecure RPATH + chrpath --delete "${ED}/usr/lib/${EPYTHON}/site-packages/opencc/clib"/*.so || die + fi +} |