termux-packages/packages/libtermkey/Makefile.patch
Fredrik Fornwall 59f0d218a6 Initial push
2015-06-13 01:03:31 +02:00

56 lines
1.9 KiB
Diff

diff -u -r ../libtermkey-0.17/Makefile ./Makefile
--- ../libtermkey-0.17/Makefile 2014-01-06 13:03:51.000000000 -0500
+++ ./Makefile 2015-03-02 15:49:31.323905282 -0500
@@ -19,12 +19,14 @@
LDFLAGS+=-pg
endif
-ifeq ($(shell pkg-config --atleast-version=0.1.0 unibilium && echo 1),1)
- CFLAGS +=$(shell pkg-config --cflags unibilium) -DHAVE_UNIBILIUM
- LDFLAGS+=$(shell pkg-config --libs unibilium)
-else ifeq ($(shell pkg-config ncursesw && echo 1),1)
- CFLAGS +=$(shell pkg-config --cflags ncursesw)
- LDFLAGS+=$(shell pkg-config --libs ncursesw)
+PKG_CONFIG?=pkg-config
+
+ifeq ($(shell $(PKG_CONFIG) --atleast-version=0.1.0 unibilium && echo 1),1)
+ CFLAGS +=$(shell $(PKG_CONFIG) --cflags unibilium) -DHAVE_UNIBILIUM
+ LDFLAGS+=$(shell $(PKG_CONFIG) --libs unibilium)
+else ifeq ($(shell $(PKG_CONFIG) ncursesw && echo 1),1)
+ CFLAGS +=$(shell $(PKG_CONFIG) --cflags ncursesw)
+ LDFLAGS+=$(shell $(PKG_CONFIG) --libs ncursesw)
else
LDFLAGS+=-lncurses
endif
@@ -34,7 +36,7 @@
DEMOS=demo demo-async
-ifeq ($(shell pkg-config glib-2.0 && echo 1),1)
+ifeq ($(shell $(PKG_CONFIG) glib-2.0 && echo 1),1)
DEMOS+=demo-glib
endif
@@ -50,7 +52,7 @@
VERSION_REVISION=0
VERSION_AGE=11
-PREFIX=/usr/local
+PREFIX?=/usr/local
LIBDIR=$(PREFIX)/lib
INCDIR=$(PREFIX)/include
MANDIR=$(PREFIX)/share/man
@@ -72,10 +74,10 @@
$(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^
demo-glib.lo: demo-glib.c termkey.h
- $(LIBTOOL) --mode=compile --tag=CC $(CC) -o $@ -c $< $(shell pkg-config glib-2.0 --cflags)
+ $(LIBTOOL) --mode=compile --tag=CC $(CC) -o $@ -c $< $(shell $(PKG_CONFIG) glib-2.0 --cflags)
demo-glib: $(LIBRARY) demo-glib.lo
- $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^ $(shell pkg-config glib-2.0 --libs)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^ $(shell $(PKG_CONFIG) glib-2.0 --libs)
t/%.t: t/%.c $(LIBRARY) t/taplib.lo
$(LIBTOOL) --mode=link --tag=CC $(CC) -o $@ $^