File tree Expand file tree Collapse file tree 6 files changed +81
-0
lines changed
Expand file tree Collapse file tree 6 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ import { BuildOptions , unarchive } from "brewkit" ;
2+
3+ export default async function ( { prefix, tag } : BuildOptions ) {
4+ const arch = ( ( ) => {
5+ switch ( `${ Deno . build . os } /${ Deno . build . arch } ` ) {
6+ case "darwin/x86_64" :
7+ return "darwin-amd64.tar.gz" ;
8+ case "linux/x86_64" :
9+ return "linux-amd64.tar.gz" ;
10+ case "windows/x86_64" :
11+ return "windows-amd64.zip" ;
12+ case "linux/aarch64" :
13+ return "linux-arm64.tar.gz" ;
14+ case "darwin/aarch64" :
15+ return "darwin-arm64.tar.gz" ;
16+ default :
17+ throw new Error ( "Unsupported platform" ) ;
18+ }
19+ } ) ( ) ;
20+
21+ prefix . mkdir ( 'p' ) . cd ( ) ;
22+ await unarchive ( `https://go.dev/dl/go${ tag } .${ arch } ` ) ;
23+ }
Original file line number Diff line number Diff line change 1+ import { Path } from "brewkit" ;
2+
3+ export default function ( path : Path ) {
4+ // stripping fails for plenty of stuff in `src`
5+ if ( path . components ( ) . includes ( "src" ) ) return false ;
6+ // these go binaries are ”not dynamic executables” and thus `ldd` fails to inspect them!
7+ if ( path . parent ( ) . basename ( ) == "bin" ) return false ;
8+ if ( path . basename ( ) == "doc" ) return false ;
9+ if ( path . string . includes ( "pkg/tool/linux_" ) ) return false ;
10+ return true ;
11+ }
Original file line number Diff line number Diff line change 1+ name :
2+ Go
3+
4+ repository :
5+ https://github.com/golang/go
6+
7+ programs :
8+ - bin/go
9+ - bin/gofmt
10+
11+ linux :
12+ dependencies :
13+ curl.se/ca-certs : ' *'
14+
15+ platforms :
16+ - darwin/aarch64
17+ - darwin/x86-64
18+ - linux/aarch64
19+ - linux/x86-64
20+ - windows/x86-64
Original file line number Diff line number Diff line change 1+ package main
2+ import "fmt"
3+ func main () {
4+ fmt .Println ("Hello World" )
5+ }
Original file line number Diff line number Diff line change 1+ import { backticks , run } from "brewkit" ;
2+ import { assertEquals } from "jsr:@std/assert@1/equals" ;
3+
4+ export default async function ( ) {
5+ assertEquals ( await backticks `go run test.go` , "Hello World" ) ;
6+
7+ run `go build -o test test.go` ;
8+ assertEquals ( await backticks `./test` , "Hello World" ) ;
9+ }
Original file line number Diff line number Diff line change 1+ import { github , semver } from "brewkit" ;
2+
3+ export default async function ( ) {
4+ return ( await github . tags ( "golang/go" ) ) . compact (
5+ ( { name : tag } ) => {
6+ tag = tag . replace ( / ^ g o / , "" ) ;
7+ const version = semver . parse ( tag ) ;
8+ if ( version ) {
9+ return { tag, version } ;
10+ }
11+ } ,
12+ ) ;
13+ }
You can’t perform that action at this time.
0 commit comments