macOS Fix for GDAL (#7155)

This commit is contained in:
Elizabeth Fischer 2018-02-03 04:06:35 -05:00 committed by Massimiliano Culpo
parent 4c9521b52b
commit be5fa8f6c2

View file

@ -23,9 +23,10 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
############################################################################## ##############################################################################
from spack import * from spack import *
import sys
class Gdal(Package): class Gdal(AutotoolsPackage):
"""GDAL is a translator library for raster and vector geospatial """GDAL is a translator library for raster and vector geospatial
data formats that is released under an X/MIT style Open Source data formats that is released under an X/MIT style Open Source
license by the Open Source Geospatial Foundation. As a library, license by the Open Source Geospatial Foundation. As a library,
@ -67,9 +68,10 @@ class Gdal(Package):
parallel = False parallel = False
def install(self, spec, prefix): def configure_args(self):
spec = self.spec
args = [] args = []
args.append("--prefix=%s" % prefix)
args.append("--with-liblzma=yes") args.append("--with-liblzma=yes")
args.append("--with-zlib=%s" % spec['zlib'].prefix) args.append("--with-zlib=%s" % spec['zlib'].prefix)
args.append("--with-python=%s" % spec['python'].command.path) args.append("--with-python=%s" % spec['python'].command.path)
@ -88,7 +90,10 @@ def install(self, spec, prefix):
if '+netcdf' in spec: if '+netcdf' in spec:
args.append('--with-netcdf=%s' % spec['netcdf'].prefix) args.append('--with-netcdf=%s' % spec['netcdf'].prefix)
configure(*args) return args
make() @run_after('install')
make("install") def darwin_fix(self):
# The shared library is not installed correctly on Darwin; fix this
if sys.platform == 'darwin':
fix_darwin_install_name(self.prefix.lib)