Skip to content

Commit 54a4f84

Browse files
committed
[DO NOT MERGE] lima 1.1.0-rc.0
The formula is now split to two to save the disk space: - lima - lima-additional-guestagents The latter one is needed only for running a VM with a non-native architecture (e.g., Intel on ARM). See also the release note: https://github.com/lima-vm/lima/releases/tag/v1.1.0-rc.0 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 7520a3e commit 54a4f84

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
class LimaAdditionalGuestagents < Formula
2+
desc "Additional guest agents for Lima"
3+
homepage "https://lima-vm.io/"
4+
url "https://github.com/lima-vm/lima/archive/refs/tags/v1.1.0-rc.0.tar.gz"
5+
sha256 "bfae3d127b62446794f3f5c33975b35958dc29d06c15b8255cc1172ea7db134e"
6+
license "Apache-2.0"
7+
head "https://github.com/lima-vm/lima.git", branch: "master"
8+
9+
# Commented out because this does not recognize `brew install ./lima.rb` as the installed dependency
10+
## depends_on "lima"
11+
depends_on "go" => :build
12+
13+
def install
14+
if build.head?
15+
system "make", "additional-guestagents"
16+
else
17+
# VERSION has to be explicitly specified when building from tar.gz, as it does not contain git tags
18+
system "make", "additional-guestagents", "VERSION=#{version}"
19+
end
20+
21+
share.install Dir["_output/share/*"]
22+
end
23+
24+
test do
25+
info = JSON.parse shell_output("#{Formula["lima"].bin}/limactl info")
26+
assert_includes info["guestAgents"], "riscv64"
27+
end
28+
end

Formula/l/lima.rb

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class Lima < Formula
22
desc "Linux virtual machines"
33
homepage "https://lima-vm.io/"
4-
url "https://github.com/lima-vm/lima/archive/refs/tags/v1.0.7.tar.gz"
5-
sha256 "90f682e96a370c342c3b16deb1858f37ee28ce88e888e1d6b2634ba24228fdbb"
4+
url "https://github.com/lima-vm/lima/archive/refs/tags/v1.1.0-rc.0.tar.gz"
5+
sha256 "bfae3d127b62446794f3f5c33975b35958dc29d06c15b8255cc1172ea7db134e"
66
license "Apache-2.0"
77
head "https://github.com/lima-vm/lima.git", branch: "master"
88

@@ -23,11 +23,14 @@ class Lima < Formula
2323
end
2424

2525
def install
26+
# make (default): build everything
27+
# make native: build core + native guest agent
28+
# make additional-guestagents: build non-native guest agents
2629
if build.head?
27-
system "make"
30+
system "make", "native"
2831
else
2932
# VERSION has to be explicitly specified when building from tar.gz, as it does not contain git tags
30-
system "make", "VERSION=#{version}"
33+
system "make", "native", "VERSION=#{version}"
3134
end
3235

3336
bin.install Dir["_output/bin/*"]
@@ -37,6 +40,14 @@ def install
3740
generate_completions_from_executable(bin/"limactl", "completion")
3841
end
3942

43+
def caveats
44+
# since lima 1.1.0
45+
<<~EOS
46+
The guest agents for non-native architectures are now provided in a separate formula:
47+
brew install lima-additional-guestagents
48+
EOS
49+
end
50+
4051
test do
4152
info = JSON.parse shell_output("#{bin}/limactl info")
4253
# Verify that the VM drivers are compiled in

0 commit comments

Comments
 (0)