#!/usr/bin/make -f

DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifneq ($(DEB_HOST_ARCH_OS),linux)
cmake_extra_args += -DWANT_ALSA=OFF
endif

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--no-undefined -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

export QTDIR=/usr/share/qt5
export QT_SELECT=qt5

%:
	dh $@ --buildsystem=cmake

override_dh_auto_configure:
	dh_auto_configure -- \
	-DUSE_SYSTEM_SLV2_LIBRARY=ON \
	-DWANT_MP3_ENCODE=ON \
	$(cmake_extra_args)

override_dh_install:
	dh_install debian/*.desktop usr/share/applications/
