diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/protobuf/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/protobuf/package.py | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index 50b190f70e..4183330938 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -25,31 +25,29 @@ from spack import * -class Protobuf(AutotoolsPackage): +class Protobuf(CMakePackage): """Google's data interchange format.""" homepage = "https://developers.google.com/protocol-buffers" url = "https://github.com/google/protobuf/archive/v3.2.0.tar.gz" + root_cmakelists_dir = "cmake" version('3.2.0', '61d899b8369781f6dd1e62370813392d') version('3.1.0', '14a532a7538551d5def317bfca41dace') version('3.0.2', '845b39e4b7681a2ddfd8c7f528299fbb') - version('2.5.0', '9c21577a03adc1879aba5b52d06e25cf') + # does not build with CMake: + # version('2.5.0', '9c21577a03adc1879aba5b52d06e25cf') - depends_on('automake', type='build') - depends_on('autoconf', type='build') - depends_on('libtool', type='build') - depends_on('m4', type='build') + depends_on('zlib') conflicts('%gcc@:4.6') # Requires c++11 - variant('shared', default=True, description='Build shared libraries.') + # first fixed in 3.4.0: https://github.com/google/protobuf/pull/3406 + patch('pkgconfig.patch', when='@:3.3.2') - def configure_args(self): - if '+shared' in self.spec: - return ['--enable-shared=yes', - '--enable-static=no'] - else: - return ['--enable-shared=no', - '--enable-static=yes', - '--with-pic=yes'] + def cmake_args(self): + args = [ + '-Dprotobuf_BUILD_TESTS:BOOL=OFF', + '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON' + ] + return args |