Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/go/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'extra/go/PKGBUILD')
-rw-r--r--extra/go/PKGBUILD48
1 files changed, 48 insertions, 0 deletions
diff --git a/extra/go/PKGBUILD b/extra/go/PKGBUILD
new file mode 100644
index 00000000..a9fa58bd
--- /dev/null
+++ b/extra/go/PKGBUILD
@@ -0,0 +1,48 @@
+eval "$(
+ declare -f build | \
+ sed '
+ /install\( .*\)\? -race /d
+ '
+ declare -f package_go-pie package | \
+ sed '
+ s,\(/linux_\)amd64\([_/]\),\1386\2,g
+ '
+)"
+
+eval "$(
+ declare -f build check _package \
+ | sed '
+ s/\(export GOARCH=\)amd64/\1386 /
+ '
+)"
+
+# 1.16 dropped non-SSE2 floating point operations, so we must
+# use software floating points (see https://github.com/golang/go/issues/40255)
+if [ "$CARCH" = 'i686' -o "$CARCH" = 'i486' ]; then
+ eval "$(
+ declare -f build \
+ | sed '
+ 2 a export GO386='softfloat'
+ '
+ declare -f check \
+ | sed '
+ 2 a export GO386='softfloat'
+ '
+ )"
+fi
+
+# https://go-review.googlesource.com/c/go/+/257963
+source+=('go-x87.patch')
+sha256sums+=('10e036bb7b9c468485a4ea878343918160b914a51aad67ad75839c85bd492b54')
+eval "$(
+ {
+ declare -f prepare || \
+ printf 'prepare() { cd "$pkgname" \n}\n'
+ } \
+ | sed '
+ $i patch -Np1 -i ../go-x87.patch
+ '
+)"
+
+# tests are failing, ignore them
+unset check