diff options
author | John W. Parent <45471568+johnwparent@users.noreply.github.com> | 2022-04-14 15:20:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-14 12:20:41 -0700 |
commit | 2d3a613128d10fbe40c119055795bbf83e26d19f (patch) | |
tree | dd5a2d11212f42ef03ddb268235d15742a43acb1 | |
parent | ce0346abd9d649591bffff0864c5f1ccf85d4b99 (diff) | |
download | spack-2d3a613128d10fbe40c119055795bbf83e26d19f.tar.gz spack-2d3a613128d10fbe40c119055795bbf83e26d19f.tar.bz2 spack-2d3a613128d10fbe40c119055795bbf83e26d19f.tar.xz spack-2d3a613128d10fbe40c119055795bbf83e26d19f.zip |
NASM package: fix install on Windows (#29905)
* Don't rely on NASM's nmake to export install target. Spack
now handles NASM installation; the install tree structure
mimics NASM Windows installer behavior.
* Add dependency on perl
-rw-r--r-- | var/spack/repos/builtin/packages/nasm/package.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/nasm/package.py b/var/spack/repos/builtin/packages/nasm/package.py index ad180ff105..e56fc2661b 100644 --- a/var/spack/repos/builtin/packages/nasm/package.py +++ b/var/spack/repos/builtin/packages/nasm/package.py @@ -2,6 +2,9 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import glob +import os + from spack import * @@ -28,6 +31,8 @@ class Nasm(Package): conflicts('%intel@:14', when='@2.14:', msg="Intel 14 has immature C11 support") + depends_on('perl', when='platform=windows') + def patch(self): # Remove flags not recognized by the NVIDIA compiler if self.spec.satisfies('%nvhpc@:20.11'): @@ -43,7 +48,26 @@ class Nasm(Package): make('install') @when('platform=windows') - def build(self, spec, prefix): + def install(self, spec, prefix): with working_dir(self.stage.source_path, create=True): + # build NASM with nmake touch('asm\\warnings.time') nmake('/f', 'Mkfiles\\msvc.mak') + + # install manually because the nmake file defines + # no install target + # This install tree schema mimics the pattern established + # by the NASM windows installer + build_dir = self.stage.source_path + rdoff_dir = os.path.join(build_dir, 'rdoff') + binaries = glob.glob(os.path.join(build_dir, "*.exe")) + rdoff = glob.glob(os.path.join(rdoff_dir, "*.exe")) + rdoff.extend(glob.glob(os.path.join(rdoff_dir, "*.lib"))) + + for file in binaries: + install(file, self.prefix) + + os.makedirs(self.prefix.rdoff) + + for file in rdoff: + install(file, self.prefix.rdoff) |