-
Notifications
You must be signed in to change notification settings - Fork 5
/
go
57 lines (51 loc) · 1.72 KB
/
go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
## TODO: wants /etc/services
if ! is_without tests; then
[[ ! -e /etc/services ]] && log "Go requires /etc/services to successfully test" && false
if ! grep -q '^smtp\b' /etc/services; then
log "Go requires smtp entry in /etc/services to successfully test"
false
fi
fi
# 1.4 needed for 1.17.13
fetch_source https://github.com/golang/go/archive/bdd4b9503e47c2c38a9d0a9bb2f5d95ec5ff8ef6.tar.gz b1092edf37195a3d45eb5bd7e54139ac806cc9ac
do_unpack
pushd_src
cd src
GOROOT_FINAL="$PREFIX/go-bootstrap" GOBIN="$SRCDIR/bin" GO_LDFLAGS="-L $PREFIX/lib" GO_CCFLAGS="-I $PREFIX/include" ./make.bash --no-banner
cd ..
mkdir -p "$PREFIX/go-bootstrap"
cp -a bin pkg src "$PREFIX/go-bootstrap"
popd_src
# 1.17.13 needed for 1.20
fetch_source https://go.dev/dl/go1.17.13.src.tar.gz 88e2bd59e440816155b9355a74185269b220453a
do_unpack
pushd_src
cd src
GOROOT_BOOTSTRAP="$PREFIX/go-bootstrap" GOROOT_FINAL="$PREFIX/go-bootstrap117" GO_LDFLAGS="-L $PREFIX/lib" ./make.bash --no-banner
cd ..
mkdir -p "$PREFIX/go-bootstrap117"
cp -a bin pkg src "$PREFIX/go-bootstrap117"
rm -rf "$PREFIX/go-bootstrap"
popd_src
fetch_source https://go.dev/dl/go1.20.src.tar.gz a7236459104fe2d8582cd8e2bf4935d4eab9721b
do_unpack
pushd_src
cd src
CMD=./make.bash
if [[ $OSTYPE != *darwin* ]]; then
! is_without tests && CMD=./all.bash
else
is_with tests && CMD=./all.bash
fi
PROMPT_COMMAND="" PROMPT_TITLE="" \
GOROOT_BOOTSTRAP="$PREFIX/go-bootstrap117" GOROOT_FINAL="$PREFIX/go" GO_LDFLAGS="-L $PREFIX/lib" $CMD --no-banner
cd ..
rm -rf "$PREFIX/go"
mkdir -p "$PREFIX/go"
cp -pr "$SRCDIR"/* "$PREFIX/go"
mkdir -p "$PREFIX/bin"
ln -fs ../go/bin/go "$PREFIX/bin/go"
ln -fs ../go/bin/gofmt "$PREFIX/bin/gofmt"
popd_src
rm -rf "$PREFIX/go-bootstrap117"