#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Wno-error=deprecated-declarations
# Ubuntu's dpkg-buildflags adds -Wl,-Bsymbolic-functions by default and Debian's
# does not. Keep swayfx's link identical on every base. The flag only changes how
# a shared library binds its own symbols, so on this executable it is inert; the
# fault BASED-260 traced to it lives in the wlroots library build (wlroots' internal
# wlr_scene_buffer_create escaping scenefx's interposition), which our noble
# wlroots rebuild fixed by stripping the flag there. Ubuntu's own wlroots keeps it,
# so a swayfx line on an Ubuntu base needs a wlroots built without it, not this line.
export DEB_LDFLAGS_MAINT_STRIP = -Wl,-Bsymbolic-functions

%:
	dh $@

# -Dwerror=false: upstream defaults to werror and trixie's gcc 14 warns on
#   code written against older compilers.
# -Ddefault-wallpaper=false: Debian ships those images in sway-backgrounds;
#   installing them here would conflict with a package we want to stay
#   co-installable.
# --libexecdir=lib: matches src:sway so swaybar/swaynag helper paths line up.
override_dh_auto_configure:
	dh_auto_configure -- \
		--libexecdir=lib \
		-Dwerror=false \
		-Ddefault-wallpaper=false

override_dh_missing:
	dh_missing --fail-missing
