Last active
November 13, 2022 21:06
-
-
Save notsure2/f8eac873eb7298d89d551047779d8361 to your computer and use it in GitHub Desktop.
How to compile latest qBittorrent-nox with static qt and boost for Debian Stretch 9.0 (using Debian Stretch 9.0)
This file contains hidden or 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/sh | |
set -e | |
apt install -y build-essential git perl python2.7 libboost-all-dev libboost-tools-dev zlib1g-dev autoconf libssl-dev | |
QBITTORRENT_TAG=v4_2_x | |
LIBTORRENT_TAG=RC_1_2 | |
QT5_TAG=5.12 | |
rm -rf work | |
mkdir work | |
cd work | |
git clone https://github.com/qt/qtbase.git --branch $QT5_TAG --single-branch --depth 1 | |
cd qtbase | |
./configure -static -openssl-linked -opensource \ | |
-confirm-license -c++std 14 -no-opengl -no-dbus -no-widgets -no-gui -no-compile-examples \ | |
-prefix `pwd`/../qt-qbittorrent | |
make -j$(nproc) | |
make install | |
cd .. | |
PATH="`pwd`/qt-qbittorrent/bin:$PATH" | |
git clone https://github.com/qt/qttools.git --branch $QT5_TAG --single-branch --depth 1 | |
cd qttools | |
qmake | |
make -j$(nproc) | |
make install | |
cd .. | |
git clone https://github.com/arvidn/libtorrent.git --branch $LIBTORRENT_TAG --single-branch --depth 1 | |
cd libtorrent | |
b2 link=static variant=release boost-link=static dht=on encryption=on crypto=openssl i2p=on extensions=on | |
cd .. | |
git clone https://github.com/qbittorrent/qBittorrent.git --branch $QBITTORRENT_TAG --single-branch --depth 1 | |
cd qBittorrent | |
QT_QMAKE=`pwd`/../qt-qbittorrent/bin \ | |
LDFLAGS="-l:libboost_system.a" \ | |
CXXFLAGS="-std=c++14" \ | |
libtorrent_CFLAGS="-I`pwd`/../libtorrent/include" \ | |
libtorrent_LIBS="-L`pwd`/../libtorrent/bin/gcc-6.3.0/release/boost-link-static/crypto-openssl/link-static/threading-multi -l:libtorrent.a" \ | |
./configure --disable-gui --disable-qt-dbus | |
sed -i 's/-lboost_system//' conf.pri | |
make -j$(nproc) | |
cd ../.. | |
cp ./work/qBittorrent/src/qbittorrent-nox . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are several improvements that could be made for this script:
apt install
line lackspkg-config
, without it the qBittorrent build command (line 38) will crash on Debian 9.0.1 Liveb2
command could be sped up by adding-j$(nproc)
to the end of itstrip
after building the binary. For example, runningstrip ./qbittorrent-nox -o ./qbittorrent-nox-stripped
will create a stripped binary and keep the old one.