2022-03-30 09:31:56 +00:00
|
|
|
{ lib, fetchFromGitHub, python3, intltool, file, wrapGAppsHook, gtk-vnc
|
|
|
|
, vte, avahi, dconf, gobject-introspection, libvirt-glib, system-libvirt
|
|
|
|
, gsettings-desktop-schemas, libosinfo, gnome, gtksourceview4, docutils, cpio
|
2022-04-27 09:35:20 +00:00
|
|
|
, e2fsprogs, findutils, gzip, cdrtools, xorriso, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, spiceSupport ? true, spice-gtk ? null
|
|
|
|
}:
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "virt-manager";
|
2022-09-11 15:47:08 +00:00
|
|
|
version = "4.1.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-09-11 15:47:08 +00:00
|
|
|
hash = "sha256-UgZ58WLXq0U3EDt4311kv0kayVU17In4kwnQ+QN1E7A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
intltool file
|
|
|
|
gobject-introspection # for setup hook populating GI_TYPELIB_PATH
|
2020-10-16 20:44:37 +00:00
|
|
|
docutils
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
wrapGAppsHook
|
2021-05-20 23:08:51 +00:00
|
|
|
libvirt-glib vte dconf gtk-vnc gnome.adwaita-icon-theme avahi
|
2020-04-24 23:36:52 +00:00
|
|
|
gsettings-desktop-schemas libosinfo gtksourceview4
|
|
|
|
gobject-introspection # Temporary fix, see https://github.com/NixOS/nixpkgs/issues/56943
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ lib.optional spiceSupport spice-gtk;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-06-16 17:23:12 +00:00
|
|
|
pygobject3 libvirt libxml2 requests cdrtools
|
2021-05-29 03:34:57 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i 's|/usr/share/libvirt/cpu_map.xml|${system-libvirt}/share/libvirt/cpu_map.xml|g' virtinst/capabilities.py
|
|
|
|
sed -i "/'install_egg_info'/d" setup.py
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postConfigure = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
${python3.interpreter} setup.py configure --prefix=$out
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
setupPyGlobalFlags = [ "--no-update-icon-cache" "--no-compile-schemas" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
preFixup = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
glib-compile-schemas $out/share/gsettings-schemas/${pname}-${version}/glib-2.0/schemas
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
gappsWrapperArgs+=(--set PYTHONPATH "$PYTHONPATH")
|
|
|
|
# these are called from virt-install in initrdinject.py
|
2022-06-16 17:23:12 +00:00
|
|
|
gappsWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ cpio e2fsprogs file findutils gzip ]}")
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# Fixes testCLI0051virt_install_initrd_inject on Darwin: "cpio: root:root: invalid group"
|
|
|
|
substituteInPlace virtinst/install/installerinject.py \
|
|
|
|
--replace "'--owner=root:root'" "'--owner=0:0'"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
checkInputs = with python3.pkgs; [
|
|
|
|
pytestCheckHook
|
|
|
|
cpio
|
|
|
|
cdrtools
|
|
|
|
xorriso
|
|
|
|
];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
disabledTests = [
|
|
|
|
"testAlterDisk"
|
|
|
|
"test_misc_nonpredicatble_generate"
|
2022-09-11 15:47:08 +00:00
|
|
|
"test_disk_dir_searchable" # does something strange with permissions
|
|
|
|
"testCLI0001virt_install_many_devices" # expects /var to exist
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
2021-05-28 09:39:13 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=.
|
|
|
|
''; # <- Required for "tests/test_urldetect.py".
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
$out/bin/virt-manager --version | grep -Fw ${version} > /dev/null
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://virt-manager.org";
|
|
|
|
description = "Desktop user interface for managing virtual machines";
|
|
|
|
longDescription = ''
|
|
|
|
The virt-manager application is a desktop user interface for managing
|
|
|
|
virtual machines through libvirt. It primarily targets KVM VMs, but also
|
|
|
|
manages Xen and LXC (linux containers).
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2;
|
2022-08-12 12:06:08 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ qknight offline fpletz globin ];
|
|
|
|
};
|
|
|
|
}
|