aboutsummaryrefslogtreecommitdiff
path: root/extra/go
diff options
context:
space:
mode:
Diffstat (limited to 'extra/go')
-rwxr-xr-xextra/go/build16
-rw-r--r--extra/go/checksums7
-rw-r--r--extra/go/meta3
-rw-r--r--extra/go/patches/no-bash.patch156
-rw-r--r--extra/go/sources2
-rw-r--r--extra/go/version2
6 files changed, 151 insertions, 35 deletions
diff --git a/extra/go/build b/extra/go/build
index c051bc2d..db14aea2 100755
--- a/extra/go/build
+++ b/extra/go/build
@@ -7,13 +7,19 @@ patch -p1 < no-bash.patch
# This breaks Go.
:> nostrip
+case $3 in
+ x86_64) export GOARCH=amd64 ;;
+ i?86) export GOARCH=386 ;;
+ *) printf 'unsupported architecture: %s\n' "$3"
+ exit 1
+esac
+
export CC="${CC:-cc}"
-export GOARCH=amd64
export GO_LDFLAGS="-w -s"
[ -f "$CPT_ROOT/var/db/cpt/installed/go/manifest" ] || {
- export GOROOT=$PWD/go1.4-bootstrap
- export GOROOT_FINAL=$PWD/lib/go-bootstrap
+ export GOROOT="$PWD/go1.4-bootstrap"
+ export GOROOT_FINAL="$PWD/lib/go-bootstrap"
mkdir -p lib/go-bootstrap
@@ -29,10 +35,10 @@ export GOROOT_FINAL=/usr/lib/go
if [ -f "$CPT_ROOT/var/db/cpt/go/manifest" ]; then
export GOROOT_BOOTSTRAP=/usr/lib/go
else
- export GOROOT_BOOTSTRAP=$PWD/lib/go-bootstrap
+ export GOROOT_BOOTSTRAP="$PWD/lib/go-bootstrap"
fi
-export GOROOT=$PWD/go-current
+export GOROOT="$PWD/go-current"
(
cd "$GOROOT/src"
diff --git a/extra/go/checksums b/extra/go/checksums
index e0db713f..7ccce823 100644
--- a/extra/go/checksums
+++ b/extra/go/checksums
@@ -1,3 +1,4 @@
-7688063d55656105898f323d90a79a39c378d86fe89ae192eb3b7fc46347c95a go1.16.src.tar.gz
-f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52 go1.4-bootstrap-20171003.tar.gz
-07daf0ad276a320586ff13a16ddb071879bc2c88168b2191b7b97aa9591f4c2e no-bash.patch
+%BLAKE3
+7de8f3dafa64455084002968504666623b4179ea8dc000114089bc264df0be4b go1.22.4.src.tar.gz
+e38b036986f4969980664342af2e0b14c503bf4222b980f2bfdcb32fd62fde14 go1.4-bootstrap-20171003.tar.gz
+2b88bcaf1cd420f4f6c91f22107ae453742c87f362bb30de40f4cb047050056f no-bash.patch
diff --git a/extra/go/meta b/extra/go/meta
new file mode 100644
index 00000000..fd56b524
--- /dev/null
+++ b/extra/go/meta
@@ -0,0 +1,3 @@
+description: Go programming language
+license: BSD-3-Clause
+maintainer: Cem Keylan <cem@carbslinux.org>
diff --git a/extra/go/patches/no-bash.patch b/extra/go/patches/no-bash.patch
index 56177f16..3f0a5ecc 100644
--- a/extra/go/patches/no-bash.patch
+++ b/extra/go/patches/no-bash.patch
@@ -1,57 +1,154 @@
diff -ur a/go-current/src/make.bash b/go-current/src/make.bash
---- a/go-current/src/make.bash 2021-02-16 21:12:04.000000000 +0300
-+++ b/go-current/src/make.bash 2021-02-17 00:42:09.963840381 +0300
+--- a/go-current/src/make.bash Thu May 30 21:26:07 2024
++++ b/go-current/src/make.bash Fri Jun 7 01:22:26 2024
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-@@ -106,7 +106,7 @@
+@@ -78,13 +78,13 @@
+
+ set -e
+
+-if [[ ! -f run.bash ]]; then
++if [ ! -f run.bash ]; then
+ echo 'make.bash must be run from $GOROOT/src' 1>&2
+ exit 1
+ fi
+
+-if [[ "$GOBUILDTIMELOGFILE" != "" ]]; then
+- echo $(LC_TIME=C date) start make.bash >"$GOBUILDTIMELOGFILE"
++if [ "$GOBUILDTIMELOGFILE" != "" ]; then
++ echo "$(LC_TIME=C date) start make.bash" >"$GOBUILDTIMELOGFILE"
+ fi
+
+ # Test for Windows.
+@@ -114,7 +114,7 @@
# so loop through the possible selinux mount points.
for se_mount in /selinux /sys/fs/selinux
do
-- if [ -d $se_mount -a -f $se_mount/booleans/allow_execstack -a -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
+- if [[ -d $se_mount && -f $se_mount/booleans/allow_execstack && -x /usr/sbin/selinuxenabled ]] && /usr/sbin/selinuxenabled; then
+ if [ -d $se_mount ] && [ -f $se_mount/booleans/allow_execstack ] && [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
if ! cat $se_mount/booleans/allow_execstack | grep -c '^1 1$' >> /dev/null ; then
echo "WARNING: the default SELinux policy on, at least, Fedora 12 breaks "
echo "Go. You can enable the features that Go needs via the following "
-@@ -154,14 +154,14 @@
+@@ -134,7 +134,7 @@
+ # Test for debian/kFreeBSD.
+ # cmd/dist will detect kFreeBSD as freebsd/$GOARCH, but we need to
+ # disable cgo manually.
+-if [[ "$(uname -s)" == "GNU/kFreeBSD" ]]; then
++if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then
+ export CGO_ENABLED=0
+ fi
+
+@@ -145,17 +145,17 @@
+
+ verbose=false
+ vflag=""
+-if [[ "$1" == "-v" ]]; then
++if [ "$1" = "-v" ]; then
+ verbose=true
+ vflag=-v
+ shift
+ fi
- export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
- export GOROOT="$(cd .. && pwd)"
+ goroot_bootstrap_set=${GOROOT_BOOTSTRAP+"true"}
+-if [[ -z "$GOROOT_BOOTSTRAP" ]]; then
++if [ -z "$GOROOT_BOOTSTRAP" ]; then
+ GOROOT_BOOTSTRAP="$HOME/go1.4"
+ for d in sdk/go$bootgo go$bootgo; do
+- if [[ -d "$HOME/$d" ]]; then
++ if [ -d "$HOME/$d" ]; then
+ GOROOT_BOOTSTRAP="$HOME/$d"
+ fi
+ done
+@@ -163,15 +163,16 @@
+ export GOROOT_BOOTSTRAP
+
+ nogoenv() {
+- GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@"
++ GO111MODULE=off GOENV=off GOOS='' GOARCH='' GOEXPERIMENT='' GOFLAGS='' "$@"
+ }
+
+-export GOROOT="$(cd .. && pwd)"
-IFS=$'\n'; for go_exe in $(type -ap go); do
-+for go_exe in $(command -v go); do
- if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
- goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
- if [ "$goroot" != "$GOROOT" ]; then
- GOROOT_BOOTSTRAP=$goroot
+- if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]]; then
+- goroot=$(GOROOT= nogoenv "$go_exe" env GOROOT)
+- if [[ "$goroot" != "$GOROOT" ]]; then
+- if [[ "$goroot_bootstrap_set" == "true" ]]; then
++export GOROOT="${PWD%/*}"
++type_a() { IFS=:; for dir in $PATH; do [ -x "$dir/$1" ] && printf '%s\n' "$dir/$1"; done ;}
++IFS="$(printf '\n')"; for go_exe in $(type_a go); do
++ if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
++ goroot=$(GOROOT='' nogoenv "$go_exe" env GOROOT)
++ if [ "$goroot" != "$GOROOT" ]; then
++ if [ "$goroot_bootstrap_set" = "true" ]; then
+ printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2
+ printf 'WARNING: set %s as GOROOT_BOOTSTRAP\n' "$goroot" >&2
+ fi
+@@ -179,7 +180,7 @@
fi
fi
--done; unset IFS
-+done
- if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
+ done; unset IFS
+-if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]]; then
++if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
- echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
+ echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go $bootgo." >&2
+ exit 1
+@@ -192,7 +193,7 @@
+ if $verbose; then
+ echo cmd/dist
+ fi
+-if [[ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]]; then
++if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
+ echo "ERROR: \$GOROOT_BOOTSTRAP must not be set to \$GOROOT" >&2
+ echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go $bootgo." >&2
+ exit 1
+@@ -202,7 +203,7 @@
+
+ # -e doesn't propagate out of eval, so check success by hand.
+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
+-if [[ "$FAIL" == true ]]; then
++if [ "$FAIL" = true ]; then
+ exit 1
+ fi
+
+@@ -210,10 +211,10 @@
+ echo
+ fi
+
+-if [[ "$1" == "--dist-tool" ]]; then
++if [ "$1" = "--dist-tool" ]; then
+ # Stop after building dist tool.
+ mkdir -p "$GOTOOLDIR"
+- if [[ "$2" != "" ]]; then
++ if [ "$2" != "" ]; then
+ cp cmd/dist/dist "$2"
+ fi
+ mv cmd/dist/dist "$GOTOOLDIR"/dist
diff -ur a/go1.4-bootstrap/src/make.bash b/go1.4-bootstrap/src/make.bash
---- a/go1.4-bootstrap/src/make.bash 2017-11-22 04:33:58.000000000 +0300
-+++ b/go1.4-bootstrap/src/make.bash 2021-02-17 00:40:52.245631282 +0300
+--- a/go1.4-bootstrap/src/make.bash Wed Nov 22 02:33:58 2017
++++ b/go1.4-bootstrap/src/make.bash Fri Jun 7 01:22:30 2024
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-@@ -82,7 +82,7 @@
+@@ -80,9 +80,8 @@
+ # Test for bad SELinux.
+ # On Fedora 16 the selinux filesystem is mounted at /sys/fs/selinux,
# so loop through the possible selinux mount points.
- for se_mount in /selinux /sys/fs/selinux
- do
+-for se_mount in /selinux /sys/fs/selinux
+-do
- if [ -d $se_mount -a -f $se_mount/booleans/allow_execstack -a -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
-+ if [ -d $se_mount ] && [ -f $se_mount/booleans/allow_execstack ] [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
++for se_mount in /selinux /sys/fs/selinux; do
++ if [ -d $se_mount ] && [ -f $se_mount/booleans/allow_execstack ] && [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
if ! cat $se_mount/booleans/allow_execstack | grep -c '^1 1$' >> /dev/null ; then
echo "WARNING: the default SELinux policy on, at least, Fedora 12 breaks "
echo "Go. You can enable the features that Go needs via the following "
-@@ -102,7 +102,7 @@
+@@ -102,7 +101,7 @@
# Test for debian/kFreeBSD.
# cmd/dist will detect kFreeBSD as freebsd/$GOARCH, but we need to
# disable cgo manually.
@@ -60,7 +157,16 @@ diff -ur a/go1.4-bootstrap/src/make.bash b/go1.4-bootstrap/src/make.bash
export CGO_ENABLED=0
fi
-@@ -122,12 +122,12 @@
+@@ -113,7 +112,7 @@
+
+ echo '# Building C bootstrap tool.'
+ echo cmd/dist
+-export GOROOT="$(cd .. && pwd)"
++export GOROOT="${PWD%/*}"
+ GOROOT_FINAL="${GOROOT_FINAL:-$GOROOT}"
+ DEFGOROOT='-DGOROOT_FINAL="'"$GOROOT_FINAL"'"'
+
+@@ -122,12 +121,12 @@
386) mflag=-m32;;
amd64) mflag=-m64;;
esac
@@ -75,7 +181,7 @@ diff -ur a/go1.4-bootstrap/src/make.bash b/go1.4-bootstrap/src/make.bash
export CC=clang CXX=clang++
fi
${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
-@@ -162,7 +162,7 @@
+@@ -162,7 +161,7 @@
"$GOTOOLDIR"/go_bootstrap clean -i std
echo
diff --git a/extra/go/sources b/extra/go/sources
index be0defec..beb1861d 100644
--- a/extra/go/sources
+++ b/extra/go/sources
@@ -1,3 +1,3 @@
-https://golang.org/dl/go1.16.src.tar.gz go-current
+https://golang.org/dl/go1.22.4.src.tar.gz go-current
https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz go1.4-bootstrap
patches/no-bash.patch
diff --git a/extra/go/version b/extra/go/version
index d1d913ed..1418be46 100644
--- a/extra/go/version
+++ b/extra/go/version
@@ -1 +1 @@
-1.16 1
+1.22.4 1