homebrew-virt-manager/virt-manager.rb

132 lines
3.9 KiB
Ruby
Raw Normal View History

2014-12-23 03:33:45 +00:00
class VirtManager < Formula
desc "App for managing virtual machines"
2015-04-03 01:26:05 +00:00
homepage "https://virt-manager.org/"
2016-01-12 16:21:33 +00:00
url "https://fedorahosted.org/released/virt-manager/virt-manager-1.3.2.tar.gz"
sha256 "270c1f631fd029fee5291e83f50d69e261db666aa952c184643bc6cece77fdb3"
2014-12-23 03:33:45 +00:00
depends_on "intltool" => :build
depends_on "pkg-config" => :build
2015-04-03 00:40:06 +00:00
depends_on "d-bus"
depends_on "gnome-icon-theme"
2014-12-23 03:33:45 +00:00
depends_on "gtk+3"
depends_on "gtk-vnc"
depends_on "hicolor-icon-theme"
depends_on "libosinfo"
depends_on "libvirt"
2014-12-23 03:33:45 +00:00
depends_on "libvirt-glib"
2015-04-03 00:40:06 +00:00
depends_on "libxml2" => "with-python"
depends_on "pygobject3"
depends_on "spice-gtk"
2014-12-23 03:33:45 +00:00
depends_on "vte3"
2015-04-03 00:40:06 +00:00
depends_on :x11
2015-01-16 06:40:03 +00:00
# TODO: audio
2014-12-23 03:33:45 +00:00
resource "libvirt-python" do
url "https://libvirt.org/sources/python/libvirt-python-1.3.1.tar.gz"
sha256 "7143b922a9bd66a5e199b13316fa4266cbffc23db01c99bce37216a1eb9118f7"
2014-12-23 03:33:45 +00:00
end
2015-11-25 23:24:56 +00:00
resource "requests" do
2016-02-04 00:28:26 +00:00
url "https://pypi.python.org/packages/source/r/requests/requests-2.9.1.tar.gz"
sha256 "c577815dd00f1394203fc44eb979724b098f88264a9ef898ee45b8e5e9cf587f"
2014-12-23 03:33:45 +00:00
end
resource "ipaddr" do
url "https://pypi.python.org/packages/source/i/ipaddr/ipaddr-2.1.11.tar.gz"
2015-04-03 17:23:58 +00:00
sha256 "1b555b8a8800134fdafe32b7d0cb52f5bdbfdd093707c3dd484c5ea59f1d98b7"
2014-12-23 03:33:45 +00:00
end
patch :DATA # fix shebangs
2014-12-23 03:33:45 +00:00
def install
2015-06-08 20:31:49 +00:00
# update location of cpu_map.xml
# https://github.com/jeffreywildman/homebrew-virt-manager/issues/15
inreplace "virtinst/capabilities.py", "/usr/share/libvirt/cpu_map.xml", "#{HOMEBREW_PREFIX}/share/libvirt/cpu_map.xml"
2014-12-23 03:33:45 +00:00
ENV.prepend_create_path "PYTHONPATH", "#{libexec}/vendor/lib/python2.7/site-packages"
2015-11-25 23:24:56 +00:00
%w[libvirt-python requests ipaddr].each do |r|
2014-12-23 03:33:45 +00:00
resource(r).stage { system "python", *Language::Python.setup_install_args(libexec/"vendor") }
end
2015-10-26 22:26:38 +00:00
ENV.prepend_path "PYTHONPATH", "#{Formula["libxml2"].opt_lib}/python2.7/site-packages"
2014-12-23 03:33:45 +00:00
system "python", "setup.py",
"configure",
"--prefix=#{libexec}"
system "python", "setup.py",
2015-11-25 23:24:56 +00:00
"--no-user-cfg",
"--no-update-icon-cache",
"--no-compile-schemas",
2014-12-23 03:33:45 +00:00
"install",
"--prefix=#{libexec}"
bin.install Dir[libexec/"bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
# install and link schemas
share.install Dir[libexec/"share/glib-2.0"]
# install and link icons
share.install Dir[libexec/"share/icons"]
2014-12-23 03:33:45 +00:00
end
def post_install
# manual schema compile step
system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
# manual icon cache update step
system "#{Formula["gtk+3"].opt_bin}/gtk3-update-icon-cache", "#{HOMEBREW_PREFIX}/share/icons/hicolor"
2014-12-23 03:33:45 +00:00
end
end
__END__
diff --git a/virt-clone b/virt-clone
index 4bd5ca3..6b4b9e5 100755
--- a/virt-clone
+++ b/virt-clone
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
2015-10-26 22:26:38 +00:00
+#!/usr/bin/env python -tt
2014-12-23 03:33:45 +00:00
#
# Copyright(c) FUJITSU Limited 2007.
#
diff --git a/virt-convert b/virt-convert
index a7f9a97..2f1ca7a 100755
--- a/virt-convert
+++ b/virt-convert
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
2015-10-26 22:26:38 +00:00
+#!/usr/bin/env python -tt
2014-12-23 03:33:45 +00:00
#
# Copyright 2008, 2013, 2014 Red Hat, Inc.
# Joey Boggs <jboggs@redhat.com>
diff --git a/virt-install b/virt-install
index 45607fb..4f9cf9e 100755
--- a/virt-install
+++ b/virt-install
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
2015-10-26 22:26:38 +00:00
+#!/usr/bin/env python -tt
2014-12-23 03:33:45 +00:00
#
# Copyright 2005-2014 Red Hat, Inc.
#
diff --git a/virt-manager b/virt-manager
index d352b90..5fccceb 100755
--- a/virt-manager
+++ b/virt-manager
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
2015-10-26 22:26:38 +00:00
+#!/usr/bin/env python -tt
2014-12-23 03:33:45 +00:00
#
# Copyright (C) 2006, 2014 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
diff --git a/virt-xml b/virt-xml
index 4e0848c..eb40bfa 100755
--- a/virt-xml
+++ b/virt-xml
@@ -1,4 +1,4 @@
-#!/usr/bin/python2 -tt
2015-10-26 22:26:38 +00:00
+#!/usr/bin/env python -tt
2014-12-23 03:33:45 +00:00
#
# Copyright 2013-2014 Red Hat, Inc.
# Cole Robinson <crobinso@redhat.com>