aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorMisty De Meo2013-11-21 20:23:47 -0800
committerMisty De Meo2013-11-23 14:38:39 -0800
commit10dd803c67774cad0148474ea4e9cf299f719de9 (patch)
tree8e4377cbcef9ce964c79588ad68889faaff49243 /Library/Formula
parenta9c870f01c03b9a8eba06b5dff759bf9d0b36a3f (diff)
downloadhomebrew-10dd803c67774cad0148474ea4e9cf299f719de9.tar.bz2
libtorrent, rtorrent: build using libstdc++
This requires a private libsigc++, since that library is too widely used to always build using libstdc++. Hopefully this is only a temporary solution. Fixes #23483.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/libtorrent.rb5
-rw-r--r--Library/Formula/rtorrent.rb26
2 files changed, 29 insertions, 2 deletions
diff --git a/Library/Formula/libtorrent.rb b/Library/Formula/libtorrent.rb
index cebc8d3fa..69871615a 100644
--- a/Library/Formula/libtorrent.rb
+++ b/Library/Formula/libtorrent.rb
@@ -6,9 +6,12 @@ class Libtorrent < Formula
sha256 '34317d6783b7f8d0805274c9467475b5432a246c0de8e28fc16e3b0b43f35677'
depends_on 'pkg-config' => :build
- depends_on 'libsigc++'
def install
+ # Currently can't build against libc++; see:
+ # https://github.com/mxcl/homebrew/issues/23483
+ ENV.libstdcxx if ENV.compiler == :clang
+
system "./configure", "--prefix=#{prefix}",
"--disable-debug",
"--disable-dependency-tracking",
diff --git a/Library/Formula/rtorrent.rb b/Library/Formula/rtorrent.rb
index 5017720e3..158cfa2bb 100644
--- a/Library/Formula/rtorrent.rb
+++ b/Library/Formula/rtorrent.rb
@@ -6,11 +6,35 @@ class Rtorrent < Formula
sha256 '9e93ca41beb1afe74ad7ad8013e0d53ae3586c9b0e97263d722f721535cc7310'
depends_on 'pkg-config' => :build
- depends_on 'libsigc++'
+ depends_on 'xz' => :build # for libsigc++
depends_on 'libtorrent'
depends_on 'xmlrpc-c' => :optional
+ # rtorrent gets a private libsigc++ because libtorrent can only build
+ # under libstdc++, but libsigc++ is too widely used for us to force it
+ # to use libstdc++ globally.
+ # This should be removed once libtorrent is fixed to work under libstdc++.
+ # See https://github.com/mxcl/homebrew/issues/23483
+ resource 'libsigcxx' do
+ url 'http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.3/libsigc++-2.3.1.tar.xz'
+ sha256 '67d05852b31fdb267c9fdcecd40b046a11aa54d884435e99e3c60dd20cd60393'
+ end
+
def install
+ ENV.libstdcxx if ENV.compiler == :clang
+
+ resource('libsigcxx').stage do
+ system "./configure", "--prefix=#{libexec}/libsigcxx", "--disable-dependency-tracking"
+ system "make"
+ system "make check"
+ system "make install"
+ end
+
+ # Skip pkg-config, which was having trouble looking into rtorrent's libexec
+ ENV['sigc_CFLAGS'] = "-I#{libexec}/libsigcxx/include/sigc++-2.0 \
+ -I#{libexec}/libsigcxx/lib/sigc++-2.0/include"
+ ENV['sigc_LIBS'] = "-L#{libexec}/libsigcxx/lib -lsigc-2.0"
+
args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"]
args << "--with-xmlrpc-c" if build.with? "xmlrpc-c"
if MacOS.version <= :leopard