homebrew-core/Formula/libtorrent-rasterbar.rb
2019-04-15 09:49:53 +02:00

60 lines
1.9 KiB
Ruby

class LibtorrentRasterbar < Formula
desc "C++ bittorrent library by Rasterbar Software"
homepage "https://www.libtorrent.org/"
url "https://github.com/arvidn/libtorrent/releases/download/libtorrent_1_2_0/libtorrent-rasterbar-1.2.0.tar.gz"
sha256 "428eefcf6a603abc0dc87e423dbd60caa00795ece07696b65f8ee8bceaa37c30"
bottle do
cellar :any
sha256 "f5b1d1b4c6561fe52d013577c82e5f17aaac4a21f276cac548eb147f04024d67" => :mojave
sha256 "a4ec8a99c7d9b5cdc2eed416ea098e537afe253604cb4812d27bd99e97b5f4de" => :high_sierra
sha256 "e0ac8e90b53a1eae9c0f48754258d912eb039b053b0cb2c7ca9ba579f5ae2ee6" => :sierra
end
head do
url "https://github.com/arvidn/libtorrent.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "boost"
depends_on "boost-python3"
depends_on "openssl"
depends_on "python"
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--enable-encryption
--enable-python-binding
--with-boost=#{Formula["boost"].opt_prefix}
--with-boost-python=boost_python37-mt
PYTHON=python3
]
if build.head?
system "./bootstrap.sh", *args
else
system "./configure", *args
end
system "make", "install"
libexec.install "examples"
end
test do
system ENV.cxx, "-std=c++11", "-I#{Formula["boost"].include}/boost",
"-L#{lib}", "-ltorrent-rasterbar",
"-L#{Formula["boost"].lib}", "-lboost_system",
"-framework", "SystemConfiguration",
"-framework", "CoreFoundation",
libexec/"examples/make_torrent.cpp", "-o", "test"
system "./test", test_fixtures("test.mp3"), "-o", "test.torrent"
assert_predicate testpath/"test.torrent", :exist?
end
end