CentOS7 编译 qBittorrent v4.2.1

Linux, 折腾 2020/01/28

最近在群晖Docker的东西转移到软路由上,记录一下CentOS 7 下编译qBittorrent v4.2.1的过程

一、安装依赖

1.安装依赖

yum groupinstall "Development Tools" -y
yum install centos-release-scl -y
yum install devtoolset-8 -y
yum install qt-devel openssl-devel qt5-qtbase-devel qt5-linguist -y

2.启用devtoolset-8

scl enable devtoolset-8 bash

二、安装Boost

wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
tar zxvf boost_1_72_0.tar.gz
cd boost_1_72_0
./bootstrap.sh --prefix=/usr/local/boost
./b2 install --prefix=/usr/local/boost --with=all -j$(($(nproc)-1))

注:安装时有个参数 $(($(nproc)-1)) 表示使用 机器核心数 - 1 个CPU核心进行编译,以免内存占满导致安装失败

一般内存不够,编译出错时会提示

g++: fatal error: Killed signal terminated program cc1plus

三、安装Libtorrent

qBittorrent v4.2.1 需要依赖 Libtorrent v1.1.12

wget https://github.com/arvidn/libtorrent/releases/download/libtorrent_1_1_12/libtorrent-rasterbar-1.1.12.tar.gz
tar xf libtorrent-rasterbar-1.1.12.tar.gz
cd libtorrent-rasterbar-1.1.12
./configure --disable-debug --prefix=/usr --with-boost=/usr/local/boost CXXFLAGS=--std=c++14
make -j$(($(nproc)-1))
make install
ln -s /usr/lib/pkgconfig/libtorrent-rasterbar.pc /usr/lib64/pkgconfig/libtorrent-rasterbar.pc
ln -s /usr/lib/libtorrent-rasterbar.so.9 /usr/lib64/libtorrent-rasterbar.so.9

四、安装qBittorrent

wget --no-check-certificate https://github.com/qbittorrent/qBittorrent/archive/release-4.2.1.tar.gz
tar -xzvf release-4.2.1.tar.gz
cd qBittorrent-release-4.2.1
./configure --prefix=/usr --disable-gui CPPFLAGS=-I/usr/include/qt5 --with-boost=/usr/local/boost CXXFLAGS=--std=c++14
make -j$(($(nproc)-1))
make install


评论(本站已开启评论回复邮件通知功能,请如实填写邮箱以便及时收到回复)