2023-11-23 13:37:05 +00:00
|
|
|
{ python3
|
|
|
|
, runCommand
|
|
|
|
, setuptools
|
|
|
|
, copyDesktopItems
|
|
|
|
, pygobject3
|
|
|
|
, wrapGAppsHook
|
|
|
|
, gtk3
|
2023-11-25 01:25:49 +00:00
|
|
|
, spice-gtk
|
2023-11-23 13:37:05 +00:00
|
|
|
, gnome
|
|
|
|
, gobject-introspection
|
|
|
|
, clan-cli
|
2023-11-23 14:19:58 +00:00
|
|
|
, makeDesktopItem
|
2023-11-28 17:19:01 +00:00
|
|
|
, ipdb
|
2023-11-23 13:37:05 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
source = ./.;
|
|
|
|
in
|
|
|
|
python3.pkgs.buildPythonApplication {
|
|
|
|
name = "clan-vm-manager";
|
|
|
|
src = source;
|
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
# This prevents problems with mixed glibc versions that might occur when the
|
|
|
|
# cli is called through a browser built against another glibc
|
|
|
|
"--unset LD_LIBRARY_PATH"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
copyDesktopItems
|
|
|
|
wrapGAppsHook
|
|
|
|
gobject-introspection
|
|
|
|
];
|
|
|
|
|
2023-11-25 01:25:49 +00:00
|
|
|
buildInputs = [ spice-gtk gtk3 gnome.adwaita-icon-theme ];
|
2023-12-06 16:16:03 +00:00
|
|
|
propagatedBuildInputs = [ pygobject3 clan-cli ];
|
2023-11-23 13:37:05 +00:00
|
|
|
|
|
|
|
# also re-expose dependencies so we test them in CI
|
|
|
|
passthru.tests = {
|
|
|
|
clan-vm-manager-no-breakpoints = runCommand "clan-vm-manager-no-breakpoints" { } ''
|
|
|
|
if grep --include \*.py -Rq "breakpoint()" ${source}; then
|
|
|
|
echo "breakpoint() found in ${source}:"
|
|
|
|
grep --include \*.py -Rn "breakpoint()" ${source}
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# Don't leak python packages into a devshell.
|
|
|
|
# It can be very confusing if you `nix run` than load the cli from the devshell instead.
|
|
|
|
postFixup = ''
|
|
|
|
rm $out/nix-support/propagated-build-inputs
|
|
|
|
'';
|
|
|
|
checkPhase = ''
|
|
|
|
PYTHONPATH= $out/bin/clan-vm-manager --help
|
|
|
|
'';
|
2023-11-23 14:19:58 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "clan-vm-manager";
|
|
|
|
exec = "clan-vm-manager join %u";
|
|
|
|
desktopName = "CLan VM Manager";
|
|
|
|
startupWMClass = "clan";
|
|
|
|
mimeTypes = [ "x-scheme-handler/clan" ];
|
|
|
|
})
|
|
|
|
];
|
2023-11-23 13:37:05 +00:00
|
|
|
}
|