summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Batts <vbatts@hashbangbash.com>2013-01-05 19:45:29 +0100
committerdsomero <xgizzmo@slackbuilds.org>2013-01-09 18:52:22 -0500
commitfdb29e78157187d8bd031eb170107985bb076d08 (patch)
tree58d7e38c12c57145b8c2878b329cc4e552376023
parentf57720a5c78ac6788ce819acadef8b4b8e25bcc3 (diff)
downloadslackbuilds-fdb29e78157187d8bd031eb170107985bb076d08.tar.gz
development/google-go-lang: Updated for version 1.0.3.
Switch to building from source, many other changes and additions Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
-rw-r--r--development/google-go-lang/README17
-rw-r--r--development/google-go-lang/go.csh3
-rw-r--r--development/google-go-lang/go.sh3
-rw-r--r--development/google-go-lang/google-go-lang.SlackBuild100
-rw-r--r--development/google-go-lang/google-go-lang.info14
5 files changed, 112 insertions, 25 deletions
diff --git a/development/google-go-lang/README b/development/google-go-lang/README
index 736eb86701..a276a9cf32 100644
--- a/development/google-go-lang/README
+++ b/development/google-go-lang/README
@@ -11,3 +11,20 @@ The tools are added to the path by putting go.sh and go.csh files in
/etc/profile.d and letting the system's /etc/profile or /etc/csh.login pick it
up. If you want to add any of Go's environment variables you can add them
there.
+
+Also, to easily setup a user-independent path for Go libraries to be installed
+to and used, is the GOPATH environment variable. This variable can be colon
+delimited. For example, once installing the built google-go-lang package, then
+set in your user's ~/.bashrc something like:
+
+ export GOPATH="$HOME/src/go"
+
+Then, you'll be able to use the `go` command to install an additional library
+that will not need root permission and will be in the compiler's path.
+Like so:
+
+ go get labix.org/v2/mgo
+
+Now in ~/src/go, you'll have this library available!
+
+
diff --git a/development/google-go-lang/go.csh b/development/google-go-lang/go.csh
deleted file mode 100644
index 878cd37f62..0000000000
--- a/development/google-go-lang/go.csh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/csh
-setenv GOROOT /opt/google/go
-setenv PATH ${PATH}:${GOROOT}/bin
diff --git a/development/google-go-lang/go.sh b/development/google-go-lang/go.sh
deleted file mode 100644
index d5b3d132a2..0000000000
--- a/development/google-go-lang/go.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-export GOROOT=/opt/google/go
-export PATH="${PATH}:${GOROOT}/bin"
diff --git a/development/google-go-lang/google-go-lang.SlackBuild b/development/google-go-lang/google-go-lang.SlackBuild
index 227a79f273..10d7537005 100644
--- a/development/google-go-lang/google-go-lang.SlackBuild
+++ b/development/google-go-lang/google-go-lang.SlackBuild
@@ -3,6 +3,7 @@
# Slackware build script for google-go-lang
# Written by Eric Schultz eric at schultzter.ca
+# Taken over by Vincent Batts vbatts@hashbangbash.com
# Copyright (c) 2012 Eric Schultz
#
@@ -25,17 +26,35 @@
# SOFTWARE.
PRGNAM=google-go-lang
-VERSION=${VERSION:-1}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-1.0.3}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
RELEASE=${RELEASE:-linux}
-case "$( uname -m )" in
- i?86) ARCH=i486; GARCH=386 ;;
- x86_64) ARCH=x86_64; GARCH=amd64 ;;
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i486 ;;
+ arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
-esac
+ esac
+fi
+
+if [ "$ARCH" = "i486" ]; then
+ LIBDIRSUFFIX=""
+ GARCH="386"
+elif [ "$ARCH" = "x86_64" ]; then
+ LIBDIRSUFFIX="64"
+ GARCH="amd64"
+elif [ "$ARCH" = "arm" ]; then
+ LIBDIRSUFFIX=""
+ GARCH="arm"
+ export GOARM="6" # can be '5' as well, to use soft float instead of hardware
+else
+ LIBDIRSUFFIX=""
+ GARCH=386
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
@@ -45,9 +64,10 @@ OUTPUT=${OUTPUT:-/tmp}
set -e
rm -rf $PKG
-mkdir -p $TMP $PKG/opt/google $OUTPUT
-cd $PKG/opt/google
-tar -axf $CWD/go.go$VERSION.$RELEASE-$GARCH.tar.gz
+mkdir -p $TMP $PKG/usr/lib${LIBDIRSUFFIX} $OUTPUT
+cd $PKG/usr/lib${LIBDIRSUFFIX}
+tar xvf $CWD/go$VERSION.src.tar.gz
+cd go
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
@@ -55,12 +75,68 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+export GOSRC="$(pwd)"
+export GOROOT="$(pwd)"
+export GOROOT_FINAL="/usr/lib${LIBDIRSUFFIX}/go"
+export GOOS="linux"
+export GOBIN="${GOROOT}/bin"
+export GOARCH="${GARCH}"
+
+mkdir -p "${GOBIN}"
+cd src
+
+LC_ALL=C \
+PATH="$PATH:$GOBIN" \
+./all.bash
+
+cd ..
+
+install -Dm644 misc/bash/go $PKG/etc/bash_completion.d/go
+
+install -Dm644 misc/emacs/go-mode-load.el $PKG/usr/share/emacs/site-lisp/go-mode-load.el
+install -Dm644 misc/emacs/go-mode.el $PKG/usr/share/emacs/site-lisp/go-mode.el
+
+install -Dm644 misc/vim/syntax/go.vim $PKG/usr/share/vim/vimfiles/syntax/go.vim
+install -Dm644 misc/vim/ftdetect/gofiletype.vim $PKG/usr/share/vim/vimfiles/ftdetect/gofiletype.vim
+install -Dm644 misc/vim/ftplugin/go/fmt.vim $PKG/usr/share/vim/vimfiles/ftplugin/go/fmt.vim
+install -Dm644 misc/vim/ftplugin/go/import.vim $PKG/usr/share/vim/vimfiles/ftplugin/go/import.vim
+install -Dm644 misc/vim/indent/go.vim $PKG/usr/share/vim/vimfiles/indent/go.vim
+
+#mkdir -p misc lib src
+mkdir -p $PKG/usr/bin
+
+ln -sf /usr/lib${LIBDIRSUFFIX}/go/bin/go $PKG/usr/bin/go
+ln -sf /usr/lib${LIBDIRSUFFIX}/go/bin/godoc $PKG/usr/bin/godoc
+ln -sf /usr/lib${LIBDIRSUFFIX}/go/bin/gofmt $PKG/usr/bin/gofmt
+
+ln -sf /usr/lib${LIBDIRSUFFIX}/go/pkg/tool/linux_${GOARCH}/cgo $PKG/usr/bin/cgo
+ln -sf /usr/lib${LIBDIRSUFFIX}/go/pkg/tool/linux_${GOARCH}/ebnflint $PKG/usr/bin/ebnflint
+
+# we'll just check for all of they're compilers :-)
+for tool in 8a 8c 8g 8l 6a 6c 6g 6l 5a 5c 5g 5l ; do
+ if [ -x $PKG/usr/lib${LIBDIRSUFFIX}/go/pkg/tool/linux_${GOARCH}/${tool} ] ; then
+ ln -sf /usr/lib${LIBDIRSUFFIX}/go/pkg/tool/linux_${GOARCH}/${tool} $PKG/usr/bin/${tool}
+ fi
+done
+
# Put the profile scripts for setting PATH and env variables
mkdir -p $PKG/etc/profile.d
-install -m0755 -oroot $CWD/go.csh $PKG/etc/profile.d/go.csh.new
-install -m0755 -oroot $CWD/go.sh $PKG/etc/profile.d/go.sh.new
+cat > $PKG/etc/profile.d/go.csh.new << EOF
+#!/bin/csh
+setenv GOOS linux
+setenv GOARCH ${GOARCH}
+setenv GOROOT /usr/lib${LIBDIRSUFFIX}/go
+EOF
+cat > $PKG/etc/profile.d/go.sh.new << EOF
+#!/bin/sh
+export GOOS="linux"
+export GOARCH="${GOARCH}"
+export GOROOT="/usr/lib${LIBDIRSUFFIX}/go"
+EOF
+
+chmod 0755 $PKG/etc/profile.d/go.csh.new
+chmod 0755 $PKG/etc/profile.d/go.sh.new
-cd go
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
AUTHORS CONTRIBUTORS LICENSE PATENTS README VERSION \
diff --git a/development/google-go-lang/google-go-lang.info b/development/google-go-lang/google-go-lang.info
index 03392ced86..1521336311 100644
--- a/development/google-go-lang/google-go-lang.info
+++ b/development/google-go-lang/google-go-lang.info
@@ -1,10 +1,10 @@
PRGNAM="google-go-lang"
-VERSION="1"
+VERSION="1.0.3"
HOMEPAGE="http://golang.org"
-DOWNLOAD="http://go.googlecode.com/files/go.go1.linux-386.tar.gz"
-MD5SUM="a231e69819c85383627d9e47fcff43bf"
-DOWNLOAD_x86_64="http://go.googlecode.com/files/go.go1.linux-amd64.tar.gz"
-MD5SUM_x86_64="64b87563d051007117c854b8eb383230"
+DOWNLOAD="http://go.googlecode.com/files/go1.0.3.src.tar.gz"
+MD5SUM="31acddba58b4592242a3c3c16165866b"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Eric Schultz"
-EMAIL="eric at schultzter dot ca"
+MAINTAINER="Vincent Batts"
+EMAIL="vbatts@hashbangbash.com"