#! /usr/bin/make -f

# Place streamlink executable in the correct place right away.
export PYBUILD_INSTALL_ARGS_python3 = --install-scripts usr/share/streamlink/

# Disable internet access
export http_proxy=127.0.0.1:9
export https_proxy=127.0.0.1:9

# Provides DEB_VERSION
include /usr/share/dpkg/pkg-info.mk

%:
	dh $@ --buildsystem=pybuild

# Add LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 to have reproducible builds
#   sphinx: some strings are localized, see #998059
#   lxml: lxml crashes when LC_ALL uses special encodings (running
#         reprotest would cause a segfault).
export LC_ALL=C.UTF-8
export LANGUAGE=C.UTF-8

override_dh_auto_install:
	PYTHONPATH=$(CURDIR)/src make --directory=docs html man
	dh_auto_install

# Explicitly uses CHANGELOG.md instead of docs/changelog.md (the default
# file used by dh_installchangelogs)
override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.md

# Needed to prevent docs/changelog.html from being compressed
override_dh_compress:
	dh_compress -X.html

# Needed to correctly include non-windows dependencies
override_dh_python3:
	dh_python3 --depends-section=':platform_system != "Windows"'
