Skip to content

Instantly share code, notes, and snippets.

@sfan5
Last active September 12, 2020 09:12
Show Gist options
  • Save sfan5/c9a48cd3d6225e3957040bc79764a3e8 to your computer and use it in GitHub Desktop.
Save sfan5/c9a48cd3d6225e3957040bc79764a3e8 to your computer and use it in GitHub Desktop.
Compiles rtorrent & libtorrent from git statically linked together
#!/bin/bash -e
LIBTORRENT_BRANCH=master
LIBTORRENT_CONFIG="--disable-debug"
RTORRENT_BRANCH=master
RTORRENT_CONFIG="--disable-debug --enable-ipv6"
# Dependencies on Debian/Ubuntu:
#sudo apt install \
# g++ make autoconf libtool pkg-config \
# zlib1g-dev libssl-dev libcurl4-openssl-dev \
# libncursesw5-dev
[ -f libtorrent.tar.gz ] || \
wget https://github.com/rakshasa/libtorrent/archive/$LIBTORRENT_BRANCH.tar.gz \
-O libtorrent.tar.gz
[ -d libtorrent ] || {
mkdir libtorrent
tar -xz --strip-components=1 -f libtorrent.tar.gz -C libtorrent
}
cd libtorrent
./autogen.sh
./configure $LIBTORRENT_CONFIG --prefix=/ --disable-shared
make -j2
make DESTDIR=$PWD/_install install
sed 's|^prefix=.*|prefix='$PWD/_install'|' -i ./_install/lib/pkgconfig/libtorrent.pc
cd ..
[ -f rtorrent.tar.gz ] || \
wget https://github.com/rakshasa/rtorrent/archive/$RTORRENT_BRANCH.tar.gz \
-O rtorrent.tar.gz
[ -d rtorrent ] || {
mkdir rtorrent
tar -xz --strip-components=1 -f rtorrent.tar.gz -C rtorrent
}
cd rtorrent
./autogen.sh
PKG_CONFIG_PATH=$PWD/../libtorrent/_install/lib/pkgconfig \
./configure $RTORRENT_CONFIG
make -j2
strip --strip-all ./src/rtorrent
cd ..
echo
echo "Done."
echo "To install rtorrent system-wide run:"
echo " \$ cd rtorrent; sudo make install"
@ezpuzz
Copy link

ezpuzz commented Jan 5, 2020

thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment