summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2022-09-13 13:28:29 -0400
committerGitHub <noreply@github.com>2022-09-13 10:28:29 -0700
commit53a7b49619671a318274cdec43952a1d59f77ff0 (patch)
treec18ccc3a21dd0f90c1734cb8452f7efb6c578221 /var/spack/repos/builtin.mock/packages/attributes-foo/package.py
parent251d86e5ab1dd07c99a9ae8dcb449005fce4cfd9 (diff)
downloadspack-53a7b49619671a318274cdec43952a1d59f77ff0.tar.gz
spack-53a7b49619671a318274cdec43952a1d59f77ff0.tar.bz2
spack-53a7b49619671a318274cdec43952a1d59f77ff0.tar.xz
spack-53a7b49619671a318274cdec43952a1d59f77ff0.zip
Windows rpath support (#31930)
Add a post-install step which runs (only) on Windows to modify an install prefix, adding symlinks to all dependency libraries. Windows does not have the same concept of RPATHs as Linux, but when resolving symbols will check the local directory for dependency libraries; by placing a symlink to each dependency library in the directory with the library that needs it, the package can then use all Spack-built dependencies. Note: * This collects dependency libraries based on Package.rpath, which includes only direct link dependencies * There is no examination of libraries to check what dependencies they require, so all libraries of dependencies are symlinked into any directory of the package which contains libraries
Diffstat (limited to 'var/spack/repos/builtin.mock/packages/attributes-foo/package.py')
-rw-r--r--var/spack/repos/builtin.mock/packages/attributes-foo/package.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/var/spack/repos/builtin.mock/packages/attributes-foo/package.py b/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
index f4bb9059a4..9010c52958 100644
--- a/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
+++ b/var/spack/repos/builtin.mock/packages/attributes-foo/package.py
@@ -2,6 +2,7 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import sys
from spack.package import *
@@ -14,13 +15,12 @@ class AttributesFoo(BundlePackage):
provides("baz")
def install(self, spec, prefix):
- if "platform=windows" in spec:
- lib_suffix = ".lib"
- elif "platform=darwin" in spec:
- lib_suffix = ".dylib"
- else:
- lib_suffix = ".so"
+ lib_suffix = ".so"
+ if sys.platform == "win32":
+ lib_suffix = ".dll"
+ elif sys.platform == "darwin":
+ lib_suffix = ".dylib"
mkdirp(prefix.include)
touch(prefix.include.join("foo.h"))
mkdirp(prefix.include.bar)