Bump Open Babel to 3 (#14738)

This commit is contained in:
Eisuke Kawashima 2020-02-05 12:05:19 +09:00 committed by GitHub
parent 29a01f488c
commit ffdde40f56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,18 +12,24 @@ class Openbabel(CMakePackage):
search, convert, analyze, or store data from molecular modeling, chemistry, search, convert, analyze, or store data from molecular modeling, chemistry,
solid-state materials, biochemistry, or related areas.""" solid-state materials, biochemistry, or related areas."""
homepage = "http://openbabel.org/wiki/Main_Page" homepage = 'https://openbabel.org/wiki/Main_Page'
url = "https://sourceforge.net/projects/openbabel/files/openbabel/2.4.1/openbabel-2.4.1.tar.gz" url = 'https://github.com/openbabel/openbabel/archive/openbabel-3-0-0.tar.gz'
git = 'https://github.com/openbabel/openbabel.git'
version('2.4.1', sha256='204136582cdfe51d792000b20202de8950218d617fd9c6e18cee36706a376dfc') version('master', branch='master')
version('3.0.0', tag='openbabel-3-0-0')
version('2.4.1', tag='openbabel-2-4-1')
version('2.4.0', tag='openbabel-2-4-0')
variant('python', default=True, description='Build Python bindings') variant('python', default=True, description='Build Python bindings')
extends('python', when='+python') extends('python', when='+python')
depends_on('python', type=('build', 'run'), when='+python') depends_on('python', type=('build', 'run'), when='+python')
depends_on('cmake@2.4.8:', type='build') depends_on('cmake@3.1:', type='build')
depends_on('pkgconfig', type='build') depends_on('pkgconfig', type='build')
depends_on('swig@2.0:', type='build', when='+python')
depends_on('boost')
depends_on('cairo') # required to support PNG depiction depends_on('cairo') # required to support PNG depiction
depends_on('eigen@3.0:') # required if using the language bindings depends_on('eigen@3.0:') # required if using the language bindings
depends_on('libxml2') # required to read/write CML files, XML formats depends_on('libxml2') # required to read/write CML files, XML formats
@ -43,6 +49,7 @@ def cmake_args(self):
args.extend([ args.extend([
'-DPYTHON_BINDINGS=ON', '-DPYTHON_BINDINGS=ON',
'-DPYTHON_EXECUTABLE={0}'.format(spec['python'].command.path), '-DPYTHON_EXECUTABLE={0}'.format(spec['python'].command.path),
'-DRUN_SWIG=ON',
]) ])
else: else:
args.append('-DPYTHON_BINDINGS=OFF') args.append('-DPYTHON_BINDINGS=OFF')
@ -56,6 +63,6 @@ def check_install(self):
obabel('-:C1=CC=CC=C1Br', '-omol') obabel('-:C1=CC=CC=C1Br', '-omol')
if '+python' in self.spec: if '+python' in self.spec:
# Attempt to import the Python modules python('-c', 'import openbabel')
for module in ['openbabel', 'pybel']: if self.spec.version < Version('3.0.0'):
python('-c', 'import {0}'.format(module)) python('-c', 'import pybel')