gdal: bump revision
Fixes https://github.com/Homebrew/homebrew/pull/41155#issuecomment-118449123 until we can get the version bump done. Closes Homebrew/homebrew#41408. Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
This commit is contained in:
parent
af6a61ecab
commit
f09071f36a
1 changed files with 67 additions and 60 deletions
127
Formula/gdal.rb
127
Formula/gdal.rb
|
@ -1,9 +1,9 @@
|
|||
class Gdal < Formula
|
||||
desc "GDAL: Geospatial Data Abstraction Library"
|
||||
homepage 'http://www.gdal.org/'
|
||||
homepage "http://www.gdal.org/"
|
||||
url "http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz"
|
||||
sha1 "6f3ccbe5643805784812072a33c25be0bbff00db"
|
||||
revision 1
|
||||
sha256 "66bc8192d24e314a66ed69285186d46e6999beb44fc97eeb9c76d82a117c0845"
|
||||
revision 2
|
||||
|
||||
bottle do
|
||||
sha256 "a0fd2413588bac1b4705349796cf1a93a20770ee16ae0044e56bc93ceaa18a72" => :yosemite
|
||||
|
@ -12,39 +12,44 @@ class Gdal < Formula
|
|||
end
|
||||
|
||||
head do
|
||||
url 'https://svn.osgeo.org/gdal/trunk/gdal'
|
||||
depends_on 'doxygen' => :build
|
||||
url "https://svn.osgeo.org/gdal/trunk/gdal"
|
||||
depends_on "doxygen" => :build
|
||||
end
|
||||
|
||||
option 'complete', 'Use additional Homebrew libraries to provide more drivers.'
|
||||
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."
|
||||
option 'enable-mdb', 'Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle).'
|
||||
option "with-complete", "Use additional Homebrew libraries to provide more drivers."
|
||||
option "with-opencl", "Build with OpenCL acceleration."
|
||||
option "with-armadillo", "Build with Armadillo accelerated TPS transforms."
|
||||
option "with-unsupported", "Allow configure to drag in any library it can find. Invoke this at your own risk."
|
||||
option "with-mdb", "Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle)."
|
||||
option "with-libkml", "Build with Google's libkml driver (requires libkml --HEAD or >= 1.3)"
|
||||
option 'with-swig-java', 'Build the swig java bindings'
|
||||
option "with-swig-java", "Build the swig java bindings"
|
||||
|
||||
deprecated_option "enable-opencl" => "with-opencl"
|
||||
deprecated_option "enable-unsupported" => "with-unsupported"
|
||||
deprecated_option "enable-mdb" => "with-mdb"
|
||||
deprecated_option "complete" => "with-complete"
|
||||
|
||||
depends_on :python => :optional
|
||||
if build.with? "python"
|
||||
depends_on :fortran => :build
|
||||
end
|
||||
|
||||
depends_on 'libpng'
|
||||
depends_on 'jpeg'
|
||||
depends_on 'giflib'
|
||||
depends_on 'libtiff'
|
||||
depends_on 'libgeotiff'
|
||||
depends_on 'proj'
|
||||
depends_on 'geos'
|
||||
depends_on "libpng"
|
||||
depends_on "jpeg"
|
||||
depends_on "giflib"
|
||||
depends_on "libtiff"
|
||||
depends_on "libgeotiff"
|
||||
depends_on "proj"
|
||||
depends_on "geos"
|
||||
|
||||
depends_on 'sqlite' # To ensure compatibility with SpatiaLite.
|
||||
depends_on 'freexl'
|
||||
depends_on 'libspatialite'
|
||||
depends_on "sqlite" # To ensure compatibility with SpatiaLite.
|
||||
depends_on "freexl"
|
||||
depends_on "libspatialite"
|
||||
|
||||
depends_on "postgresql" => :optional
|
||||
depends_on "mysql" => :optional
|
||||
|
||||
depends_on 'homebrew/science/armadillo' if build.include? 'enable-armadillo'
|
||||
depends_on "homebrew/science/armadillo" if build.with? "armadillo"
|
||||
|
||||
if build.with? "libkml"
|
||||
depends_on "autoconf" => :build
|
||||
|
@ -52,7 +57,7 @@ class Gdal < Formula
|
|||
depends_on "libtool" => :build
|
||||
end
|
||||
|
||||
if build.include? 'complete'
|
||||
if build.with? "complete"
|
||||
# Raster libraries
|
||||
depends_on "homebrew/science/netcdf" # Also brings in HDF5
|
||||
depends_on "jasper"
|
||||
|
@ -78,15 +83,17 @@ class Gdal < Formula
|
|||
# Extra linking libraries in configure test of armadillo may throw warning
|
||||
# see: https://trac.osgeo.org/gdal/ticket/5455
|
||||
# including prefix lib dir added by Homebrew:
|
||||
# ld: warning: directory not found for option '-L/usr/local/Cellar/gdal/1.11.0/lib'
|
||||
patch do
|
||||
url "https://gist.githubusercontent.com/dakcarto/7abad108aa31a1e53fb4/raw/b56887208fd91d0434d5a901dae3806fb1bd32f8/gdal-armadillo.patch"
|
||||
sha1 "3af1cae94a977d55541adba0d86c697d77bd1320"
|
||||
end if build.include? "enable-armadillo"
|
||||
# ld: warning: directory not found for option "-L/usr/local/Cellar/gdal/1.11.0/lib"
|
||||
if build.with? "armadillo"
|
||||
patch do
|
||||
url "https://gist.githubusercontent.com/dakcarto/7abad108aa31a1e53fb4/raw/b56887208fd91d0434d5a901dae3806fb1bd32f8/gdal-armadillo.patch"
|
||||
sha256 "e6880b9256abe2c289f4b1196792a626c689772390430c36976c0c5e0f339124"
|
||||
end
|
||||
end
|
||||
|
||||
resource 'numpy' do
|
||||
url 'http://downloads.sourceforge.net/project/numpy/NumPy/1.8.1/numpy-1.8.1.tar.gz'
|
||||
sha1 '8fe1d5f36bab3f1669520b4c7d8ab59a21a984da'
|
||||
resource "numpy" do
|
||||
url "https://downloads.sourceforge.net/project/numpy/NumPy/1.8.1/numpy-1.8.1.tar.gz"
|
||||
sha256 "3d722fc3ac922a34c50183683e828052cd9bb7e9134a95098441297d7ea1c7a9"
|
||||
end
|
||||
|
||||
resource "libkml" do
|
||||
|
@ -96,7 +103,7 @@ class Gdal < Formula
|
|||
version "1.3-dev"
|
||||
end
|
||||
|
||||
def get_configure_args
|
||||
def configure_args
|
||||
args = [
|
||||
# Base configuration.
|
||||
"--prefix=#{prefix}",
|
||||
|
@ -154,12 +161,12 @@ class Gdal < Formula
|
|||
webp
|
||||
poppler
|
||||
]
|
||||
if build.include? 'complete'
|
||||
supported_backends.delete 'liblzma'
|
||||
args << '--with-liblzma=yes'
|
||||
args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX}
|
||||
if build.with? "complete"
|
||||
supported_backends.delete "liblzma"
|
||||
args << "--with-liblzma=yes"
|
||||
args.concat supported_backends.map { |b| "--with-" + b + "=" + HOMEBREW_PREFIX }
|
||||
else
|
||||
args.concat supported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'
|
||||
args.concat supported_backends.map { |b| "--without-" + b } if build.without? "unsupported"
|
||||
end
|
||||
|
||||
# The following libraries are either proprietary, not available for public
|
||||
|
@ -191,13 +198,13 @@ class Gdal < Formula
|
|||
rasdaman
|
||||
sosi
|
||||
]
|
||||
args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'
|
||||
args.concat unsupported_backends.map { |b| "--without-" + b } if build.without? "unsupported"
|
||||
|
||||
# Database support.
|
||||
args << (build.with?("postgresql") ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : "--without-pg")
|
||||
args << (build.with?("mysql") ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : "--without-mysql")
|
||||
|
||||
if build.include? 'enable-mdb'
|
||||
if build.with? "mdb"
|
||||
args << "--with-java=yes"
|
||||
# The rpath is only embedded for Oracle (non-framework) installs
|
||||
args << "--with-jvm-lib-add-rpath=yes"
|
||||
|
@ -207,7 +214,7 @@ class Gdal < Formula
|
|||
args << "--with-libkml=#{libexec}" if build.with? "libkml"
|
||||
|
||||
# Python is installed manually to ensure everything is properly sandboxed.
|
||||
args << '--without-python'
|
||||
args << "--without-python"
|
||||
|
||||
# Scripting APIs that have not been re-worked to respect Homebrew prefixes.
|
||||
#
|
||||
|
@ -221,18 +228,18 @@ class Gdal < Formula
|
|||
args << "--without-php"
|
||||
args << "--without-ruby"
|
||||
|
||||
args << (build.include?("enable-opencl") ? "--with-opencl" : "--without-opencl")
|
||||
args << (build.include?("enable-armadillo") ? "--with-armadillo=#{Formula["armadillo"].opt_prefix}" : "--with-armadillo=no")
|
||||
args << (build.with?("opencl") ? "--with-opencl" : "--without-opencl")
|
||||
args << (build.with?("armadillo") ? "--with-armadillo=#{Formula["armadillo"].opt_prefix}" : "--with-armadillo=no")
|
||||
|
||||
return args
|
||||
args
|
||||
end
|
||||
|
||||
def install
|
||||
if build.with? 'python'
|
||||
ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'
|
||||
numpy_args = [ "build", "--fcompiler=gnu95",
|
||||
"install", "--prefix=#{libexec}" ]
|
||||
resource('numpy').stage { system "python", "setup.py", *numpy_args }
|
||||
if build.with? "python"
|
||||
ENV.prepend_create_path "PYTHONPATH", libexec+"lib/python2.7/site-packages"
|
||||
numpy_args = ["build", "--fcompiler=gnu95",
|
||||
"install", "--prefix=#{libexec}"]
|
||||
resource("numpy").stage { system "python", "setup.py", *numpy_args }
|
||||
end
|
||||
|
||||
if build.with? "libkml"
|
||||
|
@ -260,19 +267,19 @@ class Gdal < Formula
|
|||
#
|
||||
# Fortunately, this can be remedied using LDFLAGS.
|
||||
sqlite = Formula["sqlite"]
|
||||
ENV.append 'LDFLAGS', "-L#{sqlite.opt_lib} -lsqlite3"
|
||||
ENV.append 'CFLAGS', "-I#{sqlite.opt_include}"
|
||||
ENV.append "LDFLAGS", "-L#{sqlite.opt_lib} -lsqlite3"
|
||||
ENV.append "CFLAGS", "-I#{sqlite.opt_include}"
|
||||
|
||||
# Reset ARCHFLAGS to match how we build.
|
||||
ENV['ARCHFLAGS'] = "-arch #{MacOS.preferred_arch}"
|
||||
ENV["ARCHFLAGS"] = "-arch #{MacOS.preferred_arch}"
|
||||
|
||||
# Fix hardcoded mandir: http://trac.osgeo.org/gdal/ticket/5092
|
||||
inreplace 'configure', %r[^mandir='\$\{prefix\}/man'$], ''
|
||||
inreplace "configure", %r[^mandir='\$\{prefix\}/man'$], ""
|
||||
|
||||
# These libs are statically linked in vendored libkml and libkml formula
|
||||
inreplace "configure", " -lminizip -luriparser", "" if build.with? "libkml"
|
||||
|
||||
system "./configure", *get_configure_args
|
||||
system "./configure", *configure_args
|
||||
system "make"
|
||||
system "make", "install"
|
||||
|
||||
|
@ -284,28 +291,28 @@ class Gdal < Formula
|
|||
ENV.append_to_cflags "-arch #{Hardware::CPU.arch_32_bit}"
|
||||
end
|
||||
|
||||
cd 'swig/python' do
|
||||
cd "swig/python" do
|
||||
system "python", "setup.py", "install", "--prefix=#{prefix}", "--record=installed.txt", "--single-version-externally-managed"
|
||||
bin.install Dir['scripts/*']
|
||||
bin.install Dir["scripts/*"]
|
||||
end
|
||||
|
||||
if build.with? "swig-java"
|
||||
cd 'swig/java' do
|
||||
cd "swig/java" do
|
||||
inreplace "java.opt", "linux", "darwin"
|
||||
inreplace "java.opt", "#JAVA_HOME = /usr/lib/jvm/java-6-openjdk/", 'JAVA_HOME=$(shell echo $$JAVA_HOME)'
|
||||
inreplace "java.opt", "#JAVA_HOME = /usr/lib/jvm/java-6-openjdk/", "JAVA_HOME=$(shell echo $$JAVA_HOME)"
|
||||
system "make"
|
||||
system "make", "install"
|
||||
end
|
||||
end
|
||||
|
||||
system 'make', 'man' if build.head?
|
||||
system 'make', 'install-man'
|
||||
system "make", "man" if build.head?
|
||||
system "make", "install-man"
|
||||
# Clean up any stray doxygen files.
|
||||
Dir.glob("#{bin}/*.dox") { |p| rm p }
|
||||
end
|
||||
|
||||
def caveats
|
||||
if build.include? 'enable-mdb'
|
||||
if build.with? "mdb"
|
||||
<<-EOS.undent
|
||||
|
||||
To have a functional MDB driver, install supporting .jar files in:
|
||||
|
|
Loading…
Reference in a new issue