summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoffrey Malcolm Oxberry <goxberry@gmail.com>2018-07-29 03:41:58 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-08-06 22:01:50 -0700
commit163fc4cd188cf644f06ef5680b35f7010a3b2059 (patch)
tree46c22291ca98becf985cfa248a45562a87b538de
parent853a3f14c7d4341515e158a9ebc7da23c6828971 (diff)
downloadspack-163fc4cd188cf644f06ef5680b35f7010a3b2059.tar.gz
spack-163fc4cd188cf644f06ef5680b35f7010a3b2059.tar.bz2
spack-163fc4cd188cf644f06ef5680b35f7010a3b2059.tar.xz
spack-163fc4cd188cf644f06ef5680b35f7010a3b2059.zip
apple-libunwind: new package, provides unwind
This commit continues the changes discussed in #8823 by creating a new "apple-libunwind" placeholder package that supplies instructions for how to configure packages.yaml to register Apple's libunwind implementation with spack. This package also provides the "unwind" virtual package representing the libunwind base API. The clang-apple compiler version should be specified in packages.yaml so that apple-unwind is only used with Apple's clang compiler, not the stock LLVM compiler.
-rw-r--r--var/spack/repos/builtin/packages/apple-libunwind/package.py84
1 files changed, 84 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/apple-libunwind/package.py b/var/spack/repos/builtin/packages/apple-libunwind/package.py
new file mode 100644
index 0000000000..1aacf98c2b
--- /dev/null
+++ b/var/spack/repos/builtin/packages/apple-libunwind/package.py
@@ -0,0 +1,84 @@
+##############################################################################
+# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/spack/spack
+# Please also see the NOTICE and LICENSE files for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+from spack import *
+
+
+class AppleLibunwind(Package):
+ """Placeholder package for Apple's analogue to non-GNU libunwind"""
+
+ homepage = "https://opensource.apple.com/source/libunwind/libunwind-35.3/"
+
+ provides('unwind')
+
+ # The 'conflicts' directive only accepts valid spack specs;
+ # platforms cannot be negated -- 'platform!=darwin' is not a valid
+ # spec -- so expressing a conflict for any platform that isn't
+ # Darwin must be expressed by listing a conflict with every
+ # platform that isn't Darwin/macOS
+ conflicts('platform=linux')
+ conflicts('platform=bgq')
+ conflicts('platform=cray')
+
+ # Override the fetcher method to throw a useful error message;
+ # avoids GitHub issue (#7061) in which the opengl placeholder
+ # package threw a generic, uninformative error during the `fetch`
+ # step,
+ @property
+ def fetcher(self):
+ msg = """This package is intended to be a placeholder for Apple's
+ system-provided, non-GNU-compatible libunwind library.
+
+ Add to your packages.yaml:
+
+ packages:
+ apple-libunwind:
+ paths:
+ apple-libunwind@35.3: /usr
+ buildable: False
+
+ """
+ raise InstallError(msg)
+
+ def install(self, spec, prefix):
+ pass
+
+ @property
+ def libs(self):
+ """ Export the Apple libunwind library
+ """
+ libs = find_libraries('libunwind',
+ join_path(self.prefix.lib, 'system'),
+ shared=True, recursive=False)
+ if libs:
+ return libs
+ return None
+
+ @property
+ def headers(self):
+ """ Export the Apple libunwind header
+ """
+ hdrs = HeaderList(find(self.prefix.include, 'libunwind.h',
+ recursive=False))
+ return hdrs or None