File: rules

package info (click to toggle)
xorg-server 2:1.19.2-1+deb9u5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 41,820 kB
  • sloc: ansic: 372,380; xml: 18,082; makefile: 3,482; objc: 3,470; sh: 813; python: 514; yacc: 483; cpp: 479; lex: 281; asm: 214; awk: 52; perl: 5
file content (298 lines) | stat: -rwxr-xr-x 9,852 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
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#!/usr/bin/make -f

ifeq ($(DEB_HOST_ARCH_OS), linux)
	selinux        = --enable-xselinux
	wayland        = --enable-xwayland
	logind         = --enable-systemd-logind
	systemd-daemon = --with-systemd-daemon
else
	selinux        = --disable-xselinux
	wayland        = --disable-xwayland
	logind         = --disable-systemd-logind
	systemd-daemon = --without-systemd-daemon
endif

ifeq ($(DEB_HOST_ARCH_OS), hurd)
	dri = --disable-dri --disable-dri2
	dri += --disable-glamor
	xshmfence = --disable-xshmfence
else
	dri = --enable-dri --enable-dri2
	dri += --enable-glamor
	xshmfence = --enable-xshmfence
endif

ifeq ($(DEB_HOST_ARCH_OS), linux)
	dri += --enable-dri3
else
	dri += --disable-dri3
endif

config_backend = --disable-config-hal
ifeq ($(DEB_HOST_ARCH_OS), linux)
	config_backend += --enable-config-udev
else ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
	config_backend += --disable-config-udev --enable-config-devd
	libs = $(shell pkg-config --libs libbsd-overlay)
	cppflags = $(shell pkg-config --cflags libbsd-overlay)
else # hurd
	config_backend += --disable-config-udev
endif

# linux: libdrm needed for kms (hw/xfree86/os-support/linux/lnx_platform.c)
#        even in udeb
# kfreebsd: libdrm for dri in main build
# hurd: no libdrm
ifeq ($(DEB_HOST_ARCH_OS), linux)
	libdrm_main = --enable-libdrm
	libdrm_udeb = --enable-libdrm
else ifeq ($(DEB_HOST_ARCH_OS), kfreebsd)
	libdrm_main = --enable-libdrm
	libdrm_udeb = --disable-libdrm
else # hurd
	libdrm_main = --disable-libdrm
	libdrm_udeb = --disable-libdrm
endif

vars = $(shell DEB_BUILD_MAINT_OPTIONS="hardening=+pie" DEB_LDFLAGS_MAINT_APPEND="-Wl,-Bsymbolic" DEB_CPPFLAGS_MAINT_APPEND="-DPRE_RELEASE=0 $(cppflags)" dpkg-buildflags --export=configure) LIBS="$(libs)"

ifneq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
	config_tests = --disable-unit-tests
else
	config_tests = --enable-unit-tests
endif

VENDOR = $(shell lsb_release -i -s)
SUPPORT = https://www.debian.org/support

SOURCE_NAME    :=  xorg-server
SOURCE_VERSION := $(shell dpkg-parsechangelog | awk -F': ' '/^Version: / {print $$2}')

# disable-static is so we don't get libfoo.a for modules.  now if only we could
# kill the .las.
confflags += \
	     --disable-silent-rules \
	     --disable-static \
	     --without-dtrace \
	     --disable-strict-compilation \
	     --disable-debug \
	     $(config_tests) \
	     --with-int10=x86emu \
	     --with-os-vendor="$(VENDOR)" \
	     --with-builderstring="$(SOURCE_NAME) $(SOURCE_VERSION) ($(SUPPORT))" \
	     --with-xkb-path=/usr/share/X11/xkb \
	     --with-xkb-output=/var/lib/xkb \
	     --with-shared-memory-dir=/dev/shm \
	     --enable-mitshm \
	     --enable-xres \
	     --disable-xcsecurity \
	     --disable-tslib \
	     --enable-dbe \
	     --disable-xf86bigfont \
	     --enable-dpms \
	     $(xshmfence) \
	     $(config_backend) \
	     --enable-xorg \
	     --disable-linux-acpi \
	     --disable-linux-apm \
	     --disable-xquartz \
	     --disable-xwin \
	     --disable-xfake \
	     --disable-xfbdev \
	     --disable-install-setuid

confflags_main = \
	--with-default-font-path="/usr/share/fonts/X11/misc,/usr/share/fonts/X11/cyrillic,/usr/share/fonts/X11/100dpi/:unscaled,/usr/share/fonts/X11/75dpi/:unscaled,/usr/share/fonts/X11/Type1,/usr/share/fonts/X11/100dpi,/usr/share/fonts/X11/75dpi,built-ins" \
	--enable-composite \
	--enable-record \
	--enable-xv \
	--enable-xvmc \
	--enable-dga \
	--enable-screensaver \
	--enable-xdmcp \
	--enable-xdm-auth-1 \
	--enable-glx \
	$(dri) \
	$(libdrm_main) \
	--enable-present \
	--enable-xinerama \
	--enable-xf86vidmode \
	--enable-xace \
	$(selinux) \
	--enable-xfree86-utils \
	$(wayland) \
	$(logind) \
	$(systemd-daemon) \
	--enable-suid-wrapper \
	--enable-dmx \
	--enable-xvfb \
	--enable-xnest \
	--enable-kdrive \
	--enable-xephyr \
	--with-sha1=libgcrypt \
	--enable-xcsecurity \
	$(void)

confflags_udeb = \
	--with-default-font-path="built-ins" \
	--disable-composite \
	--disable-record \
	--disable-xv \
	--disable-xvmc \
	--enable-dga \
	--disable-screensaver \
	--disable-xdmcp \
	--disable-xdm-auth-1 \
	--disable-glx \
	--disable-dri \
	--disable-dri2 \
	--disable-glamor \
	$(libdrm_udeb) \
	--disable-xinerama \
	--disable-xf86vidmode \
	--disable-xace \
	--disable-xselinux \
	--disable-xfree86-utils \
	--disable-xwayland \
	--disable-systemd-logind \
	--without-systemd-daemon \
	--disable-suid-wrapper \
	--disable-dmx \
	--disable-xvfb \
	--disable-xnest \
	--disable-kdrive \
	--disable-xephyr \
	--with-sha1=libnettle \
	$(void)

%:
	dh $@ --with quilt,autoreconf --parallel

build-source-stamp:
	mkdir -p build-source
	tar \
	--owner=0 --group=0 \
        --transform 's,^,xorg-server/,' \
	--exclude=debian \
	--exclude=autom4te.cache \
        -cf - * | xz > build-source/xorg-server.tar.xz
	>$@

override_dh_auto_configure:
	dh_auto_configure --builddirectory=debian/build/main -- \
		--libdir=\$${prefix}/lib \
		--libexecdir=\$${libdir}/xorg \
		$(confflags) \
		$(confflags_main) \
		$(vars)
	dh_auto_configure --builddirectory=debian/build/udeb -- \
		--libdir=\$${prefix}/lib \
		--libexecdir=\$${libdir}/xorg \
		$(confflags) \
		$(confflags_udeb) \
		$(vars)

override_dh_auto_build:
	dh_auto_build --builddirectory=debian/build/main
	dh_auto_build --builddirectory=debian/build/udeb

override_dh_auto_test:
	dh_auto_test -- -j1 VERBOSE=1

build: abibumpcheck
build-indep: build-source-stamp

override_dh_auto_install:
	dh_auto_install --builddirectory=debian/build/main \
		--destdir=debian/tmp/main
	dh_auto_install --builddirectory=debian/build/udeb \
		--destdir=debian/tmp/udeb

	# oh, yuck.
	find debian/tmp/*/usr/lib/xorg -type f -name '*.la' | \
	  xargs rm -f

	# remove modules not needed in d-i
	rm -rf debian/tmp/udeb/usr/lib/xorg/modules/multimedia
	rm -f debian/tmp/udeb/usr/lib/xorg/modules/libxaa.so
	rm -f debian/tmp/udeb/usr/lib/xorg/modules/libexa.so
	rm -f debian/tmp/udeb/usr/lib/xorg/modules/libwfb.so
	rm -f debian/tmp/udeb/usr/lib/xorg/modules/libxf8_16bpp.so

	# we don't ship these from the udeb build, needed for dh_install
	# --fail-missing
	rm -rf debian/tmp/udeb/var/lib/xkb/README.compiled
	rm -rf debian/tmp/udeb/usr/bin/X
	rm -rf debian/tmp/udeb/usr/include
	rm -rf debian/tmp/udeb/usr/share/aclocal
	rm -rf debian/tmp/udeb/usr/share/man
	rm -rf debian/tmp/udeb/usr/lib/pkgconfig

	install -m 755 debian/local/xvfb-run debian/tmp/main/usr/bin
	install debian/local/xvfb-run.1 debian/tmp/main/usr/share/man/man1
ifneq ($(DEB_HOST_ARCH_OS), linux)
	install -d debian/tmp/main/usr/share/X11/xorg.conf.d
	install -m 644 debian/local/10-*.conf debian/tmp/main/usr/share/X11/xorg.conf.d
	install -d debian/tmp/udeb/usr/share/X11/xorg.conf.d
	install -m 644 debian/local/10-*.conf debian/tmp/udeb/usr/share/X11/xorg.conf.d
endif

# Only read the first line, the rest of the file is used to determine
# when the minimal version is to be bumped:
SERVERMINVER = debian/serverminver
serverminver = $(shell head -1 $(SERVERMINVER))

.PHONY: abibumpcheck
abibumpcheck: debian/serverminver $(QUILT_STAMPFN)
	@echo Checking for the need of an ABI bump
	# Build an updated version of the file:
	head -1 $(SERVERMINVER) > $(SERVERMINVER).new
	perl -ne 'print "$$1:$$2.$$3\n" if /^#define\s+(ABI_(?:VIDEODRV|XINPUT)_VERSION)\s+SET_ABI_VERSION\(\s*(\d+)\s*,\s*(\d+)\s*\)/' hw/xfree86/common/xf86Module.h|sort >> $(SERVERMINVER).new
	# Compare both files:
	@if ! cmp --quiet $(SERVERMINVER) $(SERVERMINVER).new; then \
	echo "serverminver bump required, ABI changed!";\
	echo "When bumping major or minor, always bump required xorg-server minimum";\
	echo "version too, the newly built drivers are not backwards compatible!";\
	diff -u $(SERVERMINVER) $(SERVERMINVER).new; \
	exit 1; \
	else \
	echo "ABI unchanged"; \
	rm -f $(SERVERMINVER).new; \
	fi

override_dh_fixperms-arch:
	dh_fixperms
	chown root:root $(CURDIR)/debian/xserver-xorg-legacy/usr/lib/xorg/Xorg.wrap
	chmod ug+s $(CURDIR)/debian/xserver-xorg-legacy/usr/lib/xorg/Xorg.wrap

override_dh_install:
	dh_install --fail-missing
	install -d $(CURDIR)/debian/xserver-xorg-dev/usr/share/xserver-xorg
	# Extract only the major ABI version:
	abi_videodrv=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_videodrv xorg-server|cut -d . -f 1`; \
	echo videoabi=xorg-video-abi-$$abi_videodrv > debian/xserver-xorg-core.substvars && \
	echo "xorg-video-abi-$$abi_videodrv, xserver-xorg-core (>= $(serverminver))" > debian/xserver-xorg-dev/usr/share/xserver-xorg/videodrvdep
	abi_xinput=`PKG_CONFIG_PATH=debian/tmp/main/usr/lib/pkgconfig pkg-config --variable=abi_xinput xorg-server|cut -d . -f 1`; \
	echo inputabi=xorg-input-abi-$$abi_xinput >> debian/xserver-xorg-core.substvars && \
	echo "xorg-input-abi-$$abi_xinput, xserver-xorg-core (>= $(serverminver))" > debian/xserver-xorg-dev/usr/share/xserver-xorg/xinputdep

	# The udeb uses the same substvars:
	cp debian/xserver-xorg-core.substvars debian/xserver-xorg-core-udeb.substvars

	# save the configure flags so that packages like vnc, tightvnc, tigervnc
	# know how the package was built.
	echo 'xserver_confflags = $(confflags) $(confflags_main)' \
		> debian/xserver-xorg-dev/usr/share/xserver-xorg/configure_flags.mk

	install -m 755 -d debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core
	install -m 755 debian/xserver-xorg-core.bug.script debian/xserver-xorg-core/usr/share/bug/xserver-xorg-core/script
ifeq ($(DEB_HOST_ARCH_OS), linux)
	install -d debian/xserver-xorg-core/lib/udev/rules.d
	install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core/lib/udev/rules.d
	install -d debian/xserver-xorg-core-udeb/lib/udev/rules.d
	install -m 644 debian/local/64-xorg-xkb.rules debian/xserver-xorg-core-udeb/lib/udev/rules.d
endif

override_dh_strip:
	dh_strip -pxserver-xorg-core --dbgsym-migration="xserver-xorg-core-dbg (<< 2:1.19.0-3~)"
	dh_strip -s -Nxserver-xorg-core -Nxserver-xorg-core-dbg