Skip to content
Snippets Groups Projects
Commit 9af155f0 authored by Adam J. Stewart's avatar Adam J. Stewart Committed by Peter Scheibel
Browse files

Fix some Mac constraint checks (#12138)

* Fix Mac platform check for dependency in py-ipython package: 'when'
  constraints in Spack directives must be Specs (either a Spec
  object or a Spec in string format)
* Fix Mac version check in py-numpy: platform.mac_ver() returns a
  3-part string as its first tuple item so the check as written would
  never pass; use Spack Version object to simplify check.
* Fix Mac version check in qt package (the check was incorrectly
  comparing ints and strings) and use Spack version object to
  simplify check.
parent e7d9a6f4
Branches
Tags
No related merge requests found
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import * from spack import *
import sys
import platform
class PyIpython(PythonPackage): class PyIpython(PythonPackage):
...@@ -32,9 +30,6 @@ class PyIpython(PythonPackage): ...@@ -32,9 +30,6 @@ class PyIpython(PythonPackage):
depends_on('py-decorator', type=('build', 'run')) depends_on('py-decorator', type=('build', 'run'))
depends_on('py-pexpect', type=('build', 'run')) depends_on('py-pexpect', type=('build', 'run'))
depends_on('py-backcall', type=('build', 'run'), when="^python@3.3:") depends_on('py-backcall', type=('build', 'run'), when="^python@3.3:")
depends_on('py-appnope', type=('build', 'run'), when='platform=darwin')
depends_on('py-appnope', type=('build', 'run'),
when=sys.platform == 'darwin' and
int(platform.mac_ver()[0].split('.')[1]) >= 9)
conflicts('^python@2.7:2.8', when='@7.0.0:') conflicts('^python@2.7:2.8', when='@7.0.0:')
...@@ -84,7 +84,8 @@ def patch(self): ...@@ -84,7 +84,8 @@ def patch(self):
def write_library_dirs(f, dirs): def write_library_dirs(f, dirs):
f.write('library_dirs=%s\n' % dirs) f.write('library_dirs=%s\n' % dirs)
if not ((platform.system() == "Darwin") and if not ((platform.system() == "Darwin") and
(platform.mac_ver()[0] == '10.12')): (Version(platform.mac_ver()[0]).up_to(2) == Version(
'10.12'))):
f.write('rpath=%s\n' % dirs) f.write('rpath=%s\n' % dirs)
# for build notes see http://www.scipy.org/scipylib/building/linux.html # for build notes see http://www.scipy.org/scipylib/building/linux.html
......
...@@ -320,8 +320,8 @@ def common_config_args(self): ...@@ -320,8 +320,8 @@ def common_config_args(self):
if '@4' in self.spec and sys.platform == 'darwin': if '@4' in self.spec and sys.platform == 'darwin':
config_args.append('-cocoa') config_args.append('-cocoa')
mac_ver = tuple(platform.mac_ver()[0].split('.')[:2]) mac_ver = Version(platform.mac_ver()[0])
sdkname = 'macosx%s' % '.'.join(mac_ver) sdkname = 'macosx{0}'.format(mac_ver.up_to(2))
sdkpath = which('xcrun')('--show-sdk-path', sdkpath = which('xcrun')('--show-sdk-path',
'--sdk', sdkname, '--sdk', sdkname,
output=str) output=str)
...@@ -338,7 +338,7 @@ def common_config_args(self): ...@@ -338,7 +338,7 @@ def common_config_args(self):
use_clang_platform = True use_clang_platform = True
if use_clang_platform: if use_clang_platform:
config_args.append('-platform') config_args.append('-platform')
if mac_ver >= (10, 9): if mac_ver >= Version('10.9'):
config_args.append('unsupported/macx-clang-libc++') config_args.append('unsupported/macx-clang-libc++')
else: else:
config_args.append('unsupported/macx-clang') config_args.append('unsupported/macx-clang')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment