Last active
September 12, 2020 09:12
-
-
Save sfan5/c9a48cd3d6225e3957040bc79764a3e8 to your computer and use it in GitHub Desktop.
Compiles rtorrent & libtorrent from git statically linked together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for this!