summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/packaging_guide.rst20
-rw-r--r--lib/spack/spack/cmd/create.py3
-rw-r--r--lib/spack/spack/directives.py6
-rw-r--r--lib/spack/spack/provider_index.py10
4 files changed, 32 insertions, 7 deletions
diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst
index 879beb2476..34fcb1e101 100644
--- a/lib/spack/docs/packaging_guide.rst
+++ b/lib/spack/docs/packaging_guide.rst
@@ -759,6 +759,26 @@ Fetching a revision
Subversion branches are handled as part of the directory structure, so
you can check out a branch or tag by changing the ``url``.
+Expanding additional resources in the source tree
+-------------------------------------------------
+
+Some packages (most notably compilers) provide optional features if additional
+resources are expanded within their source tree before building. In Spack it is
+possible to describe such a need with the ``resource`` directive :
+
+ .. code-block:: python
+
+ resource(
+ name='cargo',
+ git='https://github.com/rust-lang/cargo.git',
+ tag='0.10.0',
+ destination='cargo'
+ )
+
+Based on the keywords present among the arguments the appropriate ``FetchStrategy``
+will be used for the resource. The keyword ``destination`` is relative to the source
+root of the package and should point to where the resource is to be expanded.
+
Automatic caching of files fetched during installation
------------------------------------------------------
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index 52a82eb38f..aa7c42def0 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -120,7 +120,8 @@ dependencies_dict = {
extends('python')
# FIXME: Add additional dependencies if required.
- # depends_on('py-foo', type=nolink)""",
+ # depends_on('py-setuptools', type='build')
+ # depends_on('py-foo', type=nolink)""",
'R': """\
extends('R')
diff --git a/lib/spack/spack/directives.py b/lib/spack/spack/directives.py
index 313bf48f0d..2a151e0374 100644
--- a/lib/spack/spack/directives.py
+++ b/lib/spack/spack/directives.py
@@ -292,17 +292,17 @@ def resource(pkg, **kwargs):
Define an external resource to be fetched and staged when building the
package. Based on the keywords present in the dictionary the appropriate
FetchStrategy will be used for the resource. Resources are fetched and
- staged in their own folder inside spack stage area, and then linked into
+ staged in their own folder inside spack stage area, and then moved into
the stage area of the package that needs them.
List of recognized keywords:
* 'when' : (optional) represents the condition upon which the resource is
needed
- * 'destination' : (optional) path where to link the resource. This path
+ * 'destination' : (optional) path where to move the resource. This path
must be relative to the main package stage area.
* 'placement' : (optional) gives the possibility to fine tune how the
- resource is linked into the main package stage area.
+ resource is moved into the main package stage area.
"""
when = kwargs.get('when', pkg.name)
destination = kwargs.get('destination', "")
diff --git a/lib/spack/spack/provider_index.py b/lib/spack/spack/provider_index.py
index 3f9cd285e7..2be48b43c1 100644
--- a/lib/spack/spack/provider_index.py
+++ b/lib/spack/spack/provider_index.py
@@ -32,6 +32,7 @@ import yaml
from yaml.error import MarkedYAMLError
import spack
+import spack.error
class ProviderIndex(object):
@@ -201,11 +202,10 @@ class ProviderIndex(object):
"error parsing YAML ProviderIndex cache:", str(e))
if not isinstance(yfile, dict):
- raise spack.spec.SpackYAMLError(
- "YAML ProviderIndex was not a dict.")
+ raise ProviderIndexError("YAML ProviderIndex was not a dict.")
if 'provider_index' not in yfile:
- raise spack.spec.SpackYAMLError(
+ raise ProviderIndexError(
"YAML ProviderIndex does not start with 'provider_index'")
index = ProviderIndex()
@@ -291,3 +291,7 @@ def _transform(providers, transform_fun, out_mapping_type=dict):
(name, out_mapping_type([
transform_fun(vpkg, pset) for vpkg, pset in mapiter(mappings)]))
for name, mappings in providers.items())
+
+
+class ProviderIndexError(spack.error.SpackError):
+ """Raised when there is a problem with a ProviderIndex."""