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:
parent
4bfba146d5
commit
15692c5475
6 changed files with 63 additions and 3 deletions
|
@ -32,6 +32,9 @@ class Atop(Package):
|
||||||
|
|
||||||
version('2.2-3', '034dc1544f2ec4e4d2c739d320dc326d')
|
version('2.2-3', '034dc1544f2ec4e4d2c739d320dc326d')
|
||||||
|
|
||||||
|
depends_on('zlib')
|
||||||
|
depends_on('ncurses')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
make()
|
make()
|
||||||
mkdirp(prefix.bin)
|
mkdirp(prefix.bin)
|
||||||
|
|
|
@ -34,4 +34,6 @@ class Fish(AutotoolsPackage):
|
||||||
url = "http://fishshell.com/files/2.2.0/fish-2.2.0.tar.gz"
|
url = "http://fishshell.com/files/2.2.0/fish-2.2.0.tar.gz"
|
||||||
list_url = "http://fishshell.com/"
|
list_url = "http://fishshell.com/"
|
||||||
|
|
||||||
|
depends_on('ncurses')
|
||||||
|
|
||||||
version('2.2.0', 'a76339fd14ce2ec229283c53e805faac48c3e99d9e3ede9d82c0554acfc7b77a')
|
version('2.2.0', 'a76339fd14ce2ec229283c53e805faac48c3e99d9e3ede9d82c0554acfc7b77a')
|
||||||
|
|
|
@ -40,3 +40,4 @@ class Hstr(AutotoolsPackage):
|
||||||
depends_on('libtool', type='build')
|
depends_on('libtool', type='build')
|
||||||
depends_on('m4', type='build')
|
depends_on('m4', type='build')
|
||||||
depends_on('ncurses@5.9')
|
depends_on('ncurses@5.9')
|
||||||
|
depends_on('readline')
|
||||||
|
|
|
@ -36,6 +36,9 @@ class Libtermkey(Package):
|
||||||
version('0.15b', '27689756e6c86c56ae454f2ac259bc3d')
|
version('0.15b', '27689756e6c86c56ae454f2ac259bc3d')
|
||||||
version('0.14', 'e08ce30f440f9715c459060e0e048978')
|
version('0.14', 'e08ce30f440f9715c459060e0e048978')
|
||||||
|
|
||||||
|
depends_on('libtool', type='build')
|
||||||
|
depends_on('ncurses')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
make()
|
make()
|
||||||
make("install", "PREFIX=" + prefix)
|
make("install", "PREFIX=" + prefix)
|
||||||
|
|
|
@ -33,3 +33,5 @@ class Nano(AutotoolsPackage):
|
||||||
|
|
||||||
version('2.6.3', '1213c7f17916e65afefc95054c1f90f9')
|
version('2.6.3', '1213c7f17916e65afefc95054c1f90f9')
|
||||||
version('2.6.2', '58568a4b8a33841d774c25f285fc11c1')
|
version('2.6.2', '58568a4b8a33841d774c25f285fc11c1')
|
||||||
|
|
||||||
|
depends_on('ncurses')
|
||||||
|
|
|
@ -23,6 +23,10 @@
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
##############################################################################
|
##############################################################################
|
||||||
from spack import *
|
from spack import *
|
||||||
|
from glob import glob
|
||||||
|
from os.path import exists, join
|
||||||
|
from os import makedirs
|
||||||
|
from shutil import copy
|
||||||
|
|
||||||
|
|
||||||
class Ncurses(AutotoolsPackage):
|
class Ncurses(AutotoolsPackage):
|
||||||
|
@ -46,20 +50,65 @@ class Ncurses(AutotoolsPackage):
|
||||||
patch('patch_gcc_5.txt', when='@6.0%gcc@5.0:')
|
patch('patch_gcc_5.txt', when='@6.0%gcc@5.0:')
|
||||||
patch('sed_pgi.patch', when='@:6.0')
|
patch('sed_pgi.patch', when='@:6.0')
|
||||||
|
|
||||||
def configure_args(self):
|
def configure(self, spec, prefix):
|
||||||
opts = [
|
opts = [
|
||||||
'CFLAGS={0}'.format(self.compiler.pic_flag),
|
'CFLAGS={0}'.format(self.compiler.pic_flag),
|
||||||
'CXXFLAGS={0}'.format(self.compiler.pic_flag),
|
'CXXFLAGS={0}'.format(self.compiler.pic_flag),
|
||||||
'--with-shared',
|
'--with-shared',
|
||||||
'--with-cxx-shared',
|
'--with-cxx-shared',
|
||||||
'--enable-widec',
|
|
||||||
'--enable-overwrite',
|
'--enable-overwrite',
|
||||||
'--without-ada',
|
'--without-ada',
|
||||||
'--enable-pc-files',
|
'--enable-pc-files',
|
||||||
'--with-pkg-config-libdir={0}/lib/pkgconfig'.format(self.prefix)
|
'--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:
|
if '+symlinks' in self.spec:
|
||||||
opts.append('--enable-symlinks')
|
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)
|
||||||
|
|
Loading…
Reference in a new issue