7bd947eb0b
* Use new "url" features * Use keg_only DSL * Use "skip_clean :all" DSL * Whitespace and style cleanups * Make bash invocations less silly * Use new man2-man8 helpers * Remove "FileUtils." since it is included in Formula * Use real names for deps instead of aliases * ENV.x11 now updates path, so remove that from individual brews
29 lines
809 B
Ruby
29 lines
809 B
Ruby
require 'formula'
|
|
|
|
class Libgarmin <Formula
|
|
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
|
|
|
|
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
|
|
system "make install"
|
|
end
|
|
end
|