Add dependencies to libarchive and cmake

This commit is contained in:
Adam J. Stewart 2016-08-01 11:18:48 -05:00
parent 58d7704060
commit ee5e20dae3
4 changed files with 159 additions and 17 deletions

View file

@ -31,6 +31,7 @@ class Cmake(Package):
homepage = 'https://www.cmake.org'
url = 'https://cmake.org/files/v3.4/cmake-3.4.3.tar.gz'
version('3.6.1', 'd6dd661380adacdb12f41b926ec99545')
version('3.6.0', 'aa40fbecf49d99c083415c2411d12db9')
version('3.5.2', '701386a1b5ec95f8d1075ecf96383e02')
version('3.5.1', 'ca051f4a66375c89d1a524e726da0296')
@ -41,19 +42,30 @@ class Cmake(Package):
version('3.0.2', 'db4c687a31444a929d2fdc36c4dfb95f')
version('2.8.10.2', '097278785da7182ec0aea8769d06860c')
variant('ncurses', default=True,
description='Enables the build of the ncurses gui')
variant('openssl', default=True,
description="Enables CMake's OpenSSL features")
variant('qt', default=False, description='Enables the build of cmake-gui')
variant('doc', default=False,
description='Enables the generation of html and man page docs')
variant('curl', default=True, description='Build external curl library')
variant('expat', default=True, description='Build external expat library')
# variant('jsoncpp', default=True, description='Build external jsoncpp library')
variant('zlib', default=True, description='Build external zlib library')
variant('bzip2', default=True, description='Build external bzip2 library')
variant('xz', default=True, description='Build external lzma library')
variant('archive', default=True, description='Build external archive library')
variant('qt', default=False, description='Enables the build of cmake-gui')
variant('doc', default=False, description='Enables the generation of html and man page documentation')
variant('openssl', default=True, description="Enables CMake's OpenSSL features")
variant('ncurses', default=True, description='Enables the build of the ncurses gui')
depends_on('ncurses', when='+ncurses')
depends_on('openssl', when='+openssl')
depends_on('qt', when='+qt')
depends_on('curl', when='+curl')
depends_on('expat', when='+expat')
# depends_on('jsoncpp', when='+jsoncpp') # circular dependency
depends_on('zlib', when='+zlib')
depends_on('bzip2', when='+bzip2')
depends_on('xz', when='+xz')
depends_on('libarchive', when='+archive')
depends_on('qt', when='+qt')
depends_on('python@2.7.11:', when='+doc', type='build')
depends_on('py-sphinx', when='+doc', type='build')
depends_on('py-sphinx', when='+doc', type='build')
depends_on('openssl', when='+openssl')
depends_on('ncurses', when='+ncurses')
def url_for_version(self, version):
"""Handle CMake's version-based custom URLs."""
@ -77,11 +89,51 @@ def install(self, spec, prefix):
self.validate(spec)
# configure, build, install:
options = ['--prefix=%s' % prefix]
options.append('--parallel=%s' % str(make_jobs))
options = [
'--prefix={0}'.format(prefix),
'--parallel={0}'.format(make_jobs)
]
if '+curl' in spec:
options.append('--system-curl')
else:
options.append('--no-system-curl')
if '+expat' in spec:
options.append('--system-expat')
else:
options.append('--no-system-expat')
# if '+jsoncpp' in spec:
# options.append('--system-jsoncpp')
# else:
# options.append('--no-system-jsoncpp')
options.append('--no-system-jsoncpp')
if '+zlib' in spec:
options.append('--system-zlib')
else:
options.append('--no-system-zlib')
if '+bzip2' in spec:
options.append('--system-bzip2')
else:
options.append('--no-system-bzip2')
if '+xz' in spec:
options.append('--system-liblzma')
else:
options.append('--no-system-liblzma')
if '+archive' in spec:
options.append('--system-libarchive')
else:
options.append('--no-system-libarchive')
if '+qt' in spec:
options.append('--qt-gui')
else:
options.append('--no-qt-gui')
if '+doc' in spec:
options.append('--sphinx-html')
@ -91,6 +143,9 @@ def install(self, spec, prefix):
options.append('--')
options.append('-DCMAKE_USE_OPENSSL=ON')
configure(*options)
bootstrap = Executable('./bootstrap')
bootstrap(*options)
make()
make('test')
make('install')

View file

@ -36,8 +36,6 @@ class Jsoncpp(Package):
version('1.7.3', 'aff6bfb5b81d9a28785429faa45839c5')
# Avoid circular dependency
#depends_on('cmake~jsoncpp', type='build')
depends_on('cmake', type='build')
# depends_on('python', type='test')

View file

@ -31,11 +31,52 @@ class Libarchive(Package):
homepage = "http://www.libarchive.org"
url = "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz"
version('3.2.1', 'afa257047d1941a565216edbf0171e72')
version('3.1.2', 'efad5a503f66329bb9d2f4308b5de98a')
version('3.1.1', '1f3d883daf7161a0065e42a15bbf168f')
version('3.1.0', '095a287bb1fd687ab50c85955692bf3a')
variant('zlib', default=True, description='Build support for gzip through zlib')
variant('bzip2', default=True, description='Build support for bzip2 through bz2lib')
variant('lzma', default=True, description='Build support for lzma through lzmadec')
variant('lz4', default=True, description='Build support for lz4 through liblz4')
variant('xz', default=True, description='Build support for xz through lzma')
variant('lzo', default=True, description='Build support for lzop through liblzo2')
variant('nettle', default=True, description='Build with crypto support from Nettle')
variant('openssl', default=True, description='Build support for mtree and xar hashes through openssl')
variant('libxml2', default=True, description='Build support for xar through libxml2')
variant('expat', default=True, description='Build support for xar through expat')
depends_on('zlib', when='+zlib')
depends_on('bzip2', when='+bzip2')
depends_on('lzma', when='+lzma')
depends_on('lz4', when='+lz4')
depends_on('xz', when='+xz')
depends_on('lzo', when='+lzo')
depends_on('nettle', when='+nettle')
depends_on('openssl', when='+openssl')
depends_on('libxml2', when='+libxml2')
depends_on('expat', when='+expat')
def install(self, spec, prefix):
configure("--prefix=%s" % prefix)
def variant_to_bool(variant):
return 'with' if variant in spec else 'without'
config_args = [
'--prefix={0}'.format(prefix),
'--{0}-zlib'.format(variant_to_bool('+zlib')),
'--{0}-bz2lib'.format(variant_to_bool('+bzip2')),
'--{0}-lzmadec'.format(variant_to_bool('+lzma')),
'--{0}-lz4'.format(variant_to_bool('+lz4')),
'--{0}-lzma'.format(variant_to_bool('+xz')),
'--{0}-lzo2'.format(variant_to_bool('+lzo')),
'--{0}-nettle'.format(variant_to_bool('+nettle')),
'--{0}-openssl'.format(variant_to_bool('+openssl')),
'--{0}-xml2'.format(variant_to_bool('+libxml2')),
'--{0}-expat'.format(variant_to_bool('+expat'))
]
configure(*config_args)
make()
make("check")
make("install")

View file

@ -0,0 +1,48 @@
##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/llnl/spack
# Please also see the LICENSE file for our notice and the LGPL.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (as
# published by the Free Software Foundation) version 2.1, February 1999.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
# conditions of the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
class Lzma(Package):
"""LZMA Utils are legacy data compression software with high compression
ratio. LZMA Utils are no longer developed, although critical bugs may be
fixed as long as fixing them doesn't require huge changes to the code.
Users of LZMA Utils should move to XZ Utils. XZ Utils support the legacy
.lzma format used by LZMA Utils, and can also emulate the command line
tools of LZMA Utils. This should make transition from LZMA Utils to XZ
Utils relatively easy."""
homepage = "http://tukaani.org/lzma/"
url = "http://tukaani.org/lzma/lzma-4.32.7.tar.gz"
version('4.32.7', '2a748b77a2f8c3cbc322dbd0b4c9d06a')
def install(self, spec, prefix):
configure('--prefix={0}'.format(prefix))
make()
make('check')
make('install')