summaryrefslogtreecommitdiff
path: root/app-i18n/libchewing/libchewing-0.10.3.ebuild
blob: 6c0eb20d4ee82dc987567e035eba8e785608314b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Copyright 2004-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# Build dir should be inside of source dir for tests
BUILD_DIR="${WORKDIR}/${P}/build"

RUST_MIN_VER="1.88.0"

# from pycargoebuild
CRATES="
	anstream@0.6.20
	anstyle-parse@0.2.7
	anstyle-query@1.1.4
	anstyle-wincon@3.0.10
	anstyle@1.0.11
	anyhow@1.0.99
	bitflags@2.9.3
	cfg-if@1.0.3
	clap@4.5.45
	clap_builder@4.5.44
	clap_derive@4.5.45
	clap_lex@0.7.5
	clap_mangen@0.2.29
	colorchoice@1.0.4
	der@0.7.10
	env_filter@0.1.3
	env_logger@0.11.8
	errno@0.3.13
	fallible-iterator@0.3.0
	fallible-streaming-iterator@0.1.9
	fastrand@2.3.0
	foldhash@0.1.5
	getrandom@0.3.3
	hashbrown@0.15.5
	hashlink@0.10.0
	heck@0.5.0
	is_terminal_polyfill@1.70.1
	libc@0.2.175
	libsqlite3-sys@0.35.0
	linux-raw-sys@0.9.4
	log@0.4.27
	once_cell@1.21.3
	once_cell_polyfill@1.70.1
	pkg-config@0.3.32
	proc-macro2@1.0.101
	quote@1.0.40
	r-efi@5.3.0
	roff@0.2.2
	rusqlite@0.37.0
	rustix@1.0.8
	smallvec@1.15.1
	strsim@0.11.1
	syn@2.0.106
	tempfile@3.21.0
	unicode-ident@1.0.18
	utf8parse@0.2.2
	vcpkg@0.2.15
	wasi@0.14.2+wasi-0.2.4
	windows-link@0.1.3
	windows-sys@0.60.2
	windows-targets@0.53.3
	windows_aarch64_gnullvm@0.53.0
	windows_aarch64_msvc@0.53.0
	windows_i686_gnu@0.53.0
	windows_i686_gnullvm@0.53.0
	windows_i686_msvc@0.53.0
	windows_x86_64_gnu@0.53.0
	windows_x86_64_gnullvm@0.53.0
	windows_x86_64_msvc@0.53.0
	wit-bindgen-rt@0.39.0
	zeroize@1.8.1
"

inherit cargo cmake unpacker

DESCRIPTION="The intelligent phonetic input method library"
HOMEPAGE="https://chewing.im/ https://github.com/chewing/libchewing"
SRC_URI="https://github.com/chewing/libchewing/releases/download/v${PV}/${P}.tar.zst
	${CARGO_CRATE_URIS}"

LICENSE="LGPL-2.1"
# Dependent crate licenses
LICENSE+=" MIT Unicode-3.0 ZLIB"
SLOT="0/3"
KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
IUSE="test"
RESTRICT="!test? ( test )"

BDEPEND="
	>=dev-build/cmake-3.21.0
	dev-build/corrosion
"
RDEPEND="dev-db/sqlite:3"
DEPEND="${RDEPEND}
	test? ( sys-libs/ncurses[unicode(+)] )"

PATCHES=(
	"${FILESDIR}/libchewing-0.10.3_man-compression.patch"
)

src_unpack() {
	unpacker ${P}.tar.zst
	cargo_src_unpack
}

src_configure() {
	local mycmakeargs=(
		-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
		-DBUILD_SHARED_LIBS=ON
		-DBUILD_TESTING=$(usex test)
		-DCOMPRESS_MANS=OFF
		-DENABLE_GCOV=OFF
		-DWITH_SQLITE3=ON	# use system sqlite
		-DUSE_VALGRIND=OFF	# only for testing purpose
	)
	cmake_src_configure
}

src_compile() {
	cargo_env cmake_src_compile
}

src_test() {
	# https://github.com/chewing/libchewing/issues/293
	cmake_src_test -j1
}

src_install() {
	cargo_env cmake_src_install
}