# The guest programs the session checks need, packaged with the interpreters # they actually require. # # Separate from `test-tools.nix` because these two need things that one does # not: `hhs-ipc-watch` imports the shipped `hhstreamd.ipc` (so it needs the # package on PYTHONPATH -- it is the client under test, not a reimplementation # of it), and `hhs-pointer-target` is a Wayland client (so it needs pywayland). # # Both are self-tested at build time, for the same reason test-tools.nix does # it: a broken helper otherwise surfaces as a baffling VM failure three layers # away, long after the thing that would have explained it scrolled past. { runCommandLocal, python3, hhstream, }: let # pywayland for the Wayland client; nothing else, so an import error in the # guest is a real missing dependency and not this file being generous. waylandPython = python3.withPackages (ps: [ ps.pywayland ]); in runCommandLocal "hhstream-session-tools" { nativeBuildInputs = [ python3 ]; meta.description = "Event-socket witness and pointer target for the hhstream session checks"; } '' mkdir -p $out/bin # The event-socket subscriber runs the broker's own IPC client, so it is # pointed at what nix/package.nix installed rather than at a copy. cat > $out/bin/hhs-ipc-watch < /dev/null $out/bin/hhs-pointer-target --help > /dev/null ${waylandPython}/bin/python3 -c 'from pywayland.protocol.xdg_shell import XdgWmBase' # The target refuses to guess an app id, and the checks depend on that # refusal being exit 2 rather than a window with somebody else's class. if $out/bin/hhs-pointer-target; then echo "hhs-pointer-target started with no app id; it must refuse" >&2 exit 1 fi ''