From 62dd040a8fd7f6f8993640156049eeb061efe955 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 16 May 2016 09:30:37 -0700 Subject: add GOPATH support Also fixes flex to depend on bison for its yacc implementation. --- var/spack/repos/builtin/packages/flex/package.py | 5 ++++- var/spack/repos/builtin/packages/go/package.py | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/flex/package.py b/var/spack/repos/builtin/packages/flex/package.py index 926651010f..b778538606 100644 --- a/var/spack/repos/builtin/packages/flex/package.py +++ b/var/spack/repos/builtin/packages/flex/package.py @@ -24,15 +24,18 @@ ############################################################################## from spack import * + class Flex(Package): """Flex is a tool for generating scanners.""" homepage = "http://flex.sourceforge.net/" - url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz" + url = "http://download.sourceforge.net/flex/flex-2.5.39.tar.gz" version('2.6.0', '5724bcffed4ebe39e9b55a9be80859ec') version('2.5.39', 'e133e9ead8ec0a58d81166b461244fde') + depends_on("bison") + def install(self, spec, prefix): configure("--prefix=%s" % prefix) diff --git a/var/spack/repos/builtin/packages/go/package.py b/var/spack/repos/builtin/packages/go/package.py index 90f34dcfc6..f1057e6bed 100644 --- a/var/spack/repos/builtin/packages/go/package.py +++ b/var/spack/repos/builtin/packages/go/package.py @@ -67,4 +67,14 @@ class Go(Package): if os.environ.get('GOROOT', False): tty.warn('GOROOT is set, this is not recommended') - spack_env.set('GOPATH', ext_spec.package.stage.source_path) + + # Set GOPATH to include paths of dependencies + for d in extension_spec.traverse(): + if d.package.extends(self.spec): + spack_env.prepend_path('GOPATH', d.prefix) + + # This *MUST* be first, this is where new code is installed + spack_env.prepend_path('GOPATH', ext_spec.package.stage.source_path) + + # Allow packages to find this when using module or dotkit + run_env.prepend_path('GOPATH', ext_spec.prefix) -- cgit v1.2.3-70-g09d2