diff options
| author | Adam Vandenberg | 2010-07-24 21:31:34 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-07-24 21:31:34 -0700 |
| commit | 6980cb8269b27bfb1fb9444db36e96ca7781c5cc (patch) | |
| tree | d4a02c7ac2373241596bbee91e1996dd0c38b1b3 | |
| parent | ac8f668023148442ecd06c27ee2d2b376290e42d (diff) | |
| download | homebrew-6980cb8269b27bfb1fb9444db36e96ca7781c5cc.tar.bz2 | |
Add formula for libgarmin
| -rw-r--r-- | Library/Formula/libgarmin.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Library/Formula/libgarmin.rb b/Library/Formula/libgarmin.rb new file mode 100644 index 000000000..fc6eda401 --- /dev/null +++ b/Library/Formula/libgarmin.rb @@ -0,0 +1,32 @@ +require 'formula' + +class Libgarmin <Formula + head 'http://libgarmin.svn.sourceforge.net/svnroot/libgarmin/libgarmin/dev/' + homepage 'http://libgarmin.sourceforge.net/' + + def install + system "./autosh.sh" unless File.exist? "configure" + system "./configure", "--prefix=#{prefix}" + + # Fix OS X include + inreplace Dir["{src,utils}/*.c"], "#include <malloc.h>", "#include <stdlib.h>" + + # The code for creating 'verison.h' doesn't work on OS X. + inreplace "Makefile" do |s| + s.change_make_var! "BUILT_SOURCES", "" + end + + File.open("version.h","w") do |f| + f.puts "#define LIBVERSION \"libgarmin 0.1\"" + end + + system "make" + + # Yep, need to recreate before make and make install + File.open("version.h","w") do |f| + f.puts "#define LIBVERSION \"libgarmin 0.1\"" + end + + system "make install" + end +end |
