aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-11-01 19:03:28 -0700
committerCharlie Sharpsteen2012-11-02 16:53:55 -0700
commite8f1b50977a4764783313271d745a64032a2b26b (patch)
treeae056c040e6c7ef6f45db534a76ee50e59bf65ec /Library
parent5e262c66b3058e820fd95323133f8fc3747a29a7 (diff)
downloadhomebrew-e8f1b50977a4764783313271d745a64032a2b26b.tar.bz2
gdal: Refactor configuration
General cleanup and some specific changes: - Now depends on Homebrew's libtiff and libgeotiff now that BigTIFF support has landed upstream. This should prevent clashes arising from having internal and external copies of these libraries loaded by the same executable as noted in #7054. - Add WebP support to the `--complete` option. - All backends for which there is no suitable stable formula in core are now explicitly listed and disabled using `--without-<backend>` flags during configuration. This behavior may be disabled by using the `--enable-unsupported` flag which allows configure to drag in any libraries that it finds in the user's environment that GDAL enables by default. Previously this behavior was a side-effect of the `--complete` option.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/gdal.rb128
1 files changed, 65 insertions, 63 deletions
diff --git a/Library/Formula/gdal.rb b/Library/Formula/gdal.rb
index 492b3e727..c82322215 100644
--- a/Library/Formula/gdal.rb
+++ b/Library/Formula/gdal.rb
@@ -42,14 +42,16 @@ class Gdal < Formula
option 'without-python', 'Build without Python support (disables a lot of tools).'
option 'enable-opencl', 'Build with OpenCL acceleration.'
option 'enable-armadillo', 'Build with Armadillo accelerated TPS transforms.'
+ option 'enable-unsupported', "Allow configure to drag in any library it can find. Invoke this at your own risk."
# For creating up to date man pages.
depends_on 'doxygen' => :build if build.head?
depends_on :libpng
-
depends_on 'jpeg'
depends_on 'giflib'
+ depends_on 'libtiff'
+ depends_on 'libgeotiff'
depends_on 'proj'
depends_on 'geos'
@@ -68,8 +70,8 @@ class Gdal < Formula
if complete?
# Raster libraries
depends_on "netcdf" # Also brings in HDF5
- depends_on "jasper" # May need a keg-only GeoJasPer library as this one is
- # not geo-spatially enabled.
+ depends_on "jasper"
+ depends_on "webp"
depends_on "cfitsio"
depends_on "epsilon"
depends_on "libdap"
@@ -95,8 +97,6 @@ class Gdal < Formula
"--with-libtool",
# GDAL native backends.
- "--with-libtiff=internal", # For bigTIFF support
- "--with-geotiff=internal",
"--with-pcraster=internal",
"--with-pcidsk=internal",
"--with-bsb",
@@ -104,18 +104,22 @@ class Gdal < Formula
"--with-pam",
# Backends supported by OS X.
+ "--with-libiconv-prefix=/usr",
"--with-libz=/usr",
- "--with-png=#{MacOS::X11.prefix}",
+ "--with-png=#{(MacOS.version >= :mountain_lion) ? HOMEBREW_PREFIX : MacOS::X11.prefix}",
"--with-expat=/usr",
"--with-curl=/usr/bin/curl-config",
# Default Homebrew backends.
"--with-jpeg=#{HOMEBREW_PREFIX}",
- "--with-jpeg12",
+ "--without-jpeg12", # Needs specially configured JPEG and TIFF libraries.
"--with-gif=#{HOMEBREW_PREFIX}",
+ "--with-libtiff=#{HOMEBREW_PREFIX}",
+ "--with-geotiff=#{HOMEBREW_PREFIX}",
"--with-sqlite3=#{HOMEBREW_PREFIX}",
"--with-freexl=#{HOMEBREW_PREFIX}",
"--with-spatialite=#{HOMEBREW_PREFIX}",
+ "--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config",
# GRASS backend explicitly disabled. Creates a chicken-and-egg problem.
# Should be installed separately after GRASS installation using the
@@ -124,64 +128,65 @@ class Gdal < Formula
"--without-libgrass"
]
- # Optional library support for additional formats.
+ # Optional Homebrew packages supporting additional formats.
+ supported_backends = %w[
+ liblzma
+ cfitsio
+ hdf5
+ netcdf
+ jasper
+ xerces
+ odbc
+ dods-root
+ epsilon
+ webp
+ poppler
+ ]
if complete?
- args.concat [
- "--with-liblzma=yes",
- "--with-netcdf=#{HOMEBREW_PREFIX}",
- "--with-hdf5=#{HOMEBREW_PREFIX}",
- "--with-jasper=#{HOMEBREW_PREFIX}",
- "--with-cfitsio=#{HOMEBREW_PREFIX}",
- "--with-epsilon=#{HOMEBREW_PREFIX}",
- "--with-odbc=#{HOMEBREW_PREFIX}",
- "--with-xerces=#{HOMEBREW_PREFIX}",
- "--with-dods-root=#{HOMEBREW_PREFIX}",
- "--with-poppler=#{HOMEBREW_PREFIX}"
- ]
+ supported_backends.delete 'liblzma'
+ args << '--with-liblzma=yes'
+ args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX}
else
- args.concat [
- "--without-cfitsio",
- "--without-netcdf",
- "--without-ogdi",
- "--without-hdf4",
- "--without-hdf5",
- "--without-openjpeg",
- "--without-jasper",
- "--without-xerces",
- "--without-epsilon",
- "--without-libkml",
- "--without-poppler",
- "--without-podofo",
- "--with-dods-root=no",
-
- # The following libraries are either proprietary or available under
- # non-free licenses. Interested users will have to install such
- # software manually.
- "--without-msg",
- "--without-mrsid",
- "--without-jp2mrsid",
- "--without-kakadu",
- "--without-fme",
- "--without-ecw",
- "--without-dwgdirect"
- ]
+ args.concat supported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'
end
- # Database support.
- args << "--without-pg" unless postgres?
- args << "--without-mysql" unless mysql?
- args << "--without-sde" # ESRI ArcSDE databases
- args << "--without-ingres" # Ingres databases
- args << "--without-oci" # Oracle databases
- args << "--without-idb" # IBM Informix DataBlades
+ # The following libraries are either proprietary, not available for public
+ # download or have no stable version in the Homebrew core that is
+ # compatible with GDAL. Interested users will have to install such software
+ # manually and most likely have to tweak the install routine.
+ #
+ # Podofo is disabled because Poppler provides the same functionality and
+ # then some.
+ unsupported_backends = %w[
+ gta
+ ogdi
+ fme
+ hdf4
+ openjpeg
+ fgdb
+ ecw
+ kakadu
+ mrsid
+ jp2mrsid
+ mrsid_lidar
+ msg
+ oci
+ ingres
+ libkml
+ dwgdirect
+ idb
+ sde
+ podofo
+ rasdaman
+ ]
+ args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'
- # Homebrew-provided databases.
- args << "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" if postgres?
- args << "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" if mysql?
+ # Database support.
+ args << (postgres? ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : '--without-pg')
+ args << (mysql? ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : '--without-mysql')
- args << "--without-python" # Installed using a separate set of
- # steps so that everything winds up
- # in the prefix.
+ # Python is installed manually to ensure everything is properly sandboxed.
+ args << '--without-python'
# Scripting APIs that have not been re-worked to respect Homebrew prefixes.
#
@@ -195,10 +200,7 @@ class Gdal < Formula
args << "--without-php"
args << "--without-ruby"
- # OpenCL support
- args << "--with-opencl" if opencl?
-
- # Armadillo support.
+ args << (opencl? ? '--with-opencl' : '--without-opencl')
args << (armadillo? ? '--with-armadillo=yes' : '--with-armadillo=no')
return args