#!/usr/bin/make -f

# SPDX-License-Identifier: MIT
# Copyright (c) 2026 Chris <goabonga@pm.me>

export DH_VIRTUALENV_INSTALL_ROOT=/opt/venvs

%:
	dh $@ --with python-virtualenv

# The Launchpad builders have no network access, so nothing may be fetched
# here: every wheel the application needs — its own included — travels in
# the source package under wheels/ and is installed from there.
#
# --skip-install because pip would otherwise build the project from source,
# which needs the build backend and its dependencies online; the wheel in
# wheels/ is already built and is listed in the requirements instead.
# --builtin-venv: without it dh_virtualenv shells out to the `virtualenv`
# command, which is not in the build chroot and is not what Build-Depends
# asks for. This uses `python3 -m venv` from python3-venv instead.
override_dh_virtualenv:
	dh_virtualenv \
	    --builtin-venv \
	    --python /usr/bin/python3 \
	    --skip-install \
	    --requirements debian/requirements.txt \
	    --extra-pip-arg --no-index \
	    --extra-pip-arg --find-links=$(CURDIR)/wheels

override_dh_installsystemd:
	# The application is a terminal program: nothing to run as a service.
