#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_configure:
	true

override_dh_auto_build:
	true

override_dh_auto_install:
	true

override_dh_install:
	dh_install
	perl -p -i -e 's{#!/usr/bin/env python$$}{#!/usr/bin/python3}' debian/meshroom/usr/bin/*
# don't install pycache
	find debian/meshroom -name __pycache__ -exec rm -r '{}' +
# No executables in /usr/lib
	find debian/meshroom/usr/lib -type f | xargs chmod a-x

# This test eats up all my memory and makes my computer crash
TESTS_EXCLUDE := \
  tests/test_nodeAttributeChangedCallback.py

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(foreach f,$(filter-out $(TESTS_EXCLUDE),$(wildcard tests/test*.py)), pytest $f &&) true
endif
