From be5fa8f6c20ec04c233e90bdaae34849345a5d21 Mon Sep 17 00:00:00 2001 From: Elizabeth Fischer Date: Sat, 3 Feb 2018 04:06:35 -0500 Subject: macOS Fix for GDAL (#7155) --- var/spack/repos/builtin/packages/gdal/package.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/gdal/package.py b/var/spack/repos/builtin/packages/gdal/package.py index 044013c88d..6f55b8b0d0 100644 --- a/var/spack/repos/builtin/packages/gdal/package.py +++ b/var/spack/repos/builtin/packages/gdal/package.py @@ -23,9 +23,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## from spack import * +import sys -class Gdal(Package): +class Gdal(AutotoolsPackage): """GDAL is a translator library for raster and vector geospatial data formats that is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation. As a library, @@ -67,9 +68,10 @@ class Gdal(Package): parallel = False - def install(self, spec, prefix): + def configure_args(self): + spec = self.spec + args = [] - args.append("--prefix=%s" % prefix) args.append("--with-liblzma=yes") args.append("--with-zlib=%s" % spec['zlib'].prefix) args.append("--with-python=%s" % spec['python'].command.path) @@ -88,7 +90,10 @@ class Gdal(Package): if '+netcdf' in spec: args.append('--with-netcdf=%s' % spec['netcdf'].prefix) - configure(*args) + return args - make() - make("install") + @run_after('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) -- cgit v1.2.3-70-g09d2