File: rules

package info (click to toggle)
sdl2-compat 2.32.64%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52,952 kB
  • sloc: ansic: 93,639; python: 1,549; sh: 563; makefile: 45; javascript: 21; cpp: 11
file content (71 lines) | stat: -rwxr-xr-x 2,386 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export SDL_AUDIODRIVER = dummy
export SDL_VIDEODRIVER = dummy

include /usr/share/dpkg/default.mk

built_binaries := $(shell dh_listpackages)
configure_options := \
	-DSDL2COMPAT_STATIC=OFF \
	-DSDL2COMPAT_VENDOR_INFO="$(DEB_VENDOR) $(DEB_VERSION)" \
	-DSDL2COMPAT_WERROR=OFF \
	$(NULL)

ifneq ($(filter nocheck,$(DEB_BUILD_OPTIONS))$(filter %-tests,$(built_binaries)),nocheck)
configure_options += -DSDL2COMPAT_TESTS=ON
else
configure_options += -DSDL2COMPAT_TESTS=OFF
endif

ifneq ($(filter %-tests,$(built_binaries)),)
configure_options += -DSDL2COMPAT_INSTALL_TESTS=ON
else
configure_options += -DSDL2COMPAT_INSTALL_TESTS=OFF
endif

%:
	dh $@ -Scmake+ninja -Bcmake-build

override_dh_auto_configure:
ifeq ($(DEB_VERSION_UPSTREAM),2.32.56+git20251029~ee7cf25+ds)
	echo release-2.32.56-63-gee7cf25 > REVISION.txt
endif
	dh_auto_configure -- $(configure_options)

# Only run testtimer as an autopkgtest on machines that we're reasonably
# sure are both fast and set up to be usable for interactive use
# (currently only x86 and 64-bit ARM).
# There is an assertion that requesting a 1ms delay does not result in
# a delay of more than 100ms, and that's not going to be reliably true
# on slow machines like riscv64 or batch-processing-oriented machines
# like s390x.
ifeq (,$(filter amd64 arm64 i386,$(DEB_HOST_ARCH)))
execute_after_dh_auto_install:
	rm -fv debian/tmp/usr/share/installed-tests/SDL2_compat/testtimer.test
endif

override_dh_strip:
	dh_strip -plibsdl2-compat-shim --no-automatic-dbgsym
	dh_strip --remaining-packages

override_dh_makeshlibs:
	dh_makeshlibs -plibsdl2-compat -n
	dh_makeshlibs --remaining-packages
	library=$$(cd debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) && ls -1 libSDL2-2.0.so.0.*) && \
	ln -fns sdl2-compat/$$library debian/libsdl2-compat-shim/usr/lib/$(DEB_HOST_MULTIARCH)/
	ln -fns sdl2-compat/libSDL2-2.0.so.0 debian/libsdl2-compat-shim/usr/lib/$(DEB_HOST_MULTIARCH)/

override_dh_shlibdeps:
	dh_shlibdeps -lusr/lib/$(DEB_HOST_MULTIARCH)/sdl2-compat

# debhelper >= 13.4 makes all of /usr/libexec executable, which is not
# quite right for installed-tests
override_dh_fixperms:
	dh_fixperms -Xusr/libexec/installed-tests
	chmod --recursive a+rX,u+w,og-w debian/*-tests/usr/libexec/installed-tests