class LibtorrentRasterbar < Formula desc "C++ bittorrent library with Python bindings" homepage "https://www.libtorrent.org/" url "https://github.com/arvidn/libtorrent/releases/download/libtorrent-1_2_2/libtorrent-rasterbar-1.2.2.tar.gz" sha256 "e579261d7f0acbe82e9b4ce703cb721627cb8075023f8a26405992f489bc6202" bottle do cellar :any sha256 "38fd07ec02a159f140fd6adae4d4798b4a6941edff752047066def05c1313cf1" => :catalina sha256 "7ff39b50964775cdc6add363e5f51c5d4220953cb7815f31935f4efbf3ab8829" => :mojave sha256 "f64fa26332381e8ab3d402a44e65aacb24397f9558692bb8695ee8df612fd116" => :high_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@1.1" 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