1 class GoAT119 < Formula
2 desc "Open source programming language to build simple/reliable/efficient software"
3 homepage "https://go.dev/"
4 url "https://go.dev/dl/go1.19.13.src.tar.gz"
5 mirror "https://fossies.org/linux/misc/go1.19.13.src.tar.gz"
6 sha256 "ccf36b53fb0024a017353c3ddb22c1f00bc7a8073c6aac79042da24ee34434d3"
10 sha256 cellar: :any_skip_relocation, arm64_sonoma: "32c7123bcc814d8ed1f54c072ab06e4128f82378feee8a3fa78e8475ceb5b55a"
11 sha256 cellar: :any_skip_relocation, arm64_ventura: "cf10aa203445ad09fcb6e97e91ee75cb41215b3d9b84e1c25e6e24ba45454dbc"
12 sha256 cellar: :any_skip_relocation, arm64_monterey: "ff3535b243ddf16a1176b0d4ac28758c62f779622e1b026f24cfa4bee6cb7546"
13 sha256 cellar: :any_skip_relocation, arm64_big_sur: "7c65c8386347f9ba16fd7579f8757c8e9ee663126cf1eb01202b9755bf409a6d"
14 sha256 cellar: :any_skip_relocation, sonoma: "c6c642417aa9afcae02b508edbd943d8fad594d156f5d215e75ad45682d3376d"
15 sha256 cellar: :any_skip_relocation, ventura: "65b21f9af59dcf256e92b050f53be5045ab2e2b1d24ba78896314ce9f982e31c"
16 sha256 cellar: :any_skip_relocation, monterey: "3637554cb731fa4f70289bf2b41c5474de93354f4d1712c16f30b2d3d450c323"
17 sha256 cellar: :any_skip_relocation, big_sur: "acb41f7e734a1302f73d2ea998052aa82e523a4285270f12417fa02f5b2ce30e"
18 sha256 cellar: :any_skip_relocation, x86_64_linux: "25d23ef810a777c73e48f84ab03c7dd161d5b7706d31010f7ab3b0d595ec13f8"
21 keg_only :versioned_formula
23 # EOL with Go 1.21 release (2023-08-08)
24 # Ref: https://go.dev/doc/devel/release#policy
25 disable! date: "2024-08-24", because: :unsupported
27 depends_on "go" => :build
30 ENV["GOROOT_BOOTSTRAP"] = Formula["go"].opt_libexec
33 ENV["GOROOT_FINAL"] = libexec
34 system "./make.bash", "--no-clean"
37 rm_r(buildpath/"pkg/obj")
38 libexec.install Dir["*"]
39 bin.install_symlink Dir[libexec/"bin/go*"]
41 system bin/"go", "install", "-race", "std"
43 # Remove useless files.
44 # Breaks patchelf because folder contains weird debug/test files
45 rm_r(libexec/"src/debug/elf/testdata")
46 # Binaries built for an incompatible architecture
47 rm_r(libexec/"src/runtime/pprof/testdata")
51 (testpath/"hello.go").write <<~GO
57 fmt.Println("Hello World")
60 # Run go fmt check for no errors then run the program.
61 # This is a a bare minimum of go working as it uses fmt, build, and run.
62 system bin/"go", "fmt", "hello.go"
63 assert_equal "Hello World\n", shell_output("#{bin}/go run hello.go")
65 ENV["GOOS"] = "freebsd"
66 ENV["GOARCH"] = "amd64"
67 system bin/"go", "build", "hello.go"