Debian Codegraph @

debian/README.source

raw
1 Embedded copy of cppjieba
2 =========================
3
4 The Jieba segmentation plugin (binary packages opencc-jieba and
5 opencc-jieba-data, built from plugins/jieba) is compiled against the
6 copy of cppjieba embedded at plugins/jieba/deps/cppjieba, rather than
7 against a system-wide cppjieba. There is currently no cppjieba package
8 in Debian; see also https://bugs.debian.org/1141451 for the upstream
9 proposal that introduced these binary packages.
10
11 Packaging cppjieba on its own would not be sufficient to drop the
12 embedded copy. The embedded tree is not a pristine copy of upstream
13 cppjieba: it carries a local fork adding a DictTrie::PrecomputedDict
14 struct, a matching DictTrie constructor and Init() overload, and a
15 corresponding cppjieba::Jieba constructor. That API lets the plugin hand
16 cppjieba an already-parsed marisa-backed dictionary (the generated
17 jieba_dict/jieba_merged.ocd2) instead of re-parsing several megabytes of
18 text at every startup, and it is used unconditionally from
19 plugins/jieba/src/JiebaSegmentation.cpp. None of it exists in upstream
20 cppjieba, and it cannot be supplied from outside the library because it
21 writes DictTrie members that are private.
22
23 De-vendoring therefore needs, in order:
24
25 1. DictTrie::PrecomputedDict (or an equivalent way of constructing a
26 DictTrie from an in-memory dictionary) accepted into upstream
27 cppjieba, https://github.com/yanyiwu/cppjieba
28 2. a cppjieba source package in Debian, new enough to carry it
29 3. a USE_SYSTEM_CPPJIEBA option in OpenCC, matching the existing
30 USE_SYSTEM_{DARTS,GTEST,MARISA,PYBIND11,RAPIDJSON,TCLAP} options;
31 plugins/jieba/CMakeLists.txt currently hardcodes the include path to
32 deps/cppjieba/include in two places
33
34 Until then the embedded copy is built and shipped. It is covered by the
35 "Files: plugins/jieba/deps/cppjieba/*" stanza in debian/copyright. Note
36 that a security update to cppjieba would require rebuilding opencc.
37
38 -- Boyuan Yang <[email protected]>, Wed, 12 Aug 2026 11:04:33 -0400