gtk: find the module directory through the GTK runtime again
A module built in the container is installed on a host that has no GTK development files, and there pkg-config knows nothing: dropping the runtime query left `doas make install` with nowhere to put the module. gtk-query-immodules-3.0 answers where GTK looks, so ask it when pkg-config cannot, as before, and say so in the README.
This commit is contained in:
@@ -183,9 +183,12 @@ export GTK_IM_MODULE=strans
|
||||
GLFW_IM_MODULE=ibus kitty
|
||||
```
|
||||
|
||||
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`.
|
||||
Building `gtk/im-strans.so` requires GTK development files; installing one
|
||||
built elsewhere, in the container for instance, does not. The install
|
||||
target uses `GTK_MODULE_DIR` when it is set, else GTK's pkg-config
|
||||
variables, else the directory the installed `gtk-query-immodules-3.0`
|
||||
reports. Packagers and cross builds should set `GTK_MODULE_DIR`, and a
|
||||
prebuilt module must still match the target architecture and library ABI.
|
||||
|
||||
`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
|
||||
|
||||
10
gtk/Makefile
10
gtk/Makefile
@@ -7,8 +7,14 @@ 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_MODULE_DIR ?= $(strip $(if $(GTK_BINARY_VERSION),\
|
||||
$(GTK_LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)/immodules))
|
||||
# Without GTK development files, ask the runtime where its modules live.
|
||||
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)))
|
||||
|
||||
all: $(PROG)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user