File: rules

package info (click to toggle)
gtk+3.0 3.24.5-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 216,800 kB
  • sloc: ansic: 1,161,222; xml: 9,414; makefile: 7,113; sh: 5,215; python: 439; perl: 370; cpp: 34; sed: 16
file content (216 lines) | stat: -rwxr-xr-x 7,072 bytes parent folder | download | duplicates (2)
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
#!/usr/bin/make -f

DISABLE_UPDATE_UPLOADERS = 1
include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
include /usr/share/dpkg/default.mk
include /usr/share/dpkg/pkg-info.mk

built_binaries := $(shell dh_listpackages)
all_binaries := $(shell sed -ne 's/^Package: *//p' < debian/control)

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Ensure the build aborts when there are still references to undefined symbols
# currently fails at least in the im-multipress im module
#LDFLAGS += -Wl,-z,defs
export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,--as-needed

APIVER := 3
SONAME := 0

LIBDIR := usr/lib/$(DEB_HOST_MULTIARCH)

# earliest version that this release has backwards binary compatibility for
GTK_BINARY_VERSION := 3.0.0

# Gtk binary version virtual Provide
GTK_BINVER_DEP := gtk$(APIVER)-binver-$(GTK_BINARY_VERSION)

# relative base directory for configuration
CONFDIR := etc/gtk-3.0

# relative base directory for all types of modules
MODULES_BASE_PATH := $(LIBDIR)/gtk-3.0/$(GTK_BINARY_VERSION)
OLD_MODULES_BASE_PATH := usr/lib/gtk-3.0/$(GTK_BINARY_VERSION)

# package names
SHARED_PKG := libgtk-$(APIVER)-$(SONAME)
COMMON_PKG := libgtk-$(APIVER)-common
DEV_PKG := libgtk-$(APIVER)-dev
UDEB_PKG := $(SHARED_PKG)-udeb
DOC_PKG := libgtk-$(APIVER)-doc
BIN_PKG := libgtk-$(APIVER)-bin
EXAMPLES_PKG := gtk-$(APIVER)-examples

# files larger than 4k in size will be compressed by dh_compress
# so append a .gz suffix to avoid dangling symlinks
NEWS := NEWS$(shell find -maxdepth 1 -size +4k -name NEWS -exec echo ".gz" \;)
README := README$(shell find -maxdepth 1 -size +4k -name README -exec echo ".gz" \;)

# Avoid test failures on buildd environments
export HOME=$(CURDIR)/debian/build
export XDG_RUNTIME_DIR=$(HOME)
# So that gsettings can find the (uninstalled) gtk schemas
export XDG_DATA_DIRS=/usr/share:$(CURDIR)/debian/build
# Put these back to their defaults if we are not running with a clean
# environment, so that they are based on the temporary $HOME above
unexport XDG_CACHE_HOME
unexport XDG_CONFIG_DIRS
unexport XDG_CONFIG_HOME
unexport XDG_DATA_HOME
# Get failing tests' stdout/err so we have some information when a build fails
export VERBOSE=1

# macro computing the list of 'debian/<pkg>.*" files which have a
# corresponding ".in" file; pass the list of packages in $(1)
dh_subst_files = $(patsubst %.in,%,$(wildcard $(addprefix debian/, $(addsuffix *.in, $(1)))))

debian/%: debian/%.in
	dh_testdir
	sed \
		-e "s#@SONAME@#$(SONAME)#g" \
		-e "s#@APIVER@#$(APIVER)#g" \
		-e "s#@VERSION@#$(DEB_VERSION_UPSTREAM)#g" \
		-e "s#@GTK_BINVER_DEP@#$(GTK_BINVER_DEP)#g" \
		-e "s#@SHARED_PKG@#$(SHARED_PKG)#g" \
		-e "s#@COMMON_PKG@#$(COMMON_PKG)#g" \
		-e "s#@DEV_PKG@#$(DEV_PKG)#g" \
		-e "s#@UDEB_PKG@#$(UDEB_PKG)#g" \
		-e "s#@DOC_PKG@#$(DOC_PKG)#g" \
		-e "s#@BIN_PKG@#$(BIN_PKG)#g" \
		-e "s#@EXAMPLES_PKG@#$(EXAMPLES_PKG)#g" \
		-e "s#@GNOME_TEAM@#$(UPLOADERS)#g" \
		-e "s#@GTK_BINARY_VERSION@#$(GTK_BINARY_VERSION)#g" \
		-e "s#@LIBDIR@#$(LIBDIR)#g" \
		-e 's#@CONFDIR@#$(CONFDIR)#g' \
		-e "s#@MODULES_BASE_PATH@#$(MODULES_BASE_PATH)#g" \
		-e "s#@OLD_MODULES_BASE_PATH@#$(OLD_MODULES_BASE_PATH)#g" \
		-e "s#@NEWS@#$(NEWS)#g" \
		-e "s#@README@#$(README)#g" \
		$@.in > $@

configure_flags_common = \
	--libdir=/$(LIBDIR) \
	--libexecdir=/usr/libexec \
	--enable-test-print-backend

configure_flags_deb = \
	--enable-broadway-backend \
	--enable-x11-backend \
	--enable-gtk-doc \
	--enable-man \
	--enable-shared \
	--enable-introspection \
	--enable-cloudprint \
	--disable-static \
	--enable-installed-tests

ifeq (,$(filter stage1,$(DEB_BUILD_PROFILES)))
configure_flags_deb += --enable-colord
else
configure_flags_deb += --disable-colord
endif

ifeq (linux,$(DEB_HOST_ARCH_OS))
configure_flags_deb += --enable-wayland-backend
else
configure_flags_deb += --disable-wayland-backend
endif

ifeq ($(filter %-doc,$(built_binaries)),)
configure_flags_deb += --disable-gtk-doc --disable-man
endif

configure_flags_udeb = \
	--disable-broadway-backend \
	--disable-wayland-backend \
	--enable-x11-backend \
	--disable-introspection \
	--disable-cloudprint \
	--disable-colord \
	--disable-xcomposite \
	--disable-xdamage \
	--disable-xfixes \
	--disable-xrandr

%:
	dh $@ --with gir

override_dh_clean: debian/control
	# gross kludge to force control generation with the %.in target
	touch debian/control.in
	rm -f $(call dh_subst_files,$(all_binaries))
	rm -f testsuite/reftests/*.ui.known_fail
	rm -rf debian/build debian/install
	# The build system does not automatically update the GResource files
	# when resources change. Force an update in case we ship a patch which
	# modifies the theme CSS files.
	rm -f gtk/gtkresources.c gtk/gtkresources.h
	dh_clean

# Add dependencies to generate files from the debian/*.in ones
override_dh_auto_build: $(call dh_subst_files,$(all_binaries))

override_dh_autoreconf:
	NOCONFIGURE=true dh_autoreconf ./autogen.sh

override_dh_auto_configure: debian/control
	dh_auto_configure \
		--builddirectory=debian/build/deb \
		-- \
		$(configure_flags_common) \
		$(configure_flags_deb) \
		$(NULL)
ifneq ($(filter %-udeb,$(built_binaries)),)
	dh_auto_configure \
		--builddirectory=debian/build/udeb \
		-- \
		$(configure_flags_common) \
		$(configure_flags_udeb) \
		$(NULL)
endif

override_dh_auto_build:
	dh_auto_build --builddirectory=debian/build/deb
ifneq ($(filter %-udeb,$(built_binaries)),)
	dh_auto_build --builddirectory=debian/build/udeb
endif

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# Mark reftests with known failures as non-fatal
	touch testsuite/reftests/symbolic-icon-translucent-color.ui.known_fail
	# So that gsettings can find the (uninstalled) gtk schemas
	mkdir -p debian/build/glib-2.0/schemas/
	cp gtk/org.gtk.* debian/build/glib-2.0/schemas/
	glib-compile-schemas debian/build/glib-2.0/schemas/
	# Remove LD_PRELOAD so we don't run with fakeroot, which makes dbus-related tests fail
	env -u LD_PRELOAD xvfb-run -a dh_auto_test --builddirectory=debian/build/deb -- -k check -j1
endif

override_dh_auto_install:
	dh_auto_install --builddirectory=debian/build/deb --destdir=debian/install/deb
	rm -v -f debian/install/deb/usr/libexec/installed-tests/gtk+/reftests/libreftest.la
ifneq ($(filter %-udeb,$(built_binaries)),)
	dh_auto_install --builddirectory=debian/build/udeb --destdir=debian/install/udeb
endif

override_dh_install:
	dh_install -p$(UDEB_PKG) --sourcedir=debian/install/udeb
	dh_install --remaining-packages --sourcedir=debian/install/deb

override_dh_missing:
	dh_missing --sourcedir=debian/install/udeb --list-missing -X.la
	dh_missing --sourcedir=debian/install/deb --list-missing -X.la

override_dh_installchangelogs:
	dh_installchangelogs -XChangeLog

override_dh_installdocs:
	dh_installdocs -p$(COMMON_PKG) AUTHORS README NEWS
	dh_installdocs -p$(DOC_PKG) AUTHORS -X.in
	dh_installdocs --remaining-packages -A AUTHORS

override_dh_makeshlibs:
	dh_makeshlibs -p$(SHARED_PKG) -V --add-udeb=$(UDEB_PKG) -X$(MODULES_BASE_PATH) -- -c4
	dh_makeshlibs -plibgail-3-0 -V -- -c4
	dh_makeshlibs --remaining-packages -X$(MODULES_BASE_PATH)