aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sword.rb
blob: 6c597419859b9480241dd63e76e33b5eda0ab71b (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
require "formula"

class Sword < Formula
  homepage "http://www.crosswire.org/sword/index.jsp"
  url "ftp://ftp.crosswire.org/pub/sword/source/v1.7/sword-1.7.3.tar.gz"
  sha1 "6ecac6364aa098e150cf8851fd8f97d48df21a34"

  bottle do
    sha1 "8fc45d81b7fcc7d1feffdc130f6c139ffc382db4" => :yosemite
    sha1 "148fd1c7b4358bb3f97979022f65b113afabb856" => :mavericks
    sha1 "36eedc14308de364ebfb1e2fecfc86852b65e3cf" => :mountain_lion
  end

  option "with-icu4c", "Uses icu4c for unicode support"
  depends_on "icu4c" => :optional
  option "with-clucene", "Uses clucene for text searching capabilities"
  depends_on "clucene" => :optional

  def install
    args = [
      "--prefix=#{prefix}",
      "--disable-debug",
      "--disable-profile",
      "--disable-tests",
      "--with-curl", # use system curl
    ]

    if build.with? "icu4c"
      args << "--with-icu"
    else
      args << "--without-icu"
    end

    if build.with? "clucene"
      args << "--with-clucene"
    else
      args << "--without-clucene"
    end

    system "./configure", *args
    system "make", "install"
  end

  test do
    # This will call sword's module manager to list remote sources.
    # It should just demonstrate that the lib was correctly installed
    # and can be used by frontends like installmgr.
    system "#{bin}/installmgr", "-s"
  end
end