nixpkgs/pkgs/applications/virtualization/virt-viewer/default.nix
2022-02-16 01:22:19 -05:00

97 lines
1.6 KiB
Nix

{ lib
, stdenv
, bash-completion
, fetchurl
, gdbm ? null
, glib
, gsettings-desktop-schemas
, gtk-vnc
, gtk3
, intltool
, libcap ? null
, libgovirt
, libvirt
, libvirt-glib
, libxml2
, meson
, ninja
, pkg-config
, python3
, shared-mime-info
, spice-gtk ? null
, spice-protocol ? null
, spiceSupport ? true
, vte
, wrapGAppsHook
}:
assert spiceSupport -> (
gdbm != null
&& libcap != null
&& spice-gtk != null
&& spice-protocol != null
);
with lib;
stdenv.mkDerivation rec {
baseName = "virt-viewer";
version = "11.0";
name = "${baseName}-${version}";
src = fetchurl {
url = "http://virt-manager.org/download/sources/${baseName}/${name}.tar.xz";
sha256 = "sha256-pD+iMlxMHHelyMmAZaww7wURohrJjlkPIjQIabrZq9A=";
};
nativeBuildInputs = [
glib
intltool
meson
ninja
pkg-config
python3
shared-mime-info
wrapGAppsHook
];
buildInputs = [
bash-completion
glib
gsettings-desktop-schemas
gtk-vnc
gtk3
libgovirt
libvirt
libvirt-glib
libxml2
vte
] ++ optionals spiceSupport [
gdbm
libcap
spice-gtk
spice-protocol
];
# Required for USB redirection PolicyKit rules file
propagatedUserEnvPkgs = optional spiceSupport spice-gtk;
strictDeps = true;
postPatch = ''
patchShebangs build-aux/post_install.py
'';
meta = {
description = "A viewer for remote virtual machines";
maintainers = [ maintainers.raskin ];
platforms = platforms.linux;
license = licenses.gpl2;
};
passthru = {
updateInfo = {
downloadPage = "http://virt-manager.org/download.html";
};
};
}