#!/usr/bin/make -f

export DEB_ENABLE_TESTS = yes

# Work around GHC 9.10 NCG + LTO (lp: #2144301) with the LLVM backend, but
# only on the architectures where that bug bites (amd64, arm64).
LLVM_ARCHS = amd64 arm64
ifeq ($(filter $(DEB_HOST_ARCH),$(LLVM_ARCHS)),)
    GHC_CODEGEN_ARGS =
else
    GHC_CODEGEN_ARGS = --ghc-option=-fllvm
endif

ifeq ($(DEB_HOST_ARCH_OS),linux)
    export DEB_SETUP_GHC_CONFIGURE_ARGS += --flags="with_xft with_inotify with_mpris with_dbus with_xpm with_uvmeter with_weather with_alsa" $(GHC_CODEGEN_ARGS)
else
    export DEB_SETUP_GHC_CONFIGURE_ARGS += --flags="with_xft with_xpm" --ghc-option=-fllvm
endif

%:
	dh $@
