Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipemeamaral/9fef3ab9588177262bc0573bbed71026 to your computer and use it in GitHub Desktop.
Save felipemeamaral/9fef3ab9588177262bc0573bbed71026 to your computer and use it in GitHub Desktop.
Compiling rtorrent on a mac
#!/bin/bash
# Installs the XCode command line tools if you don't have them
xcode-select --install
# Installs brew if you don't have it
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Makes your account the owner of /usr/local, which is preferred on single user Macs
sudo chown -R `whoami` /usr/local
# Installs all the dependencies for building libtorrent and rtorrent
brew install automake libtool boost curl lzlib libsigc++ openssl pkg-config xmlrpc-c
# Uninstall libtorrent-rasterbar if you already have it
brew uninstall libtorrent-rasterbar
# Get the repos
git clone https://github.com/rakshasa/rtorrent.git
git clone https://github.com/rakshasa/libtorrent.git
cd libtorrent
./autogen.sh
# Adds the openssl includes to your build command
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
CC=clang CXX=clang++ CXXFLAGS="-Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++ -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" ./configure
make
# Installs libtorrent to /usr/local/lib
make install
cd ../rtorrent
./autogen.sh
CC=clang CXX=clang++ CXXFLAGS="-Wno-deprecated-declarations -O3 -std=c++11 -stdlib=libc++ -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/openssl/lib" ./configure --with-xmlrpc-c
make
# Installs rtorrent to /usr/local/bin
make install
# Run rtorrent
rtorrent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment