gtk, docs: the module goes where GTK says, and the README says less

The install target guessed the module directory from whichever immodule
was already installed when pkg-config had nothing to say — a guess that
finds nothing on a fresh system and needed seven lines of README to
explain.  It uses GTK's own pkg-config variables now, or the
GTK_MODULE_DIR a packager sets.  The README also loses a negation about
a font argument that no longer exists and two paragraphs that repeat the
dependency list.
This commit is contained in:
2026-08-17 12:19:28 +09:00
parent 0ba7dc7f50
commit 3a90826238
2 changed files with 7 additions and 23 deletions

View File

@@ -134,9 +134,8 @@ The package names used by the canonical Arch Linux image are listed in
## Run
The popup uses the normal system fonts found by Pango and Fontconfig; no font
file argument or system-wide strans installation is required. Run it directly
from the build tree:
The popup uses the normal system fonts found by Pango and Fontconfig. Run
it directly from the build tree:
```sh
./run.sh
@@ -160,12 +159,6 @@ opens `hira.map`, `kata.map`, `telex.map`, `kanji.dict`, `emoji.dict`, and
`hanja.dict` from `DIR` at runtime; `run.sh` passes the tracked `map/`
directory. Only the GTK subdirectory has install and uninstall targets.
Pango shapes the complete string and selects glyph fallback from the system
font set.
The popup renderer uses Pango/PangoCairo and Cairo. When `DISPLAY` is set,
`strans` starts its XIM worker in the same process.
Configure clients as needed:
```sh
@@ -180,13 +173,9 @@ export GTK_IM_MODULE=strans
GLFW_IM_MODULE=ibus kitty
```
Building `gtk/im-strans.so` requires GTK development files. Installing an
already-built, up-to-date module from this build tree does not: the install
target first uses an explicit `GTK_MODULE_DIR`, then GTK's pkg-config
variables, and finally the module directory reported by the GTK runtime's
`gtk-query-immodules-3.0`. Packagers and cross builds should set
`GTK_MODULE_DIR` explicitly. A prebuilt module must still match the target
architecture and library ABI.
Building and installing `gtk/im-strans.so` requires GTK development files;
the install target uses GTK's own module directory, which packagers and
cross builds override with `GTK_MODULE_DIR`.
`DESTDIR` staging is supported and deliberately skips the host module-cache
update. A native install needs the GTK runtime query utility so it can refresh

View File

@@ -7,13 +7,8 @@ GTK_QUERY_IMMODULES ?= gtk-query-immodules-3.0
GTK_LIBDIR ?= $(shell $(PKG_CONFIG) --variable=libdir gtk+-3.0 2>/dev/null)
GTK_BINARY_VERSION ?= $(shell $(PKG_CONFIG) \
--variable=gtk_binary_version gtk+-3.0 2>/dev/null)
GTK_RUNTIME_MODULE_DIR = $(shell GTK_PATH= GTK_IM_MODULE_FILE= \
$(GTK_QUERY_IMMODULES) 2>/dev/null | \
awk -F '"' '/^"\// { sub("/[^/]*$$", "", $$2); print $$2; exit }')
GTK_MODULE_DIR ?= $(strip $(if \
$(and $(strip $(GTK_LIBDIR)),$(strip $(GTK_BINARY_VERSION))),\
$(GTK_LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)/immodules,\
$(GTK_RUNTIME_MODULE_DIR)))
GTK_MODULE_DIR ?= $(strip $(if $(GTK_BINARY_VERSION),\
$(GTK_LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)/immodules))
all: $(PROG)