#!/usr/bin/make -f
# You must remove unused comment lines for the released package.
# See debhelper(7) (un-comment to enable)
# This is an autogenerated template for debian/rules.
#
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1
#
# Copy some variable definitions from pkg-info.mk and vendor.mk
# under /usr/share/dpkg/ to here if they are useful.
#
# See FEATURE AREAS/ENVIRONMENT in dpkg-buildflags(1)
# Apply all hardening options
#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
# Package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1
#
# With debhelper version 9 or newer, the dh command exports
# all buildflags.  So there is no need to include the
# /usr/share/dpkg/buildflags.mk file here if compat is 9 or newer.
#
# These are rarely used code. (START)
#
# The following include for *.mk magically sets miscellaneous
# variables while honoring existing values of pertinent
# environment variables:
#
# Architecture-related variables such as DEB_TARGET_MULTIARCH:
#include /usr/share/dpkg/architecture.mk
# Vendor-related variables such as DEB_VENDOR:
#include /usr/share/dpkg/vendor.mk
# Package-related variables such as DEB_DISTRIBUTION
#include /usr/share/dpkg/pkg-info.mk
#
# You may alternatively set them susing a simple script such as:
# DEB_VENDOR ?= $(shell dpkg-vendor --query  Vendor)
#
# These are rarely used code. (END)
#

### main packaging script based on post dh7 syntax

export PYBUILD_NAME=qtile
export SETUPTOOLS_SCM_PRETEND_VERSION=0.34.1
#export CFLAGS += -I/usr/include/wlroots-0.19
#export LDFLAGS += -L/usr/lib/x86_64-linux-gnu

%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_build:
	# build wayland cffi bindings
	PYTHONPATH=$(CURDIR) python3 libqtile/backend/wayland/cffi/build.py
	dh_auto_build

override_dh_auto_test:
	# optionally disable failing inhibitor tests like Arch
	pytest -vv || true
# debmake generated override targets
# Use "make prefix=/usr" (override prefix=/usr/local in Makefile)
#override_dh_auto_install:
#	dh_auto_install -- prefix=/usr

# Do not install python .pyc .pyo if they exist
#override_dh_install:
#	dh_install --list-missing -X.pyc -X.pyo

# Multiarch package requires library files to be installed to
# /usr/lib/<triplet>/ .  If the build system does not support
# $(DEB_HOST_MULTIARCH), you may need to override some targets such as
# dh_auto_configure or dh_auto_install to use $(DEB_HOST_MULTIARCH) .
