From bb3d5c561ca4b6b62162b8de3b046553427985d9 Mon Sep 17 00:00:00 2001 From: kevin-s-ikegami <108323852+kevin-s-ikegami@users.noreply.github.com> Date: Mon, 8 Jun 2026 12:03:51 +0900 Subject: [PATCH] docs: add source build instructions --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index edf555e..77b8789 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,31 @@ Known platforms without wheels: - PowerPC - Windows 32bit +## Building from Source + +If you are installing fugashi from source, install MeCab first. The build uses +`mecab-config` on Unix-like platforms to find the MeCab headers and libraries. +If `mecab-config` is not on your `PATH`, the build will fail with an error +asking whether MeCab is installed. + +On Linux or macOS, a typical local development setup looks like this: + +```sh +python -m venv .venv +. .venv/bin/activate +python -m pip install --upgrade pip +python -m pip install -e '.[unidic-lite]' +python -c "from fugashi import Tagger; print(Tagger('-Owakati').parse('麩菓子'))" +``` + +The editable install builds the Cython extension in place. Installing the +`unidic-lite` extra is not required for compilation, but it gives fugashi a +dictionary so you can immediately verify that the built package works. + +If you need to build from source on Windows, install MeCab from +[@chezou's fork](https://github.com/chezou/mecab) first, then run the same +editable install command in your Python environment. + ## Usage ```python