Skip to content

Commit

Permalink
gdal-sosi: GDAL/OGR shared plugin for SOSI format (OpenFYBA)
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed May 14, 2014
1 parent c93a2cf commit 0db85d8
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Formula/gdal-sosi.rb
@@ -0,0 +1,52 @@
require "formula"

class GdalSosi < Formula
homepage "http://trac.osgeo.org/gdal/wiki/SOSI"
url "http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz"
sha1 "25efd2bffdea2e841377ca8c1fd49d89d02ac87e"

depends_on "fyba"
depends_on "gdal"

def install
fyba_opt = Formula["fyba"].opt_prefix
(lib/"gdalplugins").mkpath

# cxx flags
args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr
-Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic
-Iogr/ogrsf_frmts/sosi -I#{fyba_opt}/include/fyba]

# source files
Dir['ogr/ogrsf_frmts/sosi/ogrsosi*.c*'].each do |src|
args.concat %W[#{src}]
end

# plugin dylib
args.concat %W[
-dynamiclib
-install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_SOSI.dylib
-current_version #{version}
-compatibility_version #{version}
-o #{lib}/gdalplugins/ogr_SOSI.dylib
-undefined dynamic_lookup
]

# ld flags
args.concat %W[-L#{fyba_opt}/lib -lfyba -lfygm -lfyut]

# build and install shared plugin
system ENV.cxx, *args

end

def caveats; <<-EOS.undent
This formula provides a plugin that allows GDAL or OGR to access geospatial
data stored in its format. In order to use the shared plugin, you will need
to set the following enviroment variable:
export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins
EOS
end
end

0 comments on commit 0db85d8

Please sign in to comment.