File: make-pkg-config-subsitutable

package info (click to toggle)
superkb 0.23-5
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 492 kB
  • sloc: ansic: 3,915; sh: 187; makefile: 182
file content (133 lines) | stat: -rw-r--r-- 5,586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
Description: Make pkg-config substitutable
 Taken from Helmut's e-mail:
 .
 superkb fails to cross build from source, because the upstream build
 system hard codes build architecture build tools (gcc and pkg-config).
 The attached patch makes pkg-config substitutable, but it doesn't make
 superkb cross buildable due to its use of help2man [*]. Please consider
 applying the attached patch anyway and close this bug when doing so even
 though superkb will continue to fail cross building.
 .
 [*] A later patch fixes this too.

Author: Helmut Grohne <helmut@subdivi.de>
Bug-Debian: https://bugs.debian.org/929005
Forwarded: https://gitlab.com/alvarezp2000/superkb/-/commit/c93312d60484a40469a02da543ea0eda2e44a3db
Reviewed-By: Octavio Alvarez <alvarezp@alvarezp.com>
Last-Update: 2020-09-05

--- superkb-0.23.orig/Makefile
+++ superkb-0.23/Makefile
@@ -3,54 +3,56 @@
 CONFIGURATION=configuration
 -include $(CONFIGURATION)
 
+PKG_CONFIG ?= pkg-config
+
 #Module information:
 #puticon/puticon-gdkpixbuf
 obj-$(PUTICON_GDKPIXBUF) += puticon/puticon-gdkpixbuf.o
 syms-$(PUTICON_GDKPIXBUF) += -DWITH_GDKPIXBUF
-ldlibs-$(PUTICON_GDKPIXBUF) += $(shell pkg-config gdk-pixbuf-xlib-2.0 --libs)
-cflags-$(PUTICON_GDKPIXBUF) += $(shell pkg-config gdk-pixbuf-xlib-2.0 --cflags)
+ldlibs-$(PUTICON_GDKPIXBUF) += $(shell $(PKG_CONFIG) gdk-pixbuf-xlib-2.0 --libs)
+cflags-$(PUTICON_GDKPIXBUF) += $(shell $(PKG_CONFIG) gdk-pixbuf-xlib-2.0 --cflags)
 
 #puticon/puticon-imlib2 (which I prefer)
 obj-$(PUTICON_IMLIB2) += puticon/puticon-imlib2.o
 syms-$(PUTICON_IMLIB2) += -DWITH_IMLIB2
-ldlibs-$(PUTICON_IMLIB2) += $(shell pkg-config imlib2 --libs)
-cflags-$(PUTICON_IMLIB2) += $(shell pkg-config imlib2 --cflags)
+ldlibs-$(PUTICON_IMLIB2) += $(shell $(PKG_CONFIG) imlib2 --libs)
+cflags-$(PUTICON_IMLIB2) += $(shell $(PKG_CONFIG) imlib2 --cflags)
 
 #drawkblibs/drawkblibs-xlib
 obj-$(DRAWKBLIBS_XLIB) += drawkblibs/drawkblibs-xlib.o
 syms-$(DRAWKBLIBS_XLIB) += -DWITH_DRAWKBLIBS_XLIB
-ldlibs-$(DRAWKBLIBS_XLIB) += $(shell pkg-config x11 --libs)
-cflags-$(DRAWKBLIBS_XLIB) += $(shell pkg-config x11 --cflags)
+ldlibs-$(DRAWKBLIBS_XLIB) += $(shell $(PKG_CONFIG) x11 --libs)
+cflags-$(DRAWKBLIBS_XLIB) += $(shell $(PKG_CONFIG) x11 --cflags)
 
 #drawkblibs/drawkblibs-cairo
 obj-$(DRAWKBLIBS_CAIRO) += drawkblibs/drawkblibs-cairo.o
 syms-$(DRAWKBLIBS_CAIRO) += -DWITH_DRAWKBLIBS_CAIRO
-ldlibs-$(DRAWKBLIBS_CAIRO) += $(shell pkg-config x11 renderproto xrender cairo cairo-xlib pangocairo --libs)
-cflags-$(DRAWKBLIBS_CAIRO) += $(shell pkg-config x11 renderproto xrender cairo cairo-xlib pangocairo --cflags) -DPANGO_ENABLE_BACKEND
+ldlibs-$(DRAWKBLIBS_CAIRO) += $(shell $(PKG_CONFIG) x11 renderproto xrender cairo cairo-xlib pangocairo --libs)
+cflags-$(DRAWKBLIBS_CAIRO) += $(shell $(PKG_CONFIG) x11 renderproto xrender cairo cairo-xlib pangocairo --cflags) -DPANGO_ENABLE_BACKEND
 
-cflags-y += $(shell pkg-config xft --cflags)
-ldlibs-y += $(shell pkg-config xft --libs)
+cflags-y += $(shell $(PKG_CONFIG) xft --cflags)
+ldlibs-y += $(shell $(PKG_CONFIG) xft --libs)
 
 #Choose whether Xinerama will be emulated or real.
 ifeq ($(XINERAMA_SUPPORT),n)
 	obj-y += screeninfo-xlib.o
 else
 	obj-y += screeninfo-xinerama.o
-	ldlibs-y += $(shell pkg-config xinerama --libs)
-	cflags-y += $(shell pkg-config xinerama --cflags)
+	ldlibs-y += $(shell $(PKG_CONFIG) xinerama --libs)
+	cflags-y += $(shell $(PKG_CONFIG) xinerama --cflags)
 endif
 
 version_extrainfo = $(shell ./extendedversioninfo.bash)
 
 #Conditional -pedantic-errors because of pango 1.32.3, 1.32.4 and 1.32.5.
 PEDANTIC_ERRORS := -pedantic-errors
-ifeq ($(shell pkg-config --modversion pango),1.32.3)
+ifeq ($(shell $(PKG_CONFIG) --modversion pango),1.32.3)
        PEDANTIC_ERRORS :=
 endif
-ifeq ($(shell pkg-config --modversion pango),1.32.4)
+ifeq ($(shell $(PKG_CONFIG) --modversion pango),1.32.4)
        PEDANTIC_ERRORS :=
 endif
-ifeq ($(shell pkg-config --modversion pango),1.32.5)
+ifeq ($(shell $(PKG_CONFIG) --modversion pango),1.32.5)
        PEDANTIC_ERRORS :=
 endif
 
@@ -111,17 +113,17 @@ $(APP): $(OBJS)
 	}
 
 configuration:
-	-pkg-config xinerama --exists > /dev/null \
+	-$(PKG_CONFIG) xinerama --exists > /dev/null \
 		&& (echo "XINERAMA_SUPPORT=y" >> configuration) \
 		|| (echo "XINERAMA_SUPPORT=n" >> configuration)
-	-pkg-config gdk-pixbuf-xlib-2.0 --exists > /dev/null \
+	-$(PKG_CONFIG) gdk-pixbuf-xlib-2.0 --exists > /dev/null \
 		&& (echo "PUTICON_GDKPIXBUF=$(MODTYPE)" >> configuration) \
 		|| (echo "PUTICON_GDKPIXBUF=n" >> configuration)
-	-pkg-config imlib2 --exists > /dev/null \
+	-$(PKG_CONFIG) imlib2 --exists > /dev/null \
 		&& (echo "PUTICON_IMLIB2=$(MODTYPE)" >> configuration) \
 		|| (echo "PUTICON_IMLIB2=n" >> configuration)
 	-echo "DRAWKBLIBS_XLIB=$(MODTYPE)" >> configuration
-	-pkg-config x11 renderproto xrender cairo cairo-xlib pangocairo --exists > /dev/null \
+	-$(PKG_CONFIG) x11 renderproto xrender cairo cairo-xlib pangocairo --exists > /dev/null \
 		&& (echo "DRAWKBLIBS_CAIRO=$(MODTYPE)" >> configuration) \
 		|| (echo "DRAWKBLIBS_CAIRO=n" >> configuration)
 
--- superkb-0.23.orig/approve-config
+++ superkb-0.23/approve-config
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+: "${PKG_CONFIG:=pkg-config}"
+
 # Poor man's distro detection.
 DISTRO=unknown
 grep -q 'Debian' /etc/issue && DISTRO=debian
@@ -32,7 +34,7 @@ if echo "$DRAWKBLIBS_XLIB $PUTICON_IMLIB
 fi
 
 if [ "$DRAWKBLIBS_XLIB" = "y" -o "$DRAWKBLIBS_XLIB" = "m" ]; then
-	if pkg-config xft renderproto xrender --exists > /dev/null; then
+	if "${PKG_CONFIG}" xft renderproto xrender --exists > /dev/null; then
 		true
 	else