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

@ -32,6 +32,9 @@ class Atop(Package):
version('2.2-3', '034dc1544f2ec4e4d2c739d320dc326d')
depends_on('zlib')
depends_on('ncurses')
def install(self, spec, prefix):
make()
mkdirp(prefix.bin)

View file

@ -34,4 +34,6 @@ class Fish(AutotoolsPackage):
url = "http://fishshell.com/files/2.2.0/fish-2.2.0.tar.gz"
list_url = "http://fishshell.com/"
depends_on('ncurses')
version('2.2.0', 'a76339fd14ce2ec229283c53e805faac48c3e99d9e3ede9d82c0554acfc7b77a')

View file

@ -40,3 +40,4 @@ class Hstr(AutotoolsPackage):
depends_on('libtool', type='build')
depends_on('m4', type='build')
depends_on('ncurses@5.9')
depends_on('readline')

View file

@ -36,6 +36,9 @@ class Libtermkey(Package):
version('0.15b', '27689756e6c86c56ae454f2ac259bc3d')
version('0.14', 'e08ce30f440f9715c459060e0e048978')
depends_on('libtool', type='build')
depends_on('ncurses')
def install(self, spec, prefix):
make()
make("install", "PREFIX=" + prefix)

View file

@ -33,3 +33,5 @@ class Nano(AutotoolsPackage):
version('2.6.3', '1213c7f17916e65afefc95054c1f90f9')
version('2.6.2', '58568a4b8a33841d774c25f285fc11c1')
depends_on('ncurses')

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)