From 930b05fab41e39ed5554dea853ccfac246f0c229 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 28 Oct 2020 19:15:33 +0100 Subject: Add unit tests for dependencies being patched by parent --- var/spack/repos/builtin.mock/packages/libelf/local.patch | 0 var/spack/repos/builtin.mock/packages/libelf/package.py | 2 ++ .../repos/builtin.mock/packages/patch-several-dependencies/package.py | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 var/spack/repos/builtin.mock/packages/libelf/local.patch (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/libelf/local.patch b/var/spack/repos/builtin.mock/packages/libelf/local.patch new file mode 100644 index 0000000000..e69de29bb2 diff --git a/var/spack/repos/builtin.mock/packages/libelf/package.py b/var/spack/repos/builtin.mock/packages/libelf/package.py index 430ae53ab3..6605628965 100644 --- a/var/spack/repos/builtin.mock/packages/libelf/package.py +++ b/var/spack/repos/builtin.mock/packages/libelf/package.py @@ -14,5 +14,7 @@ class Libelf(Package): version('0.8.12', 'e21f8273d9f5f6d43a59878dc274fec7') version('0.8.10', '9db4d36c283d9790d8fa7df1f4d7b4d9') + patch('local.patch', when='@0.8.10') + def install(self, spec, prefix): touch(prefix.libelf) diff --git a/var/spack/repos/builtin.mock/packages/patch-several-dependencies/package.py b/var/spack/repos/builtin.mock/packages/patch-several-dependencies/package.py index 3cda48479e..1495910fb9 100644 --- a/var/spack/repos/builtin.mock/packages/patch-several-dependencies/package.py +++ b/var/spack/repos/builtin.mock/packages/patch-several-dependencies/package.py @@ -15,10 +15,14 @@ class PatchSeveralDependencies(Package): version('2.0', '0123456789abcdef0123456789abcdef') version('1.0', '0123456789abcdef0123456789abcdef') + variant('foo', default=False, + description='Forces a version on libelf') + # demonstrate all the different ways to patch things # single patch file in repo depends_on('libelf', patches='foo.patch') + depends_on('libelf@0.8.10', patches='foo.patch', when='+foo') # using a list of patches in one depends_on depends_on('libdwarf', patches=[ -- cgit v1.2.3-70-g09d2