Skip to content

Instantly share code, notes, and snippets.

@kashif
Created July 24, 2010 20:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kashif/488930 to your computer and use it in GitHub Desktop.
Save kashif/488930 to your computer and use it in GitHub Desktop.
require 'formula'
class Geos <Formula
url 'http://download.osgeo.org/geos/geos-3.2.2.tar.bz2'
homepage 'http://trac.osgeo.org/geos/'
md5 'c5d264acac22fe7720f85dadc1fc17c6'
def options
[
['--enable-python', "Enable build of python module."],
['--enable-ruby', "Enable build of ruby module."]
]
end
depends_on 'swig' if ARGV.include? '--enable-ruby' or ARGV.include? '--enable-python'
def skip_clean? path
path.extname == '.la'
end
def patches
# fix swig version test and location of RUBY_INCLUDE_DIR in configure script
DATA
end
def install
conf_args = ["--prefix=#{prefix}",
"--disable-debug",
"--disable-dependency-tracking"
]
if ARGV.include? '--enable-ruby'
conf_args << "--enable-ruby"
end
if ARGV.include? '--enable-python'
conf_args << "--enable-python"
end
ENV.O3
system "./configure", *conf_args
system "make install"
end
end
__END__
diff --git a/configure b/configure
index 71d81ff..7123691 100755
--- a/configure
+++ b/configure
@@ -16544,9 +16544,9 @@ $as_echo "$swig_version" >&6; }
if test -z "$available_patch" ; then
available_patch=0
fi
- if test $available_major -ne $required_major \
- -o $available_minor -ne $required_minor \
- -o $available_patch -lt $required_patch ; then
+ required_full=`printf %2.2d%2.2d%2.2d%2.2d $required_major $required_minor $required_patch`
+ available_full=`printf %2.2d%2.2d%2.2d%2.2d $available_major $available_minor $available_patch`
+ if test $available_full -lt $required_full; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.28 is required. You have $swig_version. You should look at http://www.swig.org" >&5
$as_echo "$as_me: WARNING: SWIG version >= 1.3.28 is required. You have $swig_version. You should look at http://www.swig.org" >&2;}
SWIG=''
diff --git a/configure b/configure
index 4ec2798..ced01e1 100755
--- a/configure
+++ b/configure
@@ -16883,7 +16883,7 @@ fi
RUBY_BIN_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG["bindir"]'`
- RUBY_INCLUDE_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG["archdir"]'`
+ RUBY_INCLUDE_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG["rubyhdrdir"] || Config::CONFIG["archdir"]'`
RUBY_LIB_DIR=`$RUBY -rrbconfig -e 'puts Config::CONFIG["libdir"]'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment