diff --git a/Formula/l/llgo.rb b/Formula/l/llgo.rb index fdc20dbbcd1c0..ee55f7fd87df9 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.11.tar.gz" + sha256 "ee3817eaadd5feb1dd253da2a297239d3575a7825cae6d6cc06905a4693026ce" license "Apache-2.0" - head "https://github.com/goplus/llgo.git", branch: "main" + head "https://github.com/luoliwoshang/llgo.git", branch: "main" livecheck do url :stable @@ -31,10 +31,6 @@ class Llgo < Formula depends_on "pkgconf" uses_from_macos "zlib" - on_linux do - depends_on "libunwind" - end - def find_dep(name) deps.find { |f| f.name.match?(/^#{name}(@\d+(\.\d+)*)?$/) } .to_formula @@ -69,9 +65,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| @@ -100,6 +95,7 @@ def install "fmt" "github.com/goplus/lib/c" + "github.com/goplus/lib/cpp/std" ) func Foo() string { @@ -109,6 +105,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 @@ -130,12 +127,14 @@ module hello system go.opt_bin/"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 .")