diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2019-09-18 13:46:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-18 13:46:45 -0500 |
commit | 680430df0f610e48f5518cc1de17488b2112c3b3 (patch) | |
tree | c0e31dc3fbd15836a46df9e67d686ae0671b1caa | |
parent | 9a7b5ac7cbe5c08d90681e469b535bcbf4e20f0f (diff) | |
download | spack-680430df0f610e48f5518cc1de17488b2112c3b3.tar.gz spack-680430df0f610e48f5518cc1de17488b2112c3b3.tar.bz2 spack-680430df0f610e48f5518cc1de17488b2112c3b3.tar.xz spack-680430df0f610e48f5518cc1de17488b2112c3b3.zip |
Add libkml package (#12836)
* Add libkml package
* googletest needs to be linked to RPATH
-rw-r--r-- | var/spack/repos/builtin/packages/libkml/package.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/libkml/package.py b/var/spack/repos/builtin/packages/libkml/package.py new file mode 100644 index 0000000000..c56f2e5ec5 --- /dev/null +++ b/var/spack/repos/builtin/packages/libkml/package.py @@ -0,0 +1,59 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack import * + + +class Libkml(CMakePackage): + """Reference implementation of OGC KML 2.2.""" + + # NOTE: The original libkml repo is https://github.com/google/libkml, + # but this project is dead. See https://github.com/google/libkml/issues/4 + + homepage = "https://github.com/libkml/libkml" + url = "https://github.com/libkml/libkml/archive/1.3.0.tar.gz" + + version('1.3.0', sha256='8892439e5570091965aaffe30b08631fdf7ca7f81f6495b4648f0950d7ea7963') + + variant('java', default=False, description='Build java bindings') + variant('python', default=False, description='Build python bindings') + + extends('jdk', when='+java') + extends('python', when='+python') + + # See DEPENDENCIES + depends_on('cmake@2.8:', type='build') + depends_on('boost@1.44.0:') + depends_on('expat@2.1.0:') + depends_on('minizip@1.2.8:') + depends_on('uriparser') + depends_on('zlib@1.2.8:') + depends_on('googletest@1.7.0:', type='link') + depends_on('swig', when='+java', type='build') + depends_on('swig', when='+python', type='build') + + def cmake_args(self): + spec = self.spec + + args = [] + + if '+java' in spec: + args.append('-DWITH_JAVA:BOOL=ON') + else: + args.append('-DWITH_JAVA:BOOL=OFF') + + if '+python' in spec: + args.append('-DWITH_PYTHON:BOOL=ON') + else: + args.append('-DWITH_PYTHON:BOOL=OFF') + + if self.run_tests: + args.append('-DBUILD_TESTING:BOOL=ON') + args.append('-DGTEST_INCLUDE_DIR:PATH={0}'.format( + spec['googletest'].prefix.include)) + else: + args.append('-DBUILD_TESTING:BOOL=OFF') + + return args |