forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ef32da
commit bd2dcd7
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
cask "virtualbox@6" do | ||
version "6.1.50,161033" | ||
sha256 "b70d28695730b33f0a9abbce6b3c675d9031f2983a0429eb5ea7e979df95ea80" | ||
|
||
url "https://download.virtualbox.org/virtualbox/#{version.csv.first}/VirtualBox-#{version.csv.first}-#{version.csv.second}-OSX.dmg" | ||
name "Oracle VirtualBox" | ||
desc "Virtualizer for x86 hardware" | ||
homepage "https://www.virtualbox.org/" | ||
|
||
livecheck do | ||
url "https://www.virtualbox.org/wiki/Download_Old_Builds_6_1" | ||
regex(/href=.*?VirtualBox-(\d+(?:\.\d+)+)-(\d+)-OSX.dmg/i) | ||
strategy :page_match do |page, regex| | ||
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" } | ||
end | ||
end | ||
|
||
conflicts_with cask: "virtualbox-beta" | ||
depends_on macos: ">= :high_sierra" | ||
depends_on arch: :x86_64 | ||
|
||
pkg "VirtualBox.pkg", | ||
choices: [ | ||
{ | ||
"choiceIdentifier" => "choiceVBoxKEXTs", | ||
"choiceAttribute" => "selected", | ||
"attributeSetting" => 1, | ||
}, | ||
{ | ||
"choiceIdentifier" => "choiceVBox", | ||
"choiceAttribute" => "selected", | ||
"attributeSetting" => 1, | ||
}, | ||
{ | ||
"choiceIdentifier" => "choiceVBoxCLI", | ||
"choiceAttribute" => "selected", | ||
"attributeSetting" => 1, | ||
}, | ||
{ | ||
"choiceIdentifier" => "choiceOSXFuseCore", | ||
"choiceAttribute" => "selected", | ||
"attributeSetting" => 0, | ||
}, | ||
] | ||
|
||
postflight do | ||
# If VirtualBox is installed before `/usr/local/lib/pkgconfig` is created by Homebrew, it creates it itself | ||
# with incorrect permissions that break other packages | ||
# See https://github.com/Homebrew/homebrew-cask/issues/68730#issuecomment-534363026 | ||
set_ownership "/usr/local/lib/pkgconfig" | ||
end | ||
|
||
uninstall script: { | ||
executable: "VirtualBox_Uninstall.tool", | ||
args: ["--unattended"], | ||
sudo: true, | ||
}, | ||
pkgutil: "org.virtualbox.pkg.*", | ||
delete: "/usr/local/bin/vboximg-mount" | ||
|
||
zap trash: [ | ||
"/Library/Application Support/VirtualBox", | ||
"~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/org.virtualbox.app.virtualbox*", | ||
"~/Library/Preferences/org.virtualbox.app.VirtualBox*", | ||
"~/Library/Saved Application State/org.virtualbox.app.VirtualBox*", | ||
"~/Library/VirtualBox", | ||
], | ||
rmdir: "~/VirtualBox VMs" | ||
|
||
caveats do | ||
kext | ||
end | ||
end |