2024-07-09 04:23:45 +00:00

70 lines
1.5 KiB
Plaintext

# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=libchewing
pkgver=0.8.5
pkgrel=0
pkgdesc="Intelligent Chinese phonetic input method"
url="https://chewing.im/"
arch="all"
license="LGPL-2.1-only"
makedepends="
cargo
cmake
corrosion
ncurses-dev
samurai
sqlite-dev
zstd
"
subpackages="
$pkgname-dev
$pkgname-tools
$pkgname-tools-doc:_tools_doc:noarch
"
source="https://github.com/chewing/libchewing/releases/download/v$pkgver/libchewing-$pkgver.tar.zst"
prepare() {
default_prepare
cargo fetch --target="$CTARGET" --locked
}
build() {
export CFLAGS="$CFLAGS -DHAVE_NCURSES_H"
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTING="$(want_check && echo ON || echo OFF)" \
-DCMAKE_BUILD_TYPE=None
cmake --build build
}
check() {
# parallel testing is broken (https://github.com/chewing/libchewing/issues/293)
ctest --test-dir build --output-on-failure -j1
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
tools() {
pkgdesc="$pkgdesc (command line tools)"
amove usr/bin
}
_tools_doc() {
pkgdesc="$pkgdesc (man pages for tools)"
install_if="docs $pkgname-tools=$pkgver-r$pkgrel"
# man pages are already gzipped by cmake
amove usr/share/man/man1
}
sha512sums="
78a4e1470cc4777cfdab0576f5278b56ba1ea8bf516352ff713395b888ad402de0419fbc0e3be80b1735eebd4324784f53380630b4f0ebf7f0b8dcb645948d98 libchewing-0.8.5.tar.zst
"