diff options
Diffstat (limited to 'development/google-go-lang/google-go-lang.SlackBuild')
-rw-r--r-- | development/google-go-lang/google-go-lang.SlackBuild | 100 |
1 files changed, 88 insertions, 12 deletions
diff --git a/development/google-go-lang/google-go-lang.SlackBuild b/development/google-go-lang/google-go-lang.SlackBuild index 227a79f273431..10d75370059b4 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 \ |