Last active
December 7, 2017 20:40
-
-
Save mrcnc/fdd218cadf207d6797cb68422ac4d0f0 to your computer and use it in GitHub Desktop.
Homebrew formula for installing GEOS 3.6.1 on macOS/OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Geos < Formula | |
desc "Geometry Engine" | |
homepage "https://trac.osgeo.org/geos" | |
url "http://download.osgeo.org/geos/geos-3.6.1.tar.bz2" | |
sha256 "4a2e4e3a7a09a7cfda3211d0f4a235d9fd3176ddf64bd8db14b4ead266189fc5" | |
bottle do | |
cellar :any | |
sha256 "02aa28dcfd38747e924fa486b1607c90ddf5e18c7a400510e3d7f12ef6b90d86" => :sierra | |
sha256 "b4f3fd82b0f39f109ff3da7d5027471c8c2bc8f39bc24198af145df9d3576a71" => :el_capitan | |
sha256 "5b20acb4dfa59515be97f9f731f497c59d11deee2547ca61191b0da4eb8cf735" => :yosemite | |
end | |
option :universal | |
option :cxx11 | |
option "with-php", "Build the PHP extension" | |
option "without-python", "Do not build the Python extension" | |
option "with-ruby", "Build the ruby extension" | |
depends_on "swig" => :build if build.with?("python") || build.with?("ruby") | |
def install | |
ENV.universal_binary if build.universal? | |
ENV.cxx11 if build.cxx11? | |
# https://trac.osgeo.org/geos/ticket/771 | |
inreplace "configure" do |s| | |
s.gsub! /PYTHON_CPPFLAGS=.*/, %Q(PYTHON_CPPFLAGS="#{`python-config --includes`.strip}") | |
s.gsub! /PYTHON_LDFLAGS=.*/, 'PYTHON_LDFLAGS="-Wl,-undefined,dynamic_lookup"' | |
end | |
args = [ | |
"--disable-dependency-tracking", | |
"--prefix=#{prefix}", | |
] | |
args << "--enable-php" if build.with?("php") | |
args << "--enable-python" if build.with?("python") | |
args << "--enable-ruby" if build.with?("ruby") | |
system "./configure", *args | |
system "make", "install" | |
end | |
test do | |
system "#{bin}/geos-config", "--libs" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment