aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/tinysvm.rb
blob: c421d394f9ce41b27672a683428263777adaf543 (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
require 'formula'

class Tinysvm < Formula
  homepage 'http://chasen.org/~taku/software/TinySVM/'
  url 'http://chasen.org/~taku/software/TinySVM/src/TinySVM-0.09.tar.gz'
  sha1 '9c3c36454c475180ef6646d059376f35549cad08'

  # Use correct compilation flag
  patch :p0 do
    url "https://trac.macports.org/export/94156/trunk/dports/math/TinySVM/files/patch-configure.diff"
    sha1 "9f59314fa743e98d8fe3e887b58a85f25e4df571"
  end

  def install
    # Needed to select proper getopt, per MacPorts
    ENV.append_to_cflags '-D__GNU_LIBRARY__'

    inreplace 'configure', '-O9', '' # clang barfs on -O9

    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--mandir=#{man}",
                          "--disable-shared"
    system "make install"
  end

  test do
    system "#{bin}/svm_learn", "--help"
    system "#{bin}/svm_classify", "--help"
    system "#{bin}/svm_model", "--help"
  end
end