fixed most virt-manager issues!
This commit is contained in:
parent
c6452f372c
commit
538b17a791
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/python -t
|
||||||
|
# this script was written to use /etc/nixos/nixpkgs/pkgs/development/python-modules/generic/wrap.sh
|
||||||
|
# which already automates python executable wrapping by extending the PATH/pythonPath
|
||||||
|
|
||||||
|
# from http://docs.python.org/library/subprocess.html
|
||||||
|
# Warning Invoking the system shell with shell=True can be a security hazard if combined with untrusted input. See the warning under Frequently Used Arguments for details.
|
||||||
|
|
||||||
|
from subprocess import Popen, PIPE, STDOUT
|
||||||
|
|
||||||
|
cmd = 'PYTHON_EXECUTABLE_PATH -t THE_CUSTOM_PATH/share/virt-manager/THE_CUSTOM_PROGRAM.py'
|
||||||
|
p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||||
|
output = p.stdout.read()
|
||||||
|
print output
|
@ -1,70 +1,85 @@
|
|||||||
x@{builderDefsPackage
|
{ stdenv, fetchurl, pythonPackages, intltool, libvirt, libxml2Python, curl, python, makeWrapper, virtinst, pyGtkGlade, pythonDBus, gnome_python, gtkvnc}:
|
||||||
, gnome, gtk, glib, libxml2, libvirt, gtkvnc, cyrus_sasl, libtasn1, makeWrapper
|
|
||||||
, intltool, python, pygtk, libxml2Python
|
|
||||||
# virtinst is required, but it breaks when building
|
|
||||||
, ...}:
|
|
||||||
builderDefsPackage
|
|
||||||
(a :
|
|
||||||
let
|
|
||||||
helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
|
|
||||||
["gnome"];
|
|
||||||
|
|
||||||
buildInputs = (map (n: builtins.getAttr n x)
|
with stdenv.lib;
|
||||||
(builtins.attrNames (builtins.removeAttrs x helperArgNames)))
|
|
||||||
++ [gnome.libglade intltool python libvirt];
|
|
||||||
sourceInfo = rec {
|
|
||||||
baseName="virt-manager";
|
|
||||||
|
|
||||||
version = "0.9.1";
|
let version = "0.9.1"; in
|
||||||
name = "virt-manager-${version}";
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
name = "virt-manager-${version}";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
url = "http://virt-manager.et.redhat.com/download/sources/virt-manager/virt-manager-${version}.tar.gz";
|
url = "http://virt-manager.et.redhat.com/download/sources/virt-manager/virt-manager-${version}.tar.gz";
|
||||||
hash = "15e064167ba5ff84ce6fc8790081d61890430f2967f89886a84095a23e40094a";
|
sha256 = "15e064167ba5ff84ce6fc8790081d61890430f2967f89886a84095a23e40094a";
|
||||||
};
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
src = a.fetchurl {
|
|
||||||
url = sourceInfo.url;
|
|
||||||
sha256 = sourceInfo.hash;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
patchPhase = a.fullDepEntry ''
|
pythonPath = with pythonPackages;
|
||||||
substituteInPlace "src/virt-manager.in" --replace "exec /usr/bin/python" "exec ${python}/bin/python"
|
[ setuptools eventlet greenlet gflags netaddr sqlalchemy carrot routes
|
||||||
sed -e '/import libxml2/i import sys\
|
paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate
|
||||||
sys.path.append("${libxml2Python}/lib/${python.libPrefix}/site-packages")' \
|
distutils_extra simplejson readline glance cheetah lockfile httplib2
|
||||||
-i src/virtManager/util.py
|
# !!! should libvirt be a build-time dependency? Note that
|
||||||
sed -e '/import libxml2/i import sys\
|
# libxml2Python is a dependency of libvirt.py.
|
||||||
sys.path.append("${libxml2Python}/lib/${python.libPrefix}/site-packages")' \
|
libvirt libxml2Python urlgrabber virtinst pyGtkGlade pythonDBus gnome_python gtkvnc
|
||||||
-i src/virtManager/libvirtobject.py
|
];
|
||||||
'' ["minInit"];
|
|
||||||
|
|
||||||
inherit (sourceInfo) name version;
|
buildInputs =
|
||||||
inherit buildInputs;
|
[ pythonPackages.python
|
||||||
|
pythonPackages.wrapPython
|
||||||
|
pythonPackages.mox
|
||||||
|
pythonPackages.urlgrabber
|
||||||
|
intltool
|
||||||
|
pyGtkGlade
|
||||||
|
pythonDBus
|
||||||
|
gnome_python
|
||||||
|
gtkvnc
|
||||||
|
] ++ pythonPath;
|
||||||
|
|
||||||
/* doConfigure should be removed if not needed */
|
buildPhase = "make";
|
||||||
phaseNames = [ "doUnpack" "patchPhase" "doConfigure" "doMakeInstall" "installPhase" ];
|
|
||||||
|
buildNativeInputs = [ makeWrapper pythonPackages.wrapPython ];
|
||||||
|
|
||||||
installPhase = a.fullDepEntry ''
|
# patch the runner script in order to make wrapPythonPrograms work and run the program using a syscall
|
||||||
wrapProgram $out/bin/virt-manager --set PYTHONPATH $PYTHONPATH
|
# example code: /etc/nixos/nixpkgs/pkgs/development/interpreters/spidermonkey/1.8.0-rc1.nix
|
||||||
'' ["minInit"];
|
customRunner = ./custom_runner.py;
|
||||||
|
|
||||||
#NIX_CFLAGS_COMPILE = "-fno-stack-protector";
|
# 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)
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
patchPhase = ''
|
||||||
|
cat ${customRunner} > src/virt-manager.in
|
||||||
|
substituteInPlace "src/virt-manager.in" --replace "THE_CUSTOM_PATH" "$out"
|
||||||
|
substituteInPlace "src/virt-manager.in" --replace "THE_CUSTOM_PROGRAM" "virt-manager"
|
||||||
|
substituteInPlace "src/virt-manager.in" --replace "PYTHON_EXECUTABLE_PATH" "${python}/bin/python"
|
||||||
|
|
||||||
|
cat ${customRunner} > src/virt-manager-tui.in
|
||||||
|
substituteInPlace "src/virt-manager-tui.in" --replace "THE_CUSTOM_PATH" "$out"
|
||||||
|
substituteInPlace "src/virt-manager-tui.in" --replace "THE_CUSTOM_PROGRAM" "virt-manager-tui"
|
||||||
|
substituteInPlace "src/virt-manager-tui.in" --replace "PYTHON_EXECUTABLE_PATH" "${python}/bin/python"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# /etc/nixos/nixpkgs/pkgs/development/python-modules/generic/wrap.sh
|
||||||
|
installPhase = ''
|
||||||
|
make install
|
||||||
|
wrapPythonPrograms
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://virt-manager.org;
|
homepage = http://virt-manager.org;
|
||||||
description = "The 'Virtual Machine Manager' application (virt-manager for short package name) is a desktop user interface for managing virtual machines.";
|
description = "The 'Virtual Machine Manager' application (virt-manager for short package name) is a desktop user interface for managing virtual machines.";
|
||||||
|
license = "GPLv2";
|
||||||
maintainers = with a.lib.maintainers;
|
maintainers = with stdenv.lib.maintainers; [qknight];
|
||||||
[
|
|
||||||
qknight
|
|
||||||
];
|
|
||||||
platforms = with a.lib.platforms;
|
|
||||||
linux;
|
|
||||||
license = a.lib.licenses.gpl2;
|
|
||||||
};
|
};
|
||||||
passthru = {
|
}
|
||||||
updateInfo = {
|
|
||||||
downloadPage = "http://virt-manager.org/download.html";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}) x
|
|
||||||
|
|
||||||
|
@ -30,19 +30,11 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
buildPhase = "python setup.py build";
|
buildPhase = "python setup.py build";
|
||||||
|
|
||||||
PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
|
|
||||||
|
|
||||||
# substituteInPlace nova/api/ec2/cloud.py \
|
|
||||||
# --replace 'sh genrootca.sh' $out/libexec/nova/genrootca.sh
|
|
||||||
# '';
|
|
||||||
|
|
||||||
installPhase =
|
installPhase =
|
||||||
''
|
''
|
||||||
python setup.py install --prefix="$out";
|
python setup.py install --prefix="$out";
|
||||||
'';
|
'';
|
||||||
|
|
||||||
#checkPhase = "python setup.py test";
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://virt-manager.org;
|
homepage = http://virt-manager.org;
|
||||||
license = "GPLv2+";
|
license = "GPLv2+";
|
||||||
|
@ -13,9 +13,10 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
phases = "unpackPhase configurePhase buildPhase installPhase";
|
phases = "unpackPhase configurePhase buildPhase installPhase";
|
||||||
|
|
||||||
# You should be using WAF instead; see the file INSTALL.WAF
|
# WAF is probably the biggest crap on this planet, btw i removed the /gtk-2.0 path thingy
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
python waf configure --prefix=$out
|
sed -e "s@{PYTHONDIR}/gtk-2.0@{PYTHONDIR}/@" -i gconf/wscript
|
||||||
|
python waf configure --prefix=$out
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@ -35,4 +36,4 @@ stdenv.mkDerivation rec {
|
|||||||
description = "Python wrapper for gconf";
|
description = "Python wrapper for gconf";
|
||||||
maintainers = [ stdenv.lib.maintainers.qknight ];
|
maintainers = [ stdenv.lib.maintainers.qknight ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
gnome_mime_data = callPackage ./platform/gnome-mime-data { };
|
gnome_mime_data = callPackage ./platform/gnome-mime-data { };
|
||||||
|
|
||||||
|
gnome_python = callPackage ./bindings/gnome-python { };
|
||||||
|
|
||||||
gnome_vfs = callPackage ./platform/gnome-vfs { };
|
gnome_vfs = callPackage ./platform/gnome-vfs { };
|
||||||
|
|
||||||
gnome_vfs_monikers = callPackage ./platform/gnome-vfs-monikers { };
|
gnome_vfs_monikers = callPackage ./platform/gnome-vfs-monikers { };
|
||||||
@ -115,6 +117,4 @@
|
|||||||
|
|
||||||
libglademm = callPackage ./bindings/libglademm { };
|
libglademm = callPackage ./bindings/libglademm { };
|
||||||
|
|
||||||
gnome_python = callPackage ./bindings/gnome-python { };
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7609,7 +7609,10 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
virtviewer = callPackage ../applications/virtualization/virt-viewer {};
|
virtviewer = callPackage ../applications/virtualization/virt-viewer {};
|
||||||
virtmanager = callPackage ../applications/virtualization/virt-manager {};
|
virtmanager = callPackage ../applications/virtualization/virt-manager {
|
||||||
|
inherit (gnome) gnome_python;
|
||||||
|
};
|
||||||
|
|
||||||
virtinst = callPackage ../applications/virtualization/virtinst {};
|
virtinst = callPackage ../applications/virtualization/virtinst {};
|
||||||
|
|
||||||
virtualgl = callPackage ../tools/X11/virtualgl { };
|
virtualgl = callPackage ../tools/X11/virtualgl { };
|
||||||
|
@ -2521,8 +2521,6 @@ let pythonPackages = python.modules // rec {
|
|||||||
|
|
||||||
propagatedBuildInputs = [ pycurl ];
|
propagatedBuildInputs = [ pycurl ];
|
||||||
|
|
||||||
PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "urlgrabber.baseurl.org";
|
homepage = "urlgrabber.baseurl.org";
|
||||||
license = "LGPLv2+";
|
license = "LGPLv2+";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user