Skip to content

Instantly share code, notes, and snippets.

@luxus
Last active March 16, 2016 21:56
Show Gist options
  • Save luxus/f2cf35f04a08e4a41537 to your computer and use it in GitHub Desktop.
Save luxus/f2cf35f04a08e4a41537 to your computer and use it in GitHub Desktop.
class Libtorrent < Formula
desc "BitTorrent library"
homepage "https://github.com/rakshasa/libtorrent"
url "git://github.com/rakshasa/libtorrent.git"
#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
class Rtorrent < Formula
desc "Console-based BitTorrent client"
homepage "https://github.com/rakshasa/rtorrent"
url "git://github.com/rakshasa/rtorrent.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "cppunit" => :build
depends_on "libtorrent"
depends_on "xmlrpc-c" => :optional
# https://github.com/Homebrew/homebrew/issues/24132
fails_with :clang do
cause "Causes segfaults at startup/at random."
end
def install
# Commented out since we're now marked as failing with clang - adamv
# ENV.libstdcxx if ENV.compiler == :clang
args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"]
args << "--with-xmlrpc-c" if build.with? "xmlrpc-c"
if MacOS.version <= :leopard
inreplace "configure" do |s|
s.gsub! ' pkg_cv_libcurl_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.15.4" 2>/dev/null`',
' pkg_cv_libcurl_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.15.4" | sed -e "s/-arch [^-]*/-arch $(uname -m) /" 2>/dev/null`'
end
end
system "sh", "autogen.sh"
system "./configure", *args
system "make"
system "make", "install"
doc.install "doc/rtorrent.rc"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment