[arch-commits] Commit in opencc/trunk (PKGBUILD)
Felix Yan
felixonmars at archlinux.org
Sat May 23 07:59:15 UTC 2020
Date: Saturday, May 23, 2020 @ 07:59:14
Author: felixonmars
Revision: 631844
upgpkg: opencc 1.1.1-2 enable python binding
Modified:
opencc/trunk/PKGBUILD
----------+
PKGBUILD | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-05-23 07:34:23 UTC (rev 631843)
+++ PKGBUILD 2020-05-23 07:59:14 UTC (rev 631844)
@@ -3,18 +3,30 @@
pkgbase=opencc
pkgname=(opencc opencc-doc)
pkgver=1.1.1
-pkgrel=1
+pkgrel=2
url="https://github.com/BYVoid/OpenCC"
arch=('x86_64')
license=('Apache')
-makedepends=('cmake' 'doxygen' 'python')
+makedepends=('cmake' 'doxygen' 'python-setuptools' 'python-wheel')
source=("https://github.com/BYVoid/OpenCC/archive/ver.$pkgver/$pkgbase-$pkgver.tar.gz")
sha512sums=('48ccf61f63cf0a1c0fc484a52ae1d406a28949a52be7d7d1595e6aaf87f40ac47ea4697308441a9381f0cd6f404ee5a28b85a2fa2f288c4b3933be36f4a41363')
+prepare() {
+ cd OpenCC-ver.$pkgver/python
+ # Use system opencc
+ sed -i '/BuildPyCommand,/d' setup.py
+ sed -e "s|os.path.join(_thisdir, 'clib', 'lib', _libopenccfilename)|os.path.join('/usr/lib', _libopenccfilename)|" \
+ -e "s|os.path.join(_thisdir, 'clib', 'share', 'opencc')|'/usr/share/opencc'|" \
+ -i opencc/__init__.py
+}
+
build() {
cd OpenCC-ver.$pkgver
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_DOCUMENTATION:BOOL=ON
make
+
+ cd python
+ python setup.py build
}
package_opencc() {
@@ -24,6 +36,9 @@
cd OpenCC-ver.$pkgver
make DESTDIR="${pkgdir}" install
+ cd python
+ python setup.py install --root="$pkgdir" --optimize=1
+
# Remove docs - install in splitted package
rm -r "$pkgdir/usr/share/opencc/doc"
}
More information about the arch-commits
mailing list