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:
21
README.md
21
README.md
@@ -134,9 +134,8 @@ The package names used by the canonical Arch Linux image are listed in
|
|||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
The popup uses the normal system fonts found by Pango and Fontconfig; no font
|
The popup uses the normal system fonts found by Pango and Fontconfig. Run
|
||||||
file argument or system-wide strans installation is required. Run it directly
|
it directly from the build tree:
|
||||||
from the build tree:
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./run.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/`
|
`hanja.dict` from `DIR` at runtime; `run.sh` passes the tracked `map/`
|
||||||
directory. Only the GTK subdirectory has install and uninstall targets.
|
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:
|
Configure clients as needed:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -180,13 +173,9 @@ export GTK_IM_MODULE=strans
|
|||||||
GLFW_IM_MODULE=ibus kitty
|
GLFW_IM_MODULE=ibus kitty
|
||||||
```
|
```
|
||||||
|
|
||||||
Building `gtk/im-strans.so` requires GTK development files. Installing an
|
Building and installing `gtk/im-strans.so` requires GTK development files;
|
||||||
already-built, up-to-date module from this build tree does not: the install
|
the install target uses GTK's own module directory, which packagers and
|
||||||
target first uses an explicit `GTK_MODULE_DIR`, then GTK's pkg-config
|
cross builds override with `GTK_MODULE_DIR`.
|
||||||
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.
|
|
||||||
|
|
||||||
`DESTDIR` staging is supported and deliberately skips the host module-cache
|
`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
|
update. A native install needs the GTK runtime query utility so it can refresh
|
||||||
|
|||||||
@@ -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_LIBDIR ?= $(shell $(PKG_CONFIG) --variable=libdir gtk+-3.0 2>/dev/null)
|
||||||
GTK_BINARY_VERSION ?= $(shell $(PKG_CONFIG) \
|
GTK_BINARY_VERSION ?= $(shell $(PKG_CONFIG) \
|
||||||
--variable=gtk_binary_version gtk+-3.0 2>/dev/null)
|
--variable=gtk_binary_version gtk+-3.0 2>/dev/null)
|
||||||
GTK_RUNTIME_MODULE_DIR = $(shell GTK_PATH= GTK_IM_MODULE_FILE= \
|
GTK_MODULE_DIR ?= $(strip $(if $(GTK_BINARY_VERSION),\
|
||||||
$(GTK_QUERY_IMMODULES) 2>/dev/null | \
|
$(GTK_LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)/immodules))
|
||||||
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)))
|
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user