summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/go-bootstrap
diff options
context:
space:
mode:
authorTom Scogland <scogland1@llnl.gov>2016-05-17 05:21:11 -0700
committerTom Scogland <scogland1@llnl.gov>2016-05-17 05:21:11 -0700
commitaf4af94203d0dc7cebd110c2bd43707e527c63cb (patch)
treee2f9698f997e0e23009e5fad09a2ec98b4468fb0 /var/spack/repos/builtin/packages/go-bootstrap
parent62dd040a8fd7f6f8993640156049eeb061efe955 (diff)
downloadspack-af4af94203d0dc7cebd110c2bd43707e527c63cb.tar.gz
spack-af4af94203d0dc7cebd110c2bd43707e527c63cb.tar.bz2
spack-af4af94203d0dc7cebd110c2bd43707e527c63cb.tar.xz
spack-af4af94203d0dc7cebd110c2bd43707e527c63cb.zip
rework for gopath and bootstrapping
Diffstat (limited to 'var/spack/repos/builtin/packages/go-bootstrap')
-rw-r--r--var/spack/repos/builtin/packages/go-bootstrap/package.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/go-bootstrap/package.py b/var/spack/repos/builtin/packages/go-bootstrap/package.py
new file mode 100644
index 0000000000..fd0b5bc5d1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/go-bootstrap/package.py
@@ -0,0 +1,51 @@
+import os
+import shutil
+import glob
+from spack import *
+
+# THIS PACKAGE SHOULD NOT EXIST
+# it exists to make up for the inability to:
+# * use an external go compiler
+# * have go depend on itself
+# * have a sensible way to find gccgo without a dep on gcc
+
+class GoBootstrap(Package):
+ """Old C-bootstrapped go to bootstrap real go"""
+ homepage = "https://golang.org"
+ url = "https://go.googlesource.com/go"
+
+ extendable = True
+
+ # temporary fix until tags are pulled correctly
+ version('1.4.2', git='https://go.googlesource.com/go', tag='go1.4.2')
+
+ variant('test',
+ default=True,
+ description="Run tests as part of build, a good idea but quite"
+ " time consuming")
+
+ provides('golang@:1.4.2')
+
+ depends_on('git')
+
+ def install(self, spec, prefix):
+ bash = which('bash')
+ with working_dir('src'):
+ if '+test' in spec:
+ bash('all.bash')
+ else:
+ bash('make.bash')
+
+ try:
+ os.makedirs(prefix)
+ except OSError:
+ pass
+ for f in glob.glob('*'):
+ if os.path.isdir(f):
+ shutil.copytree(f, os.path.join(prefix, f))
+ else:
+ shutil.copy2(f, os.path.join(prefix, f))
+
+ def setup_environment(self, spack_env, run_env):
+ spack_env.set('GOROOT_FINAL', self.spec.prefix)
+