forked from jeffreywildman/homebrew-virt-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
virt-manager.rb
110 lines (93 loc) · 3.71 KB
/
virt-manager.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
class VirtManager < Formula
include Language::Python::Virtualenv
desc "App for managing virtual machines"
homepage "https://virt-manager.org/"
url "https://virt-manager.org/download/sources/virt-manager/virt-manager-2.2.1.tar.gz"
sha256 "cfd88d66e834513e067b4d3501217e21352fadb673103bacb9e646da9f029a1b"
revision 3
depends_on "intltool" => :build
depends_on "pkg-config" => :build
depends_on "adwaita-icon-theme"
depends_on "gtk+3"
depends_on "gtk-vnc"
depends_on "gtksourceview4"
depends_on "hicolor-icon-theme"
depends_on "libosinfo"
depends_on "libvirt"
depends_on "libvirt-glib"
depends_on "libxml2" # need python3 bindings
depends_on "osinfo-db"
depends_on "py3cairo"
depends_on "pygobject3"
depends_on "python"
depends_on "spice-gtk"
depends_on "vte3"
resource "libvirt-python" do
url "https://libvirt.org/sources/python/libvirt-python-5.10.0.tar.gz"
sha256 "d204700b3421c8decdcd73c6d12980423c3d6171fc1437ba49470c2c60ebb45a"
end
resource "idna" do
url "https://pypi.io/packages/source/i/idna/idna-2.8.tar.gz"
sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
end
resource "certifi" do
url "https://pypi.io/packages/source/c/certifi/certifi-2019.11.28.tar.gz"
sha256 "25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f"
end
resource "chardet" do
url "https://pypi.io/packages/source/c/chardet/chardet-3.0.4.tar.gz"
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
end
resource "urllib3" do
url "https://pypi.io/packages/source/u/urllib3/urllib3-1.25.7.tar.gz"
sha256 "f3c5fd51747d450d4dcf6f923c81f78f811aab8205fda64b0aba34a4e48b0745"
end
resource "requests" do
url "https://pypi.io/packages/source/r/requests/requests-2.22.0.tar.gz"
sha256 "11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4"
end
# virt-manager doesn't prompt for password on macOS unless --no-fork flag is provided
patch :DATA
def install
venv = virtualenv_create(libexec, "python3")
venv.pip_install resources
# virt-manager uses distutils, doesn't like --single-version-externally-managed
system "#{libexec}/bin/python", "setup.py",
"configure",
"--prefix=#{libexec}"
system "#{libexec}/bin/python", "setup.py",
"--no-user-cfg",
"--no-update-icon-cache",
"--no-compile-schemas",
"install"
# install virt-manager commands with PATH set to Python virtualenv environment
bin.install Dir[libexec/"bin/virt-*"]
bin.env_script_all_files(libexec/"bin", :PATH => "#{libexec}/bin:$PATH")
share.install Dir[libexec/"share/man"]
share.install Dir[libexec/"share/glib-2.0"]
share.install Dir[libexec/"share/icons"]
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"
end
test do
system "#{bin}/virt-manager", "--version"
end
end
__END__
diff --git a/virt-manager b/virt-manager
index 15d5109..8ee305a 100755
--- a/virt-manager
+++ b/virt-manager
@@ -151,7 +151,8 @@ def parse_commandline():
help="Print debug output to stdout (implies --no-fork)",
default=False)
parser.add_argument("--no-fork", action="store_true",
- help="Don't fork into background on startup")
+ help="Don't fork into background on startup",
+ default=True)
parser.add_argument("--show-domain-creator", action="store_true",
help="Show 'New VM' wizard")