forked from adestefan/homebrew-headonly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdfuse.rb
51 lines (41 loc) · 1.33 KB
/
vdfuse.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
class VirtualBoxInstalled < Requirement
fatal true
def self.app_path
[
"/Applications/VirtualBox.app",
"#{ENV["HOME"]}/Applications/VirtualBox.app",
ENV["VIRTUALBOX_APP"]
].find { |dir| dir && File.exist?("#{dir}/Contents/MacOS/VBoxDD.dylib") }
end
satisfy :build_env => false do
self.class.app_path
end
def message; <<-EOS.undent
vdfuse requires VirtualBox to be installed
If you installed to a non-standard location, set the VIRTUALBOX_APP environment variable.
EOS
end
end
class Vdfuse < Formula
homepage "https://github.com/SophosLabs/vdfuse"
head "https://github.com/SophosLabs/vdfuse.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "subversion" => :build
depends_on :osxfuse
depends_on VirtualBoxInstalled
def install
configure_opts = [
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
]
osxfuse = Formula["osxfuse"]
configure_opts << "--with-fuse-headers=#{osxfuse.include}/osxfuse" if osxfuse.installed?
inreplace "configure.ac", /VBOX_INSTALL_DIR=.*/, "VBOX_INSTALL_DIR=\"#{VirtualBoxInstalled.app_path}/Contents/MacOS\""
system "./fetch_vbox_headers.sh"
system "./autogen.sh"
system "./configure", *configure_opts
system "make", "install"
end
end