forked from necromant2005/homebrew-boneyard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlibtorrent.rb
53 lines (46 loc) · 1.54 KB
/
libtorrent.rb
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
class Libtorrent < Formula
desc "BitTorrent library"
homepage "https://github.com/rakshasa/libtorrent"
url "http://rtorrent.net/downloads/libtorrent-0.13.6.tar.gz"
sha256 "2838a08c96edfd936aff8fbf99ecbb930c2bfca3337dd1482eb5fccdb80d5a04"
bottle :disable,
"Cannot be built with Clang so bottle depends on GCC at runtime."
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "cppunit" => :build
depends_on "pkg-config" => :build
depends_on "openssl"
# https://github.com/Homebrew/homebrew/issues/24132
fails_with :clang do
cause "Causes segfaults at startup/at random."
end
def install
# Currently can't build against libc++; see:
# https://github.com/homebrew/homebrew/issues/23483
# https://github.com/rakshasa/libtorrent/issues/47
ENV.libstdcxx if ENV.compiler == :clang
system "sh", "autogen.sh"
system "./configure", "--prefix=#{prefix}",
"--disable-debug",
"--disable-dependency-tracking",
"--with-kqueue",
"--enable-ipv6"
system "make"
system "make", "install"
end
test do
(testpath/"sample.cc").write <<-EOS.undent
#include <iostream>
#include <torrent/torrent.h>
int main(int argc, char* *argv)
{
std::cout << torrent::version();
return 0;
}
EOS
system ENV.cxx, "-o", "sample", "sample.cc", "-ltorrent"
system "./sample"
end
end