@@ -21,7 +21,7 @@ class Llgo < Formula
21
21
end
22
22
23
23
depends_on "bdw-gc"
24
- depends_on "go"
24
+ depends_on "go@1.24 "
25
25
depends_on "libffi"
26
26
depends_on "libuv"
27
27
depends_on "lld@19"
@@ -62,7 +62,7 @@ def install
62
62
63
63
libexec . install "LICENSE" , "README.md" , "go.mod" , "go.sum" , "runtime"
64
64
65
- path_deps = %w[ lld llvm go pkgconf ] . map { |name | find_dep ( name ) . opt_bin }
65
+ path_deps = %w[ lld llvm go@1.24 pkgconf ] . map { |name | find_dep ( name ) . opt_bin }
66
66
script_env = { PATH : "#{ path_deps . join ( ":" ) } :$PATH" }
67
67
68
68
if OS . linux?
@@ -80,8 +80,9 @@ def install
80
80
end
81
81
82
82
test do
83
- goos = shell_output ( "go env GOOS" ) . chomp
84
- goarch = shell_output ( "go env GOARCH" ) . chomp
83
+ go = find_dep ( "[email protected] " )
84
+ goos = shell_output ( "#{ go . opt_bin } /go env GOOS" ) . chomp
85
+ goarch = shell_output ( "#{ go . opt_bin } /go env GOARCH" ) . chomp
85
86
assert_equal "llgo v#{ version } #{ goos } /#{ goarch } " , shell_output ( "#{ bin } /llgo version" ) . chomp
86
87
87
88
# Add bdw-gc library path to LD_LIBRARY_PATH, this is a workaround for the libgc.so not found issue
@@ -123,7 +124,7 @@ def install
123
124
( testpath /"go.mod" ) . write <<~GOMOD
124
125
module hello
125
126
GOMOD
126
- system "go" , "get" , "github.com/goplus/lib"
127
+ system go . opt_bin / "go" , "get" , "github.com/goplus/lib"
127
128
# Test llgo run
128
129
assert_equal "Hello LLGO by fmt.Println\n " \
129
130
"Hello LLGO by c.Printf\n " ,
0 commit comments