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

class Transmission < Formula
  homepage 'http://www.transmissionbt.com/'
  url 'http://download.transmissionbt.com/files/transmission-2.82.tar.xz'
  sha1 '1081542e2692147e45dde7c310b793abc4f33f2d'

  option 'with-nls', 'Build with native language support'

  depends_on 'xz' => :build
  depends_on 'pkg-config' => :build # So it will find system libcurl
  depends_on 'curl' if MacOS.version <= :leopard
  depends_on 'libevent'

  if build.with? 'nls'
    depends_on 'intltool' => :build
    depends_on 'gettext'
  end

  def install
    ENV.append 'LDFLAGS', '-framework Foundation -prebind'
    ENV.append 'LDFLAGS', '-liconv'

    args = %W[--disable-dependency-tracking
              --prefix=#{prefix}
              --disable-mac
              --without-gtk]

    args << "--disable-nls" if build.without? 'nls'

    #fixes issue w/ webui files not being found #21151
    #submitted upstream: https://trac.transmissionbt.com/ticket/5304
    inreplace 'libtransmission/platform.c', 'SYS_DARWIN', 'BUILD_MAC_CLIENT'
    inreplace 'libtransmission/utils.c', 'SYS_DARWIN', 'BUILD_MAC_CLIENT'

    system "./configure", *args
    system "make" # Make and install in one step fails
    system "make install"
  end

  def caveats; <<-EOS.undent
    This formula only installs the command line utilities.
    Transmission.app can be downloaded from Transmission's website:
      http://www.transmissionbt.com
    EOS
  end
end