add __go_get, __golang_from_vendor

This commit is contained in:
kamila 2017-05-04 17:29:07 +02:00
parent df7ef403bc
commit 21a29ab5aa
9 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1 @@
uname -s

View file

@ -0,0 +1,3 @@
[ -f /etc/environment ] && . /etc/environment
[ -f /etc/profile ] && . /etc/profile
go version 2>/dev/null || true

View file

@ -0,0 +1,8 @@
package=$__object_id
cat<<EOF
[ -f /etc/environment ] && . /etc/environment
[ -f /etc/profile ] && . /etc/profile
export GOPATH=\${GOPATH:-/opt/gocode}
go get $package
EOF

View file

@ -0,0 +1,17 @@
#!/bin/sh
go_executable=$(cat "$__object/explorer/go-executable")
[ -z "$go_executable" ] && echo "__go_get: Cannot find go executable; make sure it is installed and in PATH" >&2 && exit 1
os=$(cat "$__global/explorer/os")
case $os in
debian|devuan|ubuntu)
__package build-essential
;;
*)
echo "__go_get: Don't know how to install g++ on $os" >&2
echo "__go_get: Send a pull request or contact <kamila@ksp.sk> to add support for $os." >&2
exit 1
;;
esac

View file

@ -0,0 +1,26 @@
#!/bin/sh
version=$(cat "$__object/parameter/version")
kernel_name=$(cat "$__global/explorer/kernel_name" | tr '[:upper:]' '[:lower:]')
machine=$(cat "$__global/explorer/machine")
case $machine in
x86_64|amd64)
arch=amd64
;;
x86)
arch=386
;;
*)
arch=$machine # at least try...
;;
esac
PACKAGE="go${version}.${kernel_name}-${arch}"
URL="https://storage.googleapis.com/golang/${PACKAGE}.tar.gz"
cat <<EOF
[ "x\$(cat /usr/local/go/VERSION 2>/dev/null)" = "xgo$version" ] && exit 0 # already there
wget --no-verbose "$URL" -O "/tmp/${PACKAGE}.tar.gz"
rm -rf /usr/local/go
tar -C /usr/local -xzf /tmp/${PACKAGE}.tar.gz
EOF

View file

@ -0,0 +1 @@
__line go_in_path --line 'export PATH=/usr/local/go/bin:$PATH' --file /etc/profile

View file

@ -0,0 +1 @@
1.8.1

View file

@ -0,0 +1 @@
version