summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRobert Blake <blake14@llnl.gov>2020-09-11 14:00:11 -0700
committerGitHub <noreply@github.com>2020-09-11 16:00:11 -0500
commitafb0883762571a364c9b401334133417a779e484 (patch)
treefa8816ff10ccda75ec09288f4438257eba96b854 /var
parent8ad2cc2acfc2374c9b6bc01cd2f1c8eb97f7c7f0 (diff)
downloadspack-afb0883762571a364c9b401334133417a779e484.tar.gz
spack-afb0883762571a364c9b401334133417a779e484.tar.bz2
spack-afb0883762571a364c9b401334133417a779e484.tar.xz
spack-afb0883762571a364c9b401334133417a779e484.zip
ncurses: adding external support. (#18609)
* ncurses: adding external support. * Update var/spack/repos/builtin/packages/ncurses/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * Update var/spack/repos/builtin/packages/ncurses/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * Update var/spack/repos/builtin/packages/ncurses/package.py Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * Fixing includes. Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/ncurses/package.py46
1 files changed, 39 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py
index abb05284f3..0fe28c1f4e 100644
--- a/var/spack/repos/builtin/packages/ncurses/package.py
+++ b/var/spack/repos/builtin/packages/ncurses/package.py
@@ -4,9 +4,8 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
-from glob import glob
-from os.path import exists, join
-from os import makedirs
+import glob
+import os
class Ncurses(AutotoolsPackage, GNUMirrorPackage):
@@ -20,6 +19,8 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage):
# URL must remain http:// so Spack can bootstrap curl
gnu_mirror_path = "ncurses/ncurses-6.1.tar.gz"
+ executables = [r'^ncursesw?\d*-config$']
+
version('6.2', sha256='30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d')
version('6.1', sha256='aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17')
version('6.0', sha256='f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260')
@@ -36,6 +37,37 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage):
patch('patch_gcc_5.txt', when='@6.0%gcc@5.0:')
patch('sed_pgi.patch', when='@:6.0')
+ @classmethod
+ def determine_version(cls, exe):
+ return Executable(exe)('--version', output=str, error=str).rstrip()
+
+ @classmethod
+ def determine_variants(cls, exes, version):
+ results = []
+ for exe in exes:
+ variants = ''
+ output = Executable(exe)('--libs', output=str, error=str)
+
+ if '-ltinfo' in output:
+ variants += "+termlib"
+
+ output = Executable(exe)('--terminfo-dirs', output=str, error=str)
+ usingSymlinks = False
+ for termDir in output.split(':'):
+ for top, dirs, files in os.walk(termDir):
+ for filename in files:
+ if os.path.islink(os.path.join(top, filename)):
+ usingSymlinks = True
+ break
+ if usingSymlinks:
+ break
+ if usingSymlinks:
+ break
+ if usingSymlinks:
+ variants += '+symlinks'
+ results.append(variants)
+ return results
+
def setup_build_environment(self, env):
env.unset('TERMINFO')
@@ -99,11 +131,11 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage):
make('install')
# fix for packages like hstr that use "#include <ncurses/ncurses.h>"
- headers = glob(join(prefix.include, '*'))
+ headers = glob.glob(os.path.join(prefix.include, '*'))
for p_dir in ['ncurses', 'ncursesw']:
- path = join(prefix.include, p_dir)
- if not exists(path):
- makedirs(path)
+ path = os.path.join(prefix.include, p_dir)
+ if not os.path.exists(path):
+ os.makedirs(path)
for header in headers:
install(header, path)