homebrew-core/Formula/libgarmin.rb

30 lines
810 B
Ruby
Raw Normal View History

2010-07-25 04:31:34 +00:00
require 'formula'
2011-03-10 05:11:03 +00:00
class Libgarmin < Formula
2010-07-25 04:31:34 +00:00
head 'http://libgarmin.svn.sourceforge.net/svnroot/libgarmin/libgarmin/dev/'
homepage 'http://libgarmin.sourceforge.net/'
def rewrite_version
File.open("version.h","w") { |f| f.puts "#define LIBVERSION \"libgarmin 0.1\"" }
end
2010-07-25 04:31:34 +00:00
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
# Yep, need to recreate before make and make install
rewrite_version
system "make"
rewrite_version
2010-07-25 04:31:34 +00:00
system "make install"
end
end