-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathgo.sh
55 lines (50 loc) · 1.18 KB
/
go.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package: go
version: v1.7.3
source: https://github.com/golang/go
tag: go1.7.3
prefer_system: .*
prefer_system_check: |
go list -f '{{context.ReleaseTags}}' runtime | grep go1.7;
if [ $? -ne 0 ]; then printf "go not found, install go >= 1.7 to avoid recompile it"; exit 1; fi
---
#!/bin/sh
case $ARCHITECTURE in
osx*)
GOOS=darwin
GOARCH=amd64
;;
*x86-64)
GOOS=linux
GOARCH=amd64
;;
*)
GOOS=linux
GOARCH=amd64
;;
esac
mkdir ali-go-tmp
pushd ali-go-tmp
TMP_FNAME=$GIT_TAG.$GOOS-$GOARCH.tar.gz
curl -O -L https://golang.org/dl/${TMP_FNAME}
tar zxf $TMP_FNAME
popd
/bin/cp -a ./ali-go-tmp/go/* $INSTALLROOT/.
/bin/rm -rf ali-go-tmp
# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
cat > "$MODULEFILE" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0
# Our environment
setenv GOROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH \$::env(GOROOT)/bin
EoF