编译时间:2016.10.18
文件已打包:ss-qt5_2.7.1.tar.gz

项目主页:https://github.com/shadowsocks/shadowsocks-qt5
wiki页面:https://github.com/shadowsocks/shadowsocks-qt5/wiki/Installation

因为安装页面没有找到debian的发行版,所以我想试试编译。
编译指南:https://github.com/shadowsocks/shadowsocks-qt5/wiki/Compiling

首先安装必要依赖

1
2
3
4
5
➜  ~ sudo apt-get install qt5-qmake qtbase5-dev libqrencode-dev libqtshadowsocks-dev libappindicator-dev libzbar-dev libbotan1.10-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libqtshadowsocks-dev

提示找不到libqtshadowsocks-dev

那就先装其他的

1
2
3
4
5
➜  ~ sudo apt-get install qt5-qmake qtbase5-dev libqrencode-dev libqtshadowsocks libappindicator-dev libzbar-dev libbotan1.10-dev
48 upgraded, 86 newly installed, 0 to remove and 720 not upgraded.
Need to get 60.0 MB of archives.
After this operation, 137 MB of additional disk space will be used.
Do you want to continue? [Y/n]

git clone 源码

1
2
3
4
5
6
7
➜  ss git clone https://github.com/shadowsocks/shadowsocks-qt5
Cloning into 'shadowsocks-qt5'...
remote: Counting objects: 3490, done.
remote: Total 3490 (delta 0), reused 0 (delta 0), pack-reused 3490
Receiving objects: 100% (3490/3490), 6.40 MiB | 1.33 MiB/s, done.
Resolving deltas: 100% (2499/2499), done.
Checking connectivity... done.

编译

然而报错

1
2
3
4
5
6
7
8
9
10
➜  shadowsocks-qt5 git:(master) dpkg-buildpackage -uc -us -b
dpkg-buildpackage: info: source package shadowsocks-qt5
dpkg-buildpackage: info: source version 2.7.0-1
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Symeon Huang <[email protected]>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build shadowsocks-qt5
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 9) qt5-qmake qtbase5-dev libqrencode-dev libqtshadowsocks-dev (>= 1.9.0) libzbar-dev libappindicator-dev libbotan1.10-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

报错信息

1
2
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 9) qt5-qmake qtbase5-dev libqrencode-dev libqtshadowsocks-dev (>= 1.9.0) libzbar-dev libappindicator-dev libbotan1.10-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting

需要libqtshadowsocks-dev

https://github.com/shadowsocks/libQtShadowsocks
https://github.com/shadowsocks/libQtShadowsocks/wiki/Installation

1
2
3
4
5
6
For Debian and other Debian-based distributions, build deb packages via commands below:

sudo apt-get install qt5-qmake qtbase5-dev libbotan1.10-dev #skip this part if you've already installed these packages
dpkg-buildpackage -uc -us -b

Then install libqtshadowsocks and shadowsocks-libqtshadowsocks deb packages using command dpkg -i.

git clone https://github.com/shadowsocks/libQtShadowsocks

apt-get install qt5-qmake qtbase5-dev libbotan1.10-dev

然后准备编译

1
2
3
4
5
6
7
8
9
10
11
cd libQtShadowsocks 
➜ dpkg-buildpackage -uc -us -b
dpkg-buildpackage: info: source package libqtshadowsocks
dpkg-buildpackage: info: source version 1.9.0-1
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Symeon Huang <[email protected]>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build libQtShadowsocks
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 9)
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

没有debhelper包

apt-get install也没有

baidu了一个

https://packages.debian.org/sid/all/debhelper/download

dpkg -i debhelper_10.2.2_all.deb

如果提示有依赖不满足

1
apt-get install -f

然后再

1
dpkg -i debhelper_10.2.2_all.deb

回到libQtShadowsocks的编译

1
2
3
4
5
6
7
8
9
10
11
➜  libQtShadowsocks git:(master) dpkg-buildpackage -uc -us -b 
....
....
....
dpkg-deb: building package 'libqtshadowsocks' in '../libqtshadowsocks_1.9.0-1_amd64.deb'.
dpkg-deb: building package 'libqtshadowsocks-dev' in '../libqtshadowsocks-dev_1.9.0-1_amd64.deb'.
dpkg-deb: building package 'shadowsocks-libqtshadowsocks' in '../shadowsocks-libqtshadowsocks_1.9.0-1_amd64.deb'.
dpkg-genchanges --build=any,all >../libqtshadowsocks_1.9.0-1_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build libQtShadowsocks
dpkg-buildpackage: info: binary-only upload (no source included)

编译成功

在libQtShadowsocks的上级目录出现了四个文件

1
2
3
4
libqtshadowsocks_1.9.0-1_amd64.changes
libqtshadowsocks_1.9.0-1_amd64.deb
libqtshadowsocks-dev_1.9.0-1_amd64.deb
shadowsocks-libqtshadowsocks_1.9.0-1_amd64.deb

挨着dpkg -i 装好即可

回到shadowsocks-qt5目录

编译

1
2
3
4
5
6
7
8
9
10
➜  shadowsocks-qt5 git:(master) dpkg-buildpackage -uc -us -b              
dpkg-buildpackage: info: source package shadowsocks-qt5
dpkg-buildpackage: info: source version 2.7.0-1
dpkg-buildpackage: info: source distribution stable
dpkg-buildpackage: info: source changed by Symeon Huang <[email protected]>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build shadowsocks-qt5
dpkg-checkbuilddeps: error: Unmet build dependencies: libqrencode-dev libzbar-dev libappindicator-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)

继续报错。。

不满足编译的依赖要求:libqrencode-dev libzbar-dev libappindicator-dev

手动安装

1
apt-get install libqrencode-dev libzbar-dev libappindicator-dev

编译

1
2
3
4
5
6
7
8
9
➜  shadowsocks-qt5 git:(master) dpkg-buildpackage -uc -us -b
....
....
....
dpkg-deb: building package 'shadowsocks-qt5' in '../shadowsocks-qt5_2.7.0-1_amd64.deb'.
dpkg-genchanges --build=any,all >../shadowsocks-qt5_2.7.0-1_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build shadowsocks-qt5
dpkg-buildpackage: info: binary-only upload (no source included)

最后,shadowsocks-qt5_2.7.0-1_amd64.deb就出现了。