#!/usr/bin/make -f
# Build sshpilot with Meson, the upstream build system. Meson installs the
# launcher, the Python package, the compiled GResource, the desktop entry and
# AppStream metainfo (merged from the .in templates), the icon and
# sshpilot-agent, so none of that is replayed by hand here.

#export DH_VERBOSE = 1

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

# dh_auto_test runs `meson test`, i.e. the desktop-entry and AppStream
# validators. The upstream pytest suite is a GUI/integration suite needing a
# display and optional backends, and Meson does not run it, so no override is
# needed here any more.

# Use the system xterm.js from libjs-xterm rather than the bundled copy: drop
# the bundled assets from the binary package (the app resolves the system
# /usr/share/javascript/xterm at runtime). Runs after dh_python3 has finalised
# the dist-packages layout so the path is stable. Keeps the .deb free of
# embedded JavaScript.
execute_after_dh_python3:
	rm -rf debian/sshpilot/usr/lib/python3*/dist-packages/sshpilot/vendor/pyxtermjs/xterm
