1 From 3614a55ad924783cd8f8627b41319eea00c45a11 Mon Sep 17 00:00:00 2001
2 From: "S. Gilles" <sgilles@sgilles.net>
3 Date: Tue, 21 Dec 2021 00:57:14 -0500
4 Subject: [PATCH 2/2] add pkgconfig file
8 Makefile | 20 ++++++++++++++++++--
9 2 files changed, 19 insertions(+), 2 deletions(-)
11 diff --git a/.gitignore b/.gitignore
12 index 4faf02d..90c9d94 100644
15 @@ -3,6 +3,7 @@ libschrift.a
23 diff --git a/Makefile b/Makefile
24 index 89ababb..ef83736 100644
27 @@ -6,7 +6,7 @@ include config.mk
29 .PHONY: all clean install uninstall
31 -all: libschrift.a libschrift.so demo stress
32 +all: libschrift.a libschrift.so libschrift.pc demo stress
34 libschrift.so: schrift.o
35 $(CC) $(LDFLAGS) -shared -L$(X11LIB) -lX11 -lXrender -o $@ $^
36 @@ -25,6 +25,18 @@ stress: stress.o libschrift.a
37 stress.o: stress.c schrift.h util/arg.h
38 $(CC) -c $(EXTRAS_CFLAGS) $(@:.o=.c) -o $@ $(EXTRAS_CPPFLAGS)
42 + @printf 'prefix=%s\n' $(PREFIX) >> $@
43 + @printf 'libdir=%s{prefix}/lib\n' $$ >> $@
44 + @printf 'includedir=%s{prefix}/include\n' $$ >> $@
46 + @printf 'Name: libschrift\n' >> $@
47 + @printf 'Description: libschrift is a lightweight TrueType font rendering library.\n' >> $@
48 + @printf 'Version: 0.10.1\n' >> $@
49 + @printf 'Cflags:\n' >> $@
50 + @printf 'Libs: -lschrift -lm\n' >> $@
55 @@ -33,7 +45,7 @@ clean:
59 -install: libschrift.a libschrift.so schrift.h schrift.3
60 +install: libschrift.a libschrift.so libschrift.pc schrift.h schrift.3
62 mkdir -p "$(DESTDIR)$(LIBDIR)"
63 cp -f libschrift.a "$(DESTDIR)$(LIBDIR)"
64 @@ -56,6 +68,10 @@ install: libschrift.a libschrift.so schrift.h schrift.3
65 mkdir -p "$(DESTDIR)$(MANPREFIX)/man3"
66 cp schrift.3 "$(DESTDIR)$(MANPREFIX)/man3"
67 chmod 644 "$(DESTDIR)$(MANPREFIX)/man3/schrift.3"
69 + mkdir -p "$(DESTDIR)$(LIBDIR)/pkgconfig"
70 + cp -f libschrift.pc "$(DESTDIR)$(LIBDIR)/pkgconfig"
71 + chmod 644 "$(DESTDIR)$(LIBDIR)/pkgconfig/libschrift.pc"
74 rm -f "$(DESTDIR)$(LIBDIR)/libschrift.a"