diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-10-26 20:17:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 20:17:32 +0200 |
commit | 30c9ff50dd048573e3cd7a63a8ab9c05c0bee339 (patch) | |
tree | 188f4739697adc00669c75b7e91b1d1e769db97e /var/spack/repos/builtin/packages/nasm/package.py | |
parent | 83ee5001086672a45e140d5858eacc0b8ef90941 (diff) | |
download | spack-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/packages/nasm/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/nasm/package.py | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/nasm/package.py b/var/spack/repos/builtin/packages/nasm/package.py index e7d76b1d8f..5514b26b5e 100644 --- a/var/spack/repos/builtin/packages/nasm/package.py +++ b/var/spack/repos/builtin/packages/nasm/package.py @@ -8,7 +8,7 @@ import os from spack.package import * -class Nasm(Package): +class Nasm(AutotoolsPackage): """NASM (Netwide Assembler) is an 80x86 assembler designed for portability and modularity. It includes a disassembler as well.""" @@ -17,6 +17,8 @@ class Nasm(Package): list_url = "https://www.nasm.us/pub/nasm/releasebuilds" list_depth = 1 + build_system("autotools", conditional("generic", when="platform=windows"), default="autotools") + version("2.15.05", sha256="9182a118244b058651c576baa9d0366ee05983c4d4ae1d9ddd3236a9f2304997") version("2.14.02", sha256="b34bae344a3f2ed93b2ca7bf25f1ed3fb12da89eeda6096e3551fd66adeae9fc") version("2.13.03", sha256="23e1b679d64024863e2991e5c166e19309f0fe58a9765622b35bd31be5b2cc99") @@ -31,11 +33,11 @@ class Nasm(Package): when="@2.13.03 %gcc@8:", ) - patch("msvc.mak.patch", when="@2.15.05 platform=windows") - - conflicts("%intel@:14", when="@2.14:", msg="Intel 14 has immature C11 support") + with when("platform=windows"): + depends_on("perl") + patch("msvc.mak.patch", when="@2.15.05") - depends_on("perl", when="platform=windows") + conflicts("%intel@:14", when="@2.14:", msg="Intel <= 14 lacks support for C11") def patch(self): # Remove flags not recognized by the NVIDIA compiler @@ -51,13 +53,8 @@ class Nasm(Package): "configure", ) - def install(self, spec, prefix): - with working_dir(self.stage.source_path, create=True): - configure(*["--prefix={0}".format(self.prefix)]) - make("V=1") - make("install") - @when("platform=windows") +class GenericBuilder(spack.build_systems.generic.GenericBuilder): def install(self, spec, prefix): with working_dir(self.stage.source_path, create=True): # build NASM with nmake |