ncurses package builds ncurses and ncursesw (#3953)

* ncurses package will build ncurses and ncursesw

* Added libs property to ncurses, added fix for hstr

* flake8 is a harsh mistress

* make libs() more robust

* atop depends on ncurses

* fish depends on ncurses

* libtermkey and nano depend on ncurses

* Adjust url spacing
This commit is contained in:
sknigh
2017-04-28 12:57:55 -07:00
committed by Adam J. Stewart
parent 4bfba146d5
commit 15692c5475
6 changed files with 63 additions and 3 deletions

View File

@@ -23,6 +23,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
from glob import glob
from os.path import exists, join
from os import makedirs
from shutil import copy
class Ncurses(AutotoolsPackage):
@@ -46,20 +50,65 @@ class Ncurses(AutotoolsPackage):
patch('patch_gcc_5.txt', when='@6.0%gcc@5.0:')
patch('sed_pgi.patch', when='@:6.0')
def configure_args(self):
def configure(self, spec, prefix):
opts = [
'CFLAGS={0}'.format(self.compiler.pic_flag),
'CXXFLAGS={0}'.format(self.compiler.pic_flag),
'--with-shared',
'--with-cxx-shared',
'--enable-widec',
'--enable-overwrite',
'--without-ada',
'--enable-pc-files',
'--with-pkg-config-libdir={0}/lib/pkgconfig'.format(self.prefix)
]
nwide_opts = ['--without-manpages',
'--without-progs',
'--without-tests']
wide_opts = ['--enable-widec']
if '+symlinks' in self.spec:
opts.append('--enable-symlinks')
return opts
prefix = '--prefix={0}'.format(prefix)
configure = Executable('../configure')
with working_dir('build_ncurses', create=True):
configure(prefix, *(opts + nwide_opts))
with working_dir('build_ncursesw', create=True):
configure(prefix, *(opts + wide_opts))
def build(self, spec, prefix):
with working_dir('build_ncurses'):
make()
with working_dir('build_ncursesw'):
make()
def check(self):
with working_dir('build_ncurses'):
make('check')
with working_dir('build_ncursesw'):
make('check')
def install(self, spec, prefix):
with working_dir('build_ncurses'):
make('install')
with working_dir('build_ncursesw'):
make('install')
# fix for packages like hstr that use "#include <ncurses/ncurses.h>"
headers = glob(join(prefix.include, '*'))
for p_dir in ['ncurses', 'ncursesw']:
path = join(prefix.include, p_dir)
if not exists(path):
makedirs(path)
for header in headers:
copy(header, path)
@property
def libs(self):
return find_libraries(
['libncurses', 'libncursesw'], root=self.prefix, recurse=True)