[Bug 293943] textproc/sonic: Make tokenizer features optional via OPTIONS, adopt port

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 20 Mar 2026 20:50:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=293943

            Bug ID: 293943
           Summary: textproc/sonic: Make tokenizer features optional via
                    OPTIONS, adopt port
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: wadegimpbc@tuta.com
                CC: fuz@FreeBSD.org

Created attachment 268960
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=268960&action=edit
Patch to add tokenizer OPTIONS and adopt port

This patch makes the Japanese and Chinese word segmentation features optional
via FreeBSD OPTIONS helpers, and adopts the port.
Currently the port unconditionally downloads a ~100MB UniDic Japanese
dictionary (unidic-mecab-2.1.2_src.zip) for every build, regardless of whether
the user needs Japanese tokenization. Upstream removed tokenizer-japanese from
default cargo features in v1.4.2 because it 10x'd the final binary size. This
patch brings the port in line with upstream's intent.
Changes:

MAINTAINER changed to wadegimpbc@tuta.com
Added CHINESE and JAPANESE OPTIONS using OPTIONS helpers
OPTIONS_DEFAULT includes CHINESE (matching upstream's default features)
UniDic download now conditional on JAPANESE option
CARGO_FEATURES uses --no-default-features with allocator-jemalloc as base, per
cargo.mk convention (lines 23-26, 192, 197-200)

Upstream Cargo.toml default features: ["allocator-jemalloc",
"tokenizer-chinese"]
Note: I do not have a FreeBSD build environment to test this patch. Review and
build testing by a committer would be appreciated.
Patch attached.

-- 
You are receiving this mail because:
You are the assignee for the bug.