Add Python/Ruby bindings to GEOS package (#8218)
* Add python/ruby bindings to GEOS package * Add comment on Python 3 support
This commit is contained in:
parent
ac2b0f3ac0
commit
fba365dc6a
1 changed files with 35 additions and 20 deletions
|
@ -25,7 +25,7 @@
|
|||
from spack import *
|
||||
|
||||
|
||||
class Geos(Package):
|
||||
class Geos(AutotoolsPackage):
|
||||
"""GEOS (Geometry Engine - Open Source) is a C++ port of the Java
|
||||
Topology Suite (JTS). As such, it aims to contain the complete
|
||||
functionality of JTS in C++. This includes all the OpenGIS
|
||||
|
@ -33,15 +33,12 @@ class Geos(Package):
|
|||
operators, as well as specific JTS enhanced topology functions."""
|
||||
|
||||
homepage = "http://trac.osgeo.org/geos/"
|
||||
url = "http://download.osgeo.org/geos/geos-3.4.2.tar.bz2"
|
||||
url = "http://download.osgeo.org/geos/geos-3.6.2.tar.bz2"
|
||||
|
||||
# Versions from 3.5.1 support Autotools and CMake
|
||||
version('3.6.2', 'a32142343c93d3bf151f73db3baa651f')
|
||||
version('3.6.1', 'c97e338b3bc81f9848656e9d693ca6cc')
|
||||
version('3.6.0', '55de5fdf075c608d2d7b9348179ee649')
|
||||
version('3.5.1', '2e3e1ccbd42fee9ec427106b65e43dc0')
|
||||
|
||||
# Versions through 3.5.0 have CMake, but only Autotools is supported
|
||||
version('3.5.0', '136842690be7f504fba46b3c539438dd')
|
||||
version('3.4.3', '77f2c2cca1e9f49bc1bece9037ac7a7a')
|
||||
version('3.4.2', 'fc5df2d926eb7e67f988a43a92683bae')
|
||||
|
@ -55,21 +52,39 @@ class Geos(Package):
|
|||
version('3.3.4', '1bb9f14d57ef06ffa41cb1d67acb55a1')
|
||||
version('3.3.3', '8454e653d7ecca475153cc88fd1daa26')
|
||||
|
||||
# # Python3 is not supported.
|
||||
# variant('python', default=False, description='Enable Python support')
|
||||
# Ruby bindings are fully supported
|
||||
variant('ruby', default=False, description='Enable Ruby support')
|
||||
|
||||
# extends('python', when='+python')
|
||||
# depends_on('python', when='+python')
|
||||
# depends_on('swig', when='+python')
|
||||
# Since version 3.0, the Python bindings are unsupported
|
||||
variant('python', default=False, description='Enable Python support')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
args = ["--prefix=%s" % prefix]
|
||||
# if '+python' in spec:
|
||||
# os.environ['PYTHON'] = spec['python'].command.path
|
||||
# os.environ['SWIG'] = spec['swig'].command.path
|
||||
#
|
||||
# args.append("--enable-python")
|
||||
extends('ruby', when='+ruby')
|
||||
|
||||
configure(*args)
|
||||
make()
|
||||
make("install")
|
||||
# Python 3 is supposedly supported, but I couldn't get it to work
|
||||
# https://trac.osgeo.org/geos/ticket/774
|
||||
extends('python@:2', when='+python')
|
||||
|
||||
depends_on('swig', type='build', when='+ruby')
|
||||
depends_on('swig', type='build', when='+python')
|
||||
|
||||
# `make check` fails with:
|
||||
# FAIL: geos_unit
|
||||
|
||||
# I wasn't able to get the ruby bindings working.
|
||||
# It resulted in "Undefined symbols for architecture x86_64".
|
||||
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
args = []
|
||||
|
||||
if '+ruby' in spec:
|
||||
args.append('--enable-ruby')
|
||||
else:
|
||||
args.append('--disable-ruby')
|
||||
|
||||
if '+python' in spec:
|
||||
args.append('--enable-python')
|
||||
else:
|
||||
args.append('--disable-python')
|
||||
|
||||
return args
|
||||
|
|
Loading…
Reference in a new issue