2021-03-19 23:08:44 +00:00
|
|
|
# Maintainer: Felix Yan <felixonmars@archlinux.org>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
|
|
|
# - disable lto via -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
|
|
|
|
|
|
|
|
pkgbase=opencc
|
|
|
|
pkgname=(opencc opencc-doc)
|
2022-06-05 14:48:15 +00:00
|
|
|
pkgver=1.1.4
|
2022-03-18 23:27:52 +00:00
|
|
|
pkgrel=1
|
2021-03-19 23:08:44 +00:00
|
|
|
pkgdesc="Library for Open Chinese Convert"
|
|
|
|
url="https://github.com/BYVoid/OpenCC"
|
|
|
|
arch=('x86_64')
|
|
|
|
license=('Apache')
|
|
|
|
makedepends=('chrpath' 'cmake' 'darts' 'doxygen' 'marisa' 'pybind11' 'python-setuptools'
|
2022-03-18 23:27:52 +00:00
|
|
|
'python-wheel' 'rapidjson' 'tclap' 'gtest')
|
|
|
|
source=("https://github.com/BYVoid/OpenCC/archive/ver.$pkgver/$pkgbase-$pkgver.tar.gz")
|
2022-06-05 14:48:15 +00:00
|
|
|
sha512sums=('ab8e7e6a0cc71106cf09eb32899fa8620b946a406f042d75a2444096e0b383cb1993d6c2d12cd7862e71854da4cd5893442bce51df84c32ed09fdfb4a2846f46')
|
2021-03-19 23:08:44 +00:00
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd OpenCC-ver.$pkgver
|
|
|
|
rm -r deps
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd OpenCC-ver.$pkgver
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOCUMENTATION:BOOL=ON -DBUILD_PYTHON:BOOL=ON \
|
|
|
|
-DUSE_SYSTEM_MARISA:BOOL=ON -DUSE_SYSTEM_PYBIND11:BOOL=ON -DUSE_SYSTEM_RAPIDJSON:BOOL=ON \
|
2022-03-18 23:27:52 +00:00
|
|
|
-DUSE_SYSTEM_TCLAP:BOOL=ON -DUSE_SYSTEM_DARTS:BOOL=ON -DENABLE_GTEST:BOOL=ON \
|
|
|
|
-DUSE_SYSTEM_GTEST:BOOL=ON -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
|
2021-03-19 23:08:44 +00:00
|
|
|
make
|
|
|
|
|
|
|
|
mkdir python/opencc/clib
|
|
|
|
cp opencc_clib.*.so python/opencc/clib/
|
|
|
|
touch python/opencc/clib/__init__.py
|
|
|
|
python setup.py build
|
|
|
|
}
|
|
|
|
|
2022-03-18 23:27:52 +00:00
|
|
|
check() {
|
|
|
|
cd OpenCC-ver.$pkgver
|
|
|
|
make test
|
|
|
|
}
|
|
|
|
|
2021-03-19 23:08:44 +00:00
|
|
|
package_opencc() {
|
|
|
|
pkgdesc="Library for Open Chinese Convert"
|
|
|
|
depends=('marisa')
|
|
|
|
|
|
|
|
cd OpenCC-ver.$pkgver
|
|
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
python setup.py install --root="$pkgdir" --optimize=1
|
|
|
|
|
|
|
|
# Hack to make opencc's python binding to use system opencc's configs
|
2021-12-13 00:02:25 +00:00
|
|
|
mkdir "$pkgdir"/usr/lib/python3.10/site-packages/opencc/clib/share
|
|
|
|
ln -s ../../../../../../share/opencc "$pkgdir"/usr/lib/python3.10/site-packages/opencc/clib/share/
|
2021-03-19 23:08:44 +00:00
|
|
|
|
|
|
|
# Remove insecure RPath
|
2021-12-13 00:02:25 +00:00
|
|
|
chrpath --delete "$pkgdir"/usr/lib/python3.10/site-packages/opencc/clib/*.so
|
2021-03-19 23:08:44 +00:00
|
|
|
|
|
|
|
# Remove docs - install in split package
|
|
|
|
rm -r "$pkgdir/usr/share/opencc/doc"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_opencc-doc() {
|
|
|
|
pkgdesc="Documentation for Library for Open Chinese Convert"
|
|
|
|
|
|
|
|
cd OpenCC-ver.$pkgver/doc
|
|
|
|
make DESTDIR="$pkgdir" install
|
|
|
|
}
|