summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-10-26 20:17:32 +0200
committerGitHub <noreply@github.com>2022-10-26 20:17:32 +0200
commit30c9ff50dd048573e3cd7a63a8ab9c05c0bee339 (patch)
tree188f4739697adc00669c75b7e91b1d1e769db97e /var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
parent83ee5001086672a45e140d5858eacc0b8ef90941 (diff)
downloadspack-30c9ff50dd048573e3cd7a63a8ab9c05c0bee339.tar.gz
spack-30c9ff50dd048573e3cd7a63a8ab9c05c0bee339.tar.bz2
spack-30c9ff50dd048573e3cd7a63a8ab9c05c0bee339.tar.xz
spack-30c9ff50dd048573e3cd7a63a8ab9c05c0bee339.zip
Allow for packages with multiple build-systems (#30738)
This commit extends the DSL that can be used in packages to allow declaring that a package uses different build-systems under different conditions. It requires each spec to have a `build_system` single valued variant. The variant can be used in many context to query, manipulate or select the build system associated with a concrete spec. The knowledge to build a package has been moved out of the PackageBase hierarchy, into a new Builder hierarchy. Customization of the default behavior for a given builder can be obtained by coding a new derived builder in package.py. The "run_after" and "run_before" decorators are now applied to methods on the builder. They can also incorporate a "when=" argument to specify that a method is run only when certain conditions apply. For packages that do not define their own builder, forwarding logic is added between the builder and package (methods not found in one will be retrieved from the other); this PR is expected to be fully backwards compatible with unmodified packages that use a single build system.
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py')
-rw-r--r--var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py b/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
index 185fe5552c..ba0b1400a3 100644
--- a/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
+++ b/var/spack/repos/builtin.mock/packages/dev-build-test-install/package.py
@@ -2,19 +2,15 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-
from spack.package import *
-class DevBuildTestInstall(Package):
+class DevBuildTestInstall(MakefilePackage):
homepage = "example.com"
url = "fake.com"
version("0.0.0", sha256="0123456789abcdef0123456789abcdef")
- phases = ["edit", "install"]
-
filename = "dev-build-test-file.txt"
original_string = "This file should be edited"
replacement_string = "This file has been edited"
@@ -26,5 +22,8 @@ class DevBuildTestInstall(Package):
f.truncate()
f.write(self.replacement_string)
+ def build(self, spec, prefix):
+ pass
+
def install(self, spec, prefix):
install(self.filename, prefix)