From 915f91a6199dfe77481742330194e0f6ee17fb8b Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Thu, 12 May 2016 10:45:58 -0700 Subject: moving go packages to the new path --- var/spack/packages/go/package.py | 49 --------------------- .../packages/the_platinum_searcher/package.py | 19 -------- var/spack/repos/builtin/packages/go/package.py | 50 ++++++++++++++++++++++ .../packages/the_platinum_searcher/package.py | 19 ++++++++ 4 files changed, 69 insertions(+), 68 deletions(-) delete mode 100644 var/spack/packages/go/package.py delete mode 100644 var/spack/packages/the_platinum_searcher/package.py create mode 100644 var/spack/repos/builtin/packages/go/package.py create mode 100644 var/spack/repos/builtin/packages/the_platinum_searcher/package.py (limited to 'var') diff --git a/var/spack/packages/go/package.py b/var/spack/packages/go/package.py deleted file mode 100644 index 4e3f6fa8ec..0000000000 --- a/var/spack/packages/go/package.py +++ /dev/null @@ -1,49 +0,0 @@ -import os -from spack import * - -class Go(Package): - """The golang compiler and build environment""" - 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') - - # to-do, make non-c self-hosting compilers possible - # depends_on('go@:1.4.2', when='@1.5:') - - def install(self, spec, prefix): - os.environ['GOROOT'] = os.getcwd() - os.environ['GOBIN'] = join_path(os.getcwd(), 'bin') - os.environ['GOROOT_FINAL'] = prefix - bash = which('bash') - bash('-c', 'env') - bash('-c', 'pwd') - with working_dir('src'): - #TODO: crutch until the read-only-filesystem bug is fixed upstream - bash('all.bash', fail_on_error=False) - cp = which('cp') - bash('-c', 'cp -r ./* "{}"'.format(prefix)) - - def setup_dependent_environment(self, module, spec, ext_spec): - """Called before go modules' install() methods. - - In most cases, extensions will only need to have one line:: - - go('get', '') - """ - # Add a go command for extensions - module.go = Executable(join_path(spec.prefix.bin, 'go')) - os.environ['GOROOT'] = spec.prefix - - stage_path = os.path.realpath(ext_spec.package.stage.source_path) - print "PREFIX: {}".format(stage_path) - go_paths = [stage_path] - for d in ext_spec.traverse(): - if d.package.extends(self.spec): - go_paths.append(d.prefix) - os.environ['GOPATH'] = ':'.join(go_paths) - - diff --git a/var/spack/packages/the_platinum_searcher/package.py b/var/spack/packages/the_platinum_searcher/package.py deleted file mode 100644 index 1dd54d3b98..0000000000 --- a/var/spack/packages/the_platinum_searcher/package.py +++ /dev/null @@ -1,19 +0,0 @@ -from spack import * - -class ThePlatinumSearcher(Package): - """Fast parallel recursive grep alternative""" - # FIXME: add a proper url for your package's homepage here. - homepage = "https://github.com/monochromegane/the_platinum_searcher" - url = "https://github.com/monochromegane/the_platinum_searcher/archive/v1.7.7.tar.gz" - - version('1.7.7', '08d7265e101bc1427d5d4b9903aa1166') - - depends_on("go") - - def install(self, spec, prefix): - env = which('env') - env() - # Fetch all dependencies - go('get', './...') - # Build pt - go('build') diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py new file mode 100644 index 0000000000..05fce90534 --- /dev/null +++ b/var/spack/repos/builtin/packages/go/package.py @@ -0,0 +1,50 @@ +import os +from spack import * + +class Go(Package): + """The golang compiler and build environment""" + 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') + version('1.5.0', git='https://go.googlesource.com/go', tag='go1.5.0') + + # to-do, make non-c self-hosting compilers possible + depends_on('go@:1.4.2', when='@1.5:') + + def install(self, spec, prefix): + os.environ['GOROOT'] = os.getcwd() + os.environ['GOBIN'] = join_path(os.getcwd(), 'bin') + os.environ['GOROOT_FINAL'] = prefix + bash = which('bash') + bash('-c', 'env') + bash('-c', 'pwd') + with working_dir('src'): + #TODO: crutch until the read-only-filesystem bug is fixed upstream + bash('all.bash', fail_on_error=False) + cp = which('cp') + bash('-c', 'cp -r ./* "{}"'.format(prefix)) + + def setup_dependent_environment(self, module, spec, ext_spec): + """Called before go modules' install() methods. + + In most cases, extensions will only need to have one line:: + + go('get', '') + """ + # Add a go command for extensions + module.go = Executable(join_path(spec.prefix.bin, 'go')) + os.environ['GOROOT'] = spec.prefix + + stage_path = os.path.realpath(ext_spec.package.stage.source_path) + print "PREFIX: {}".format(stage_path) + go_paths = [stage_path] + for d in ext_spec.traverse(): + if d.package.extends(self.spec): + go_paths.append(d.prefix) + os.environ['GOPATH'] = ':'.join(go_paths) + + diff --git a/var/spack/repos/builtin/packages/the_platinum_searcher/package.py b/var/spack/repos/builtin/packages/the_platinum_searcher/package.py new file mode 100644 index 0000000000..1dd54d3b98 --- /dev/null +++ b/var/spack/repos/builtin/packages/the_platinum_searcher/package.py @@ -0,0 +1,19 @@ +from spack import * + +class ThePlatinumSearcher(Package): + """Fast parallel recursive grep alternative""" + # FIXME: add a proper url for your package's homepage here. + homepage = "https://github.com/monochromegane/the_platinum_searcher" + url = "https://github.com/monochromegane/the_platinum_searcher/archive/v1.7.7.tar.gz" + + version('1.7.7', '08d7265e101bc1427d5d4b9903aa1166') + + depends_on("go") + + def install(self, spec, prefix): + env = which('env') + env() + # Fetch all dependencies + go('get', './...') + # Build pt + go('build') -- cgit v1.2.3-60-g2f50