aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libswiften.rb
blob: 647c520500d30d337757d515e4fb061682fb8ee3 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
require 'formula'

class Libswiften < Formula
  homepage 'http://swift.im/swiften'
  url 'http://swift.im/downloads/releases/swift-2.0/swift-2.0.tar.gz'
  sha1 'b04ba098fffb1edc2ef0215957371c249458f0be'

  head do
    url 'git://swift.im/swift'
    depends_on 'lua' => :recommended
  end

  depends_on :python => :build
  depends_on 'scons' => :build
  depends_on 'libidn'
  depends_on 'boost'

  # Patch to include lock from boost. Taken from
  # http://comments.gmane.org/gmane.linux.redhat.fedora.extras.cvs/957411
  def patches; DATA unless build.head?; end

  def install
    boost = Formula.factory("boost")
    libidn = Formula.factory("libidn")

    args = %W[
      -j #{ENV.make_jobs}
      V=1
      optimize=1 debug=0
      allow_warnings=1
      swiften_dll=1
      boost_includedir=#{boost.include}
      boost_libdir=#{boost.lib}
      libidn_includedir=#{libidn.include}
      libidn_libdir=#{libidn.lib}
      SWIFTEN_INSTALLDIR=#{prefix}
    ]

    if build.with? "lua"
      lua = Formula.factory("lua")
      args << "SLUIFT_INSTALLDIR=#{prefix}"
      args << "lua_includedir=#{lua.include}"
      args << "lua_libdir=#{lua.lib}"
    end

    args << prefix

    system "scons", *args
    man1.install 'Swift/Packaging/Debian/debian/swiften-config.1' unless build.stable?
  end

  def test
    system "#{bin}/swiften-config"
  end
end

__END__
--- a/Swiften/EventLoop/EventLoop.cpp
+++ b/Swiften/EventLoop/EventLoop.cpp
@@ -12,6 +12,7 @@
 #include <cassert>
 
 #include <Swiften/Base/Log.h>
+#include <boost/thread/locks.hpp>
 
 
 namespace Swift {