media-libs/libschrift: remove X-specific libraries from .pc
[sgilles-overlay.git] / media-libs / libschrift / files / 0002-add-pkgconfig-file.patch
blob25e18c0f8a75604be42e678781e3ae5513f881ea
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
6 ---
7 .gitignore | 1 +
8 Makefile | 20 ++++++++++++++++++--
9 2 files changed, 19 insertions(+), 2 deletions(-)
11 diff --git a/.gitignore b/.gitignore
12 index 4faf02d..90c9d94 100644
13 --- a/.gitignore
14 +++ b/.gitignore
15 @@ -3,6 +3,7 @@ libschrift.a
16 libschrift.so
17 /demo
18 /stress
19 +libschrift.pc
21 .vs/
22 *.vcxproj.user
23 diff --git a/Makefile b/Makefile
24 index 89ababb..ef83736 100644
25 --- a/Makefile
26 +++ b/Makefile
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)
40 +libschrift.pc:
41 + @printf '' > $@
42 + @printf 'prefix=%s\n' $(PREFIX) >> $@
43 + @printf 'libdir=%s{prefix}/lib\n' $$ >> $@
44 + @printf 'includedir=%s{prefix}/include\n' $$ >> $@
45 + @printf '\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' >> $@
52 clean:
53 rm -f *.o
54 rm -f util/*.o
55 @@ -33,7 +45,7 @@ clean:
56 rm -f demo
57 rm -f stress
59 -install: libschrift.a libschrift.so schrift.h schrift.3
60 +install: libschrift.a libschrift.so libschrift.pc schrift.h schrift.3
61 # libschrift.a
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"
68 + # libschrift.pc
69 + mkdir -p "$(DESTDIR)$(LIBDIR)/pkgconfig"
70 + cp -f libschrift.pc "$(DESTDIR)$(LIBDIR)/pkgconfig"
71 + chmod 644 "$(DESTDIR)$(LIBDIR)/pkgconfig/libschrift.pc"
73 uninstall:
74 rm -f "$(DESTDIR)$(LIBDIR)/libschrift.a"
75 --
76 2.34.1