Reduce number of variants, just use system or no-system libs
This commit is contained in:
		| @@ -42,25 +42,19 @@ class Cmake(Package): | ||||
|     version('3.0.2',    'db4c687a31444a929d2fdc36c4dfb95f') | ||||
|     version('2.8.10.2', '097278785da7182ec0aea8769d06860c') | ||||
|  | ||||
|     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')  # NOQA: ignore=E501 | ||||
|     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('ownlibs', default=False, description='Use CMake-provided third-party libraries') | ||||
|     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('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('curl',           when='~ownlibs') | ||||
|     depends_on('expat',          when='~ownlibs') | ||||
|     # depends_on('jsoncpp',        when='~ownlibs')  # circular dependency | ||||
|     depends_on('zlib',           when='~ownlibs') | ||||
|     depends_on('bzip2',          when='~ownlibs') | ||||
|     depends_on('xz',             when='~ownlibs') | ||||
|     depends_on('libarchive',     when='~ownlibs') | ||||
|     depends_on('qt',             when='+qt') | ||||
|     depends_on('python@2.7.11:', when='+doc', type='build') | ||||
|     depends_on('py-sphinx',      when='+doc', type='build') | ||||
| @@ -92,22 +86,21 @@ def install(self, spec, prefix): | ||||
|         # Consistency check | ||||
|         self.validate(spec) | ||||
|  | ||||
|         def variant_to_bool(variant): | ||||
|             return 'system' if variant in spec else 'no-system' | ||||
|  | ||||
|         # configure, build, install: | ||||
|         options = [ | ||||
|             '--prefix={0}'.format(prefix), | ||||
|             '--parallel={0}'.format(make_jobs), | ||||
|             '--{0}-curl'.format(variant_to_bool('+curl')), | ||||
|             '--{0}-expat'.format(variant_to_bool('+expat')), | ||||
|             '--{0}-jsoncpp'.format(variant_to_bool('+jsoncpp')), | ||||
|             '--{0}-zlib'.format(variant_to_bool('+zlib')), | ||||
|             '--{0}-bzip2'.format(variant_to_bool('+bzip2')), | ||||
|             '--{0}-liblzma'.format(variant_to_bool('+xz')), | ||||
|             '--{0}-libarchive'.format(variant_to_bool('+archive')) | ||||
|             # jsoncpp requires CMake to build | ||||
|             # use CMake-provided library to avoid circular dependency | ||||
|             '--no-system-jsoncpp' | ||||
|         ] | ||||
|  | ||||
|         if '+ownlibs' in spec: | ||||
|             # Build and link to the CMake-provided third-party libraries | ||||
|             options.append('--no-system-libs') | ||||
|         else: | ||||
|             # Build and link to the Spack-installed third-party libraries | ||||
|             options.append('--system-libs') | ||||
|  | ||||
|         if '+qt' in spec: | ||||
|             options.append('--qt-gui') | ||||
|         else: | ||||
|   | ||||
| @@ -28,6 +28,7 @@ | ||||
| class Libarchive(Package): | ||||
|     """libarchive: C library and command-line tools for reading and | ||||
|        writing tar, cpio, zip, ISO, and other archive formats.""" | ||||
|  | ||||
|     homepage = "http://www.libarchive.org" | ||||
|     url      = "http://www.libarchive.org/downloads/libarchive-3.1.2.tar.gz" | ||||
|  | ||||
| @@ -36,47 +37,19 @@ class Libarchive(Package): | ||||
|     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') | ||||
|     depends_on('zlib') | ||||
|     depends_on('bzip2') | ||||
|     depends_on('lzma') | ||||
|     depends_on('lz4') | ||||
|     depends_on('xz') | ||||
|     depends_on('lzo') | ||||
|     depends_on('nettle') | ||||
|     depends_on('openssl') | ||||
|     depends_on('libxml2') | ||||
|     depends_on('expat') | ||||
|  | ||||
|     def install(self, spec, 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) | ||||
|         configure('--prefix={0}'.format(prefix)) | ||||
|  | ||||
|         make() | ||||
|         # make('check')  # cannot build test suite with Intel compilers | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Adam J. Stewart
					Adam J. Stewart