Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 #export DH_VERBOSE=1
4
5 export DEB_BUILD_MAINT_OPTIONS := hardening=+all
6
7 export DEB_CFLAGS_MAINT_APPEND := -pipe -Wall
8
9 # TODO: We will need this if we re-enable MIDI playback:
10 # bug #715461, provide default soundfont paths
11 #export DEB_CPPFLAGS_MAINT_APPEND := -DMIX_INIT_SOUNDFONT_PATHS="\"/usr/share/sounds/sf3/default-GM.sf3\""
12
13 include /usr/share/dpkg/default.mk
14
15 built_binaries := $(shell dh_listpackages)
16
17 confflags :=
18 confflags += -DSDLMIXER_DEPS_SHARED=OFF
19 confflags += -DSDLMIXER_REVISION=$(DEB_VERSION_UPSTREAM_REVISION)
20 confflags += -DSDLMIXER_STRICT=ON
21 confflags += -DSDLMIXER_VENDORED=OFF
22 confflags += -DSDLMIXER_WERROR=OFF
23
24 ifneq ($(filter nocheck,$(DEB_BUILD_OPTIONS))$(filter %-tests,$(built_binaries)),nocheck)
25 confflags += -DSDLMIXER_TESTS=ON
26 endif
27
28 ifneq ($(filter %-doc,$(built_binaries)),)
29 confflags += -DSDLMIXER_INSTALL_MAN=ON
30 endif
31
32 ifneq ($(filter %-tests,$(built_binaries)),)
33 confflags += -DSDLMIXER_EXAMPLES=ON
34 confflags += -DSDLMIXER_EXAMPLES_INSTALL=ON
35 confflags += -DSDLMIXER_SAMPLES=ON
36 confflags += -DSDLMIXER_SAMPLES_INSTALL=ON
37 confflags += -DSDLMIXER_TESTS_INSTALL=ON
38 endif
39
40 # Simple built-in formats
41 confflags += -DSDLMIXER_AIFF=ON
42 confflags += -DSDLMIXER_AU=ON
43 confflags += -DSDLMIXER_VOC=ON
44 confflags += -DSDLMIXER_WAVE=ON
45
46 confflags += -DSDLMIXER_FLAC=ON
47 confflags += -DSDLMIXER_FLAC_LIBFLAC=ON
48 confflags += -DSDLMIXER_FLAC_LIBFLAC_SHARED=OFF
49 confflags += -DSDLMIXER_FLAC_DRFLAC=OFF
50
51 # gme has caused security issues in the past, so the conservative approach
52 # is to leave it switched off until someone needs it.
53 # Please open a bug if this feature is required for a particular game.
54 confflags += -DSDLMIXER_GME=OFF
55 confflags += -DSDLMIXER_GME_SHARED=OFF
56
57 # Enabling a previously disabled format is more compatible than disabling a
58 # previously enabled format, so initially turn off MIDI for the SDL3 branch.
59 # Please open a bug if this feature is required for a particular game.
60 confflags += -DSDLMIXER_MIDI=OFF
61 # Historically we enabled both fluidsynth and timidity by default, but it's
62 # not clear that it was useful to do so.
63 confflags += -DSDLMIXER_MIDI_FLUIDSYNTH=OFF
64 confflags += -DSDLMIXER_MIDI_FLUIDSYNTH_SHARED=OFF
65 confflags += -DSDLMIXER_MIDI_TIMIDITY=OFF
66
67 # Enabling a previously disabled format is more compatible than disabling a
68 # previously enabled format, so initially turn off soundtracker playback
69 # for the SDL3 branch.
70 # Please open a bug if this feature is required for a particular game.
71 confflags += -DSDLMIXER_MOD=OFF
72 confflags += -DSDLMIXER_MOD_XMP=OFF
73 confflags += -DSDLMIXER_MOD_XMP_LITE=OFF
74 confflags += -DSDLMIXER_MOD_XMP_SHARED=OFF
75
76 confflags += -DSDLMIXER_MP3=ON
77 confflags += -DSDLMIXER_MP3_DRMP3=OFF
78 confflags += -DSDLMIXER_MP3_MPG123=ON
79 confflags += -DSDLMIXER_MP3_MPG123_SHARED=OFF
80
81 confflags += -DSDLMIXER_OPUS=ON
82 confflags += -DSDLMIXER_OPUS_SHARED=OFF
83
84 confflags += -DSDLMIXER_VORBIS_STB=OFF
85 confflags += -DSDLMIXER_VORBIS_TREMOR=OFF
86 confflags += -DSDLMIXER_VORBIS_VORBISFILE=ON
87 confflags += -DSDLMIXER_VORBIS_VORBISFILE_SHARED=OFF
88
89 # Enabling a previously disabled format is more compatible than disabling a
90 # previously enabled format, so initially turn off wavpack for the SDL3
91 # branch.
92 # Please open a bug if this feature is required for a particular game.
93 confflags += -DSDLMIXER_WAVPACK=OFF
94 confflags += -DSDLMIXER_WAVPACK_DSD=OFF
95 confflags += -DSDLMIXER_WAVPACK_SHARED=OFF
96
97 %:
98 dh $@ --buildsystem=cmake -Bcmake-build
99
100 override_dh_auto_configure:
101 dh_auto_configure -- $(confflags)
102
103 # debhelper >= 13.4 makes all of /usr/libexec executable, which is not
104 # quite right for installed-tests
105 override_dh_fixperms:
106 dh_fixperms -Xusr/libexec/installed-examples -Xusr/libexec/installed-tests
107 ifneq ($(filter %-tests,$(built_binaries)),)
108 chmod --recursive --changes a+rX,u+w,og-w debian/*-tests/usr/libexec/installed-examples
109 chmod --recursive --changes a+rX,u+w,og-w debian/*-tests/usr/libexec/installed-tests
110 endif