aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/nanomsg.rb
blob: 071f2a31df775575cab7d74cf6b4f9d60d5b00c3 (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
51
52
require 'formula'

class Nanomsg < Formula
  homepage 'http://nanomsg.org'
  url 'http://download.nanomsg.org/nanomsg-0.5-beta.tar.gz'
  sha1 '2826bf58fe29550777dbe610e12ed20d386a6974'

  bottle do
    cellar :any
    sha1 "3a645be193f896f1a3b4f8593c1554656abdc4c1" => :yosemite
    sha1 "874eb890390defb22b89cbf4303d218d384bd9b6" => :mavericks
    sha1 "66775cd465f4351a92cb05824e279ed597b90270" => :mountain_lion
  end

  head do
    url 'https://github.com/nanomsg/nanomsg.git'

    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
  end

  option 'with-test', 'Verify the build with make check'
  option 'with-doc', 'Install man pages'
  option 'without-nanocat', 'Do not install nanocat tool'
  option 'with-debug', 'Compile with debug symbols'

  depends_on 'pkg-config' => :build

  if build.with? 'doc'
    depends_on 'asciidoc' => :build
    depends_on 'xmlto' => :build
  end

  def install
    ENV['XML_CATALOG_FILES'] = "#{etc}/xml/catalog" if build.with? 'doc'

    system './autogen.sh' if build.head?

    args = ["--disable-dependency-tracking",
            "--disable-silent-rules",
            "--prefix=#{prefix}"]
    args << "--disable-nanocat" if build.without? 'nanocat'
    args << "--enable-debug" if build.with? 'debug'
    args << "--enable-doc" if build.with? 'doc'

    system './configure', *args
    system 'make'
    system 'make', '-j1', 'check' if build.with? 'test'
    system 'make', 'install'
  end
end