2014-01-09 00:46:47 +01:00
{ stdenv , fetchurl , pythonPackages , intltool , libxml2Python , curl ,
2013-10-16 01:51:58 +02:00
python , makeWrapper , virtinst , pyGtkGlade , pythonDBus , gnome_python , gtkvnc , vte } :
2012-05-06 21:25:01 +02:00
2012-07-21 01:27:24 +02:00
with stdenv . lib ;
2012-05-06 21:25:01 +02:00
2014-01-10 18:54:57 +01:00
let version = " 0 . 9 . 5 " ; in
2012-07-21 01:27:24 +02:00
stdenv . mkDerivation rec {
name = " v i r t - m a n a g e r - ${ version } " ;
src = fetchurl {
2012-05-06 21:25:01 +02:00
url = " h t t p : / / v i r t - m a n a g e r . e t . r e d h a t . c o m / d o w n l o a d / s o u r c e s / v i r t - m a n a g e r / v i r t - m a n a g e r - ${ version } . t a r . g z " ;
2014-01-10 18:54:57 +01:00
sha256 = " 0 g c 0 6 c d b q 6 c 2 a 0 6 l 9 3 9 5 1 6 l v j i i 7 l r 0 w n g 9 0 k q g l 1 i 5 q 5 w l g n a j x " ;
2012-05-06 21:25:01 +02:00
} ;
2012-07-21 01:27:24 +02:00
pythonPath = with pythonPackages ;
[ setuptools eventlet greenlet gflags netaddr sqlalchemy carrot routes
paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate
distutils_extra simplejson readline glance cheetah lockfile httplib2
# !!! should libvirt be a build-time dependency? Note that
2014-01-09 00:46:47 +01:00
# libxml2Python is a dependency of libvirt.py.
2013-10-16 01:51:58 +02:00
libvirt libxml2Python urlgrabber virtinst pyGtkGlade pythonDBus gnome_python
gtkvnc vte
2012-07-21 01:27:24 +02:00
] ;
buildInputs =
2014-01-09 00:46:47 +01:00
[ pythonPackages . python
2012-07-21 01:27:24 +02:00
pythonPackages . wrapPython
pythonPackages . mox
pythonPackages . urlgrabber
intltool
pyGtkGlade
pythonDBus
gnome_python
gtkvnc
] ++ pythonPath ;
buildPhase = " m a k e " ;
2014-01-09 00:46:47 +01:00
2012-12-28 19:20:09 +01:00
nativeBuildInputs = [ makeWrapper pythonPackages . wrapPython ] ;
2012-05-06 21:25:01 +02:00
2012-07-21 01:27:24 +02:00
# patch the runner script in order to make wrapPythonPrograms work and run the program using a syscall
# example code: /etc/nixos/nixpkgs/pkgs/development/interpreters/spidermonkey/1.8.0-rc1.nix
customRunner = ./custom_runner.py ;
2012-05-06 21:25:01 +02:00
2012-07-21 01:27:24 +02:00
# TODO
# virt-manager -> import gtk.glade -> No module named glade --> fixed by removing 'pygtk' and by only using pyGtkGlade
# -> import gconf -> ImportError: No module named gconf
# -> pfad um gtk-2.0 erweitern in virt-manger runner -> /nix/store/hnyxc9i4yz2mc42n44ms13mn8n486s5h-gnome-python-2.28.1/lib/python2.7/site-packages/gtk-2.0
# -> Error starting Virtual Machine Manager: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details - 1: GetIOR failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.GConf was not provided by any .service files)
2012-05-06 21:25:01 +02:00
2012-07-21 01:27:24 +02:00
#Traceback (most recent call last):
# File "/nix/store/y9rcdiv6686sqcv4r39p575s37jzc2cz-virt-manager-0.9.1/share/virt-manager/virt-manager.py", line 383, in <module>
# main()
# File "/nix/store/y9rcdiv6686sqcv4r39p575s37jzc2cz-virt-manager-0.9.1/share/virt-manager/virt-manager.py", line 315, in main
# config = virtManager.config.vmmConfig(appname, appversion, glade_dir)
# File "/nix/store/y9rcdiv6686sqcv4r39p575s37jzc2cz-virt-manager-0.9.1/share/virt-manager/virtManager/config.py", line 98, in __init__
# self.conf.add_dir(self.conf_dir, gconf.CLIENT_PRELOAD_NONE)
#GError: Failed to contact configuration server; the most common cause is a missing or misconfigured D-Bus session bus daemon. See http://projects.gnome.org/gconf/ for information. (Details - 1: GetIOR failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.GConf was not provided by any .service files)
# -> fixed by http://nixos.org/wiki/Solve_GConf_errors_when_running_GNOME_applications & a restart
# virt-manager-tui -> ImportError: No module named newt_syrup.dialogscreen
2012-05-06 21:25:01 +02:00
2012-07-21 01:27:24 +02:00
patchPhase = ''
cat $ { customRunner } > src/virt-manager.in
substituteInPlace " s r c / v i r t - m a n a g e r . i n " - - replace " T H E _ C U S T O M _ P A T H " " $ o u t "
substituteInPlace " s r c / v i r t - m a n a g e r . i n " - - replace " T H E _ C U S T O M _ P R O G R A M " " v i r t - m a n a g e r "
substituteInPlace " s r c / v i r t - m a n a g e r . i n " - - replace " P Y T H O N _ E X E C U T A B L E _ P A T H " " ${ python } / b i n / p y t h o n "
cat $ { customRunner } > src/virt-manager-tui.in
substituteInPlace " s r c / v i r t - m a n a g e r - t u i . i n " - - replace " T H E _ C U S T O M _ P A T H " " $ o u t "
substituteInPlace " s r c / v i r t - m a n a g e r - t u i . i n " - - replace " T H E _ C U S T O M _ P R O G R A M " " v i r t - m a n a g e r - t u i "
substituteInPlace " s r c / v i r t - m a n a g e r - t u i . i n " - - replace " P Y T H O N _ E X E C U T A B L E _ P A T H " " ${ python } / b i n / p y t h o n "
'' ;
# /etc/nixos/nixpkgs/pkgs/development/python-modules/generic/wrap.sh
installPhase = ''
make install
wrapPythonPrograms
'' ;
2012-05-06 21:25:01 +02:00
meta = {
homepage = http://virt-manager.org ;
2013-10-06 11:49:53 +02:00
description = " D e s k t o p u s e r i n t e r f a c e f o r m a n a g i n g v i r t u a l m a c h i n e s " ;
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 ) .
'' ;
2012-07-21 01:27:24 +02:00
license = " G P L v 2 " ;
maintainers = with stdenv . lib . maintainers ; [ qknight ] ;
2012-05-06 21:25:01 +02:00
} ;
2012-07-21 01:27:24 +02:00
}