build: install GTK without development files
This commit is contained in:
12
README.md
12
README.md
@@ -108,8 +108,16 @@ export XMODIFIERS=@im=strans
|
|||||||
xterm
|
xterm
|
||||||
```
|
```
|
||||||
|
|
||||||
For GTK 3 applications, install with normal `DESTDIR` semantics. A staged
|
For GTK 3 applications, install the module built by Docker. Installation
|
||||||
install does not update the host GTK module cache:
|
needs the GTK 3 runtime, but not its development package:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
doas make -C gtk install
|
||||||
|
```
|
||||||
|
|
||||||
|
`LIBDIR` defaults to `/usr/lib` and may be overridden for another system.
|
||||||
|
Normal `DESTDIR` semantics are supported, and a staged install does not update
|
||||||
|
the host GTK module cache:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
make -C gtk install DESTDIR="$pkgdir"
|
make -C gtk install DESTDIR="$pkgdir"
|
||||||
|
|||||||
11
gtk/Makefile
11
gtk/Makefile
@@ -1,9 +1,8 @@
|
|||||||
PROG = im-strans.so
|
PROG = im-strans.so
|
||||||
CFLAGS = -Wall -O2 -I.. $(shell pkg-config --cflags gtk+-3.0)
|
CFLAGS = -Wall -O2 -I.. $(shell pkg-config --cflags gtk+-3.0)
|
||||||
LDFLAGS = $(shell pkg-config --libs gtk+-3.0)
|
LDFLAGS = $(shell pkg-config --libs gtk+-3.0)
|
||||||
GTK_LIBDIR ?= $(shell pkg-config --variable=libdir gtk+-3.0)
|
LIBDIR ?= /usr/lib
|
||||||
GTK_BINARY_VERSION ?= $(shell pkg-config --variable=gtk_binary_version gtk+-3.0)
|
GTK_MODULE_DIR = $(LIBDIR)/gtk-3.0/3.0.0/immodules
|
||||||
GTK_MODULE_DIR ?= $(GTK_LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)/immodules
|
|
||||||
|
|
||||||
all: $(PROG)
|
all: $(PROG)
|
||||||
|
|
||||||
@@ -11,15 +10,13 @@ $(PROG): main.c ../ipc.c ../ipc.h
|
|||||||
$(CC) -shared -fPIC $(CFLAGS) -o $@ main.c ../ipc.c $(LDFLAGS)
|
$(CC) -shared -fPIC $(CFLAGS) -o $@ main.c ../ipc.c $(LDFLAGS)
|
||||||
|
|
||||||
install: $(PROG)
|
install: $(PROG)
|
||||||
test -n "$(GTK_LIBDIR)"
|
test -n "$(LIBDIR)"
|
||||||
test -n "$(GTK_BINARY_VERSION)"
|
|
||||||
mkdir -p "$(DESTDIR)$(GTK_MODULE_DIR)"
|
mkdir -p "$(DESTDIR)$(GTK_MODULE_DIR)"
|
||||||
cp $(PROG) "$(DESTDIR)$(GTK_MODULE_DIR)/"
|
cp $(PROG) "$(DESTDIR)$(GTK_MODULE_DIR)/"
|
||||||
if test -z "$(DESTDIR)"; then gtk-query-immodules-3.0 --update-cache; fi
|
if test -z "$(DESTDIR)"; then gtk-query-immodules-3.0 --update-cache; fi
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
test -n "$(GTK_LIBDIR)"
|
test -n "$(LIBDIR)"
|
||||||
test -n "$(GTK_BINARY_VERSION)"
|
|
||||||
rm -f "$(DESTDIR)$(GTK_MODULE_DIR)/$(PROG)"
|
rm -f "$(DESTDIR)$(GTK_MODULE_DIR)/$(PROG)"
|
||||||
if test -z "$(DESTDIR)"; then gtk-query-immodules-3.0 --update-cache; fi
|
if test -z "$(DESTDIR)"; then gtk-query-immodules-3.0 --update-cache; fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user