diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/gobject-introspection/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/gobject-introspection/package.py | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/gobject-introspection/package.py b/var/spack/repos/builtin/packages/gobject-introspection/package.py index e20688c9e9..5f147cccfc 100644 --- a/var/spack/repos/builtin/packages/gobject-introspection/package.py +++ b/var/spack/repos/builtin/packages/gobject-introspection/package.py @@ -23,6 +23,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +from spack import spack_root class GobjectIntrospection(Package): @@ -44,10 +45,35 @@ class GobjectIntrospection(Package): depends_on("bison", type="build") depends_on("flex", type="build") + # This package creates several scripts from + # toosl/g-ir-tool-template.in. In their original form these + # scripts end up with a sbang line like + # + # `#!/usr/bin/env /path/to/spack/python`. + # + # These scripts are generated and then used as part of the build + # (other packages also use the scripts after they've been + # installed). + # + # The path to the spack python can become too long. Because these + # tools are used as part of the build, the normal hook that fixes + # this problem can't help us. + # This package fixes the problem in two steps: + # - it rewrites the g-ir-tool-template so that its sbang line + # refers directly to spack's python (filter_file step below); and + # - it patches the Makefile.in so that the generated Makefile has an + # extra sed expression in its TOOL_SUBSTITUTION that results in + # an `#!/bin/bash /path/to/spack/bin/sbang` unconditionally being + # inserted into the scripts as they're generated. + patch("sbang.patch") + def install(self, spec, prefix): configure("--prefix=%s" % prefix) # we need to filter this file to avoid an overly long hashbang line - filter_file('@PYTHON@', 'python', + filter_file('#!/usr/bin/env @PYTHON@', '#!@PYTHON@', 'tools/g-ir-tool-template.in') make() make("install") + + def setup_environment(self, spack_env, run_env): + spack_env.set('SPACK_SBANG', "%s/bin/sbang" % spack_root) |