diff --git a/Formula/l/llgo.rb b/Formula/l/llgo.rb index c0b9e51ae0fec..cd539e3a31a83 100644 --- a/Formula/l/llgo.rb +++ b/Formula/l/llgo.rb @@ -1,10 +1,10 @@ class Llgo < Formula desc "Go compiler based on LLVM integrate with the C ecosystem and Python" - homepage "https://github.com/goplus/llgo" - url "https://github.com/goplus/llgo/archive/refs/tags/v0.11.5.tar.gz" - sha256 "e025993d12c1f5e49e5b8dcb31c0e8b349efe56970d1a23d6c089ebd10928c6b" + homepage "https://github.com/luoliwoshang/llgo" + url "https://github.com/luoliwoshang/llgo/archive/refs/tags/v0.12.7.tar.gz" + sha256 "a3a8c8095be50dcc8f13a379617399eb820815063b471c6284a060198298c652" license "Apache-2.0" - head "https://github.com/goplus/llgo.git", branch: "main" + head "https://github.com/luoliwoshang/llgo.git", branch: "internal/build/rpath" livecheck do url :stable @@ -21,7 +21,7 @@ class Llgo < Formula end depends_on "bdw-gc" - depends_on "go" + depends_on "go@1.24" depends_on "libffi" depends_on "libuv" depends_on "lld@19" @@ -30,10 +30,6 @@ class Llgo < Formula depends_on "pkgconf" uses_from_macos "zlib" - on_linux do - depends_on "libunwind" - end - def find_dep(name) deps.map(&:to_formula).find { |f| f.name.match?(/^#{name}(@\d+)?$/) } end @@ -66,9 +62,8 @@ def install script_env = { PATH: "#{path_deps.join(":")}:$PATH" } if OS.linux? - libunwind = find_dep("libunwind") - script_env[:CFLAGS] = "-I#{libunwind.opt_include} $CFLAGS" - script_env[:LDFLAGS] = "-L#{libunwind.opt_lib} -rpath #{libunwind.opt_lib} $LDFLAGS" + script_env[:CFLAGS] = "-I#{llvm.opt_include} $CFLAGS" + script_env[:LDFLAGS] = "-L#{llvm.opt_lib} -rpath #{llvm.opt_lib} $LDFLAGS" end (libexec/"bin").children.each do |f| @@ -96,6 +91,7 @@ def install "fmt" "github.com/goplus/lib/c" + "github.com/goplus/lib/cpp/std" ) func Foo() string { @@ -105,6 +101,7 @@ def install func main() { fmt.Println("Hello LLGO by fmt.Println") c.Printf(c.Str("Hello LLGO by c.Printf\\n")) + c.Printf(std.Str("Hello LLGO by cpp/std.Str\\n").CStr()) } GO (testpath/"hello_test.go").write <<~GO @@ -126,12 +123,14 @@ module hello system "go", "get", "github.com/goplus/lib" # Test llgo run assert_equal "Hello LLGO by fmt.Println\n" \ - "Hello LLGO by c.Printf\n", + "Hello LLGO by c.Printf\n" \ + "Hello LLGO by cpp/std.Str\n", shell_output("#{bin}/llgo run .") # Test llgo build system bin/"llgo", "build", "-o", "hello", "." assert_equal "Hello LLGO by fmt.Println\n" \ - "Hello LLGO by c.Printf\n", + "Hello LLGO by c.Printf\n" \ + "Hello LLGO by cpp/std.Str\n", shell_output("./hello") # Test llgo test assert_match "PASS", shell_output("#{bin}/llgo test .")