#!/usr/bin/make -f
export DH_VERBOSE = 1
export MAKE = ninja -v
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -fPIC
export DEB_CPPFLAGS_MAINT_APPEND = -fPIC
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

%:
	dh $@ 

override_dh_auto_configure:
	mkdir build && meson --buildtype plain --prefix /usr \
	               -Ddo-post-install=false \
	               -Db_lundef=false \
	               -Dwith-player-mpv-opengl=true \
	               -Dwith-player-gstreamer-clutter=true \
	               -Dwith-player-gstreamer-cairo=true \
	               -Dwith-player-gstreamer-opengl=true . build

override_dh_auto_build:
	$(MAKE) -C build all

override_dh_auto_clean:
	rm -rf build

override_dh_auto_install:
	DESTDIR=$(CURDIR)/debian/tmp $(MAKE) -C build install
