# Contributor: Ivan Tham # Maintainer: Celeste pkgname=opencc _pkgname=OpenCC pkgver=1.1.6 pkgrel=1 pkgdesc="Open Chinese Convert" url="https://opencc.byvoid.com/" arch="all" license="Apache-2.0" makedepends=" cmake doxygen libmarisa-dev python3 rapidjson-dev tclap-dev samurai " checkdepends="benchmark-dev gtest-dev" subpackages="$pkgname-dev $pkgname-libs $pkgname-doc" source="https://github.com/BYVoid/opencc/archive/refs/tags/ver.$pkgver/OpenCC-ver.$pkgver.tar.gz" builddir="$srcdir/$_pkgname-ver.$pkgver" build() { if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DCMAKE_INSTALL_PREFIX=/usr \ -DBUILD_DOCUMENTATION=ON \ -DBUILD_TESTING=OFF \ -DUSE_SYSTEM_MARISA=ON \ -DUSE_SYSTEM_RAPIDJSON=ON \ -DUSE_SYSTEM_TCLAP=ON \ -DUSE_SYSTEM_GOOGLE_BENCHMARK=ON \ -DUSE_SYSTEM_GTEST=ON \ -DENABLE_GTEST="$(want_check && echo ON || echo OFF)" $CMAKE_CROSSOPTS cmake --build build } check() { ./build/test/CommandLineConvertTest } package() { DESTDIR="$pkgdir" cmake --install build mkdir -p "$pkgdir"/usr/share/doc mv "$pkgdir"/usr/share/opencc/doc "$pkgdir"/usr/share/doc/opencc } sha512sums=" bfc40bdf1348e6a265b3304ab1e8acee2f4b6ac9c377ff3d8c996435a92dee98c3758503186b4fd424653faf44db339f8a90300e3290c59942ccf04b1bbb2a30 OpenCC-ver.1.1.6.tar.gz "