aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/ode.rb
blob: d7fae02d74956b5feea8d85aa3e1172e4d8e02c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require 'formula'

class Ode < Formula
  homepage 'http://www.ode.org/'
  url 'https://downloads.sourceforge.net/project/opende/ODE/0.13/ode-0.13.tar.bz2'
  sha1 '0279d58cc390ff5cc048f2baf96cff23887f3838'

  head do
    url 'http://opende.svn.sourceforge.net/svnroot/opende/trunk'

    depends_on :autoconf
    depends_on :automake
    depends_on :libtool
  end

  option 'enable-double-precision', 'Compile ODE with double precision'

  depends_on 'pkg-config' => :build

  def install
    args = ["--prefix=#{prefix}",
            "--disable-demos"]
    args << "--enable-double-precision" if build.include? 'enable-double-precision'

    if build.head?
      ENV['LIBTOOLIZE'] = 'glibtoolize'
      inreplace 'autogen.sh', 'libtoolize', '$LIBTOOLIZE'
      system "./autogen.sh"
    end
    system "./configure", *args
    system "make"
    system "make install"
  end
end