forked from vnotex/vnote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_linux.sh
102 lines (81 loc) · 3.34 KB
/
.travis_linux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
project_dir=$(pwd)
# Complain when not in Travis environment
if [ -z ${TRAVIS_COMMIT+x} ]; then
echo "This script is intended to be used only in Travis CI environment."
echo "To build VNote from source, please see the [documentation](https://tamlok.github.io/vnote/en_us/#!docs/Developers/Build%20VNote.md)."
exit 1
fi
# Install qt5.9
sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
sudo add-apt-repository ppa:beineri/opt-qt597-trusty -y
sudo apt-get update -qq
sudo apt-get -y install qt59base qt59webengine qt59webchannel qt59svg qt59location qt59tools qt59translations
source /opt/qt*/bin/qt*-env.sh
# Compile qt5ct
wget -c https://jaist.dl.sourceforge.net/project/qt5ct/qt5ct-0.37.tar.bz2
tar xf qt5ct-0.*.tar.bz2
cd qt5ct-0.*/
QT_SELECT=5 qmake
make -j$(nproc) && sudo make install
# Compile newer version fcitx-qt5
sudo apt-get -y install fcitx-libs-dev libgl1-mesa-dev bison
sudo apt-get -y install cmake
wget http://xkbcommon.org/download/libxkbcommon-0.5.0.tar.xz
tar xf libxkbcommon-0.5.0.tar.xz
cd libxkbcommon-0.5.0
./configure -prefix=/usr -libdir=/usr/lib/x86_64-linux-gnu -disable-x11
make -j$(nproc) && sudo make install
git clone git://anongit.kde.org/extra-cmake-modules
cd extra-cmake-modules
mkdir build && cd build
cmake ..
make -j$(nproc) && sudo make install
git clone https://github.com/fcitx/fcitx-qt5
cd fcitx-qt5
git checkout 1.0.5
cmake .
make -j$(nproc) && sudo make install
# Copy fcitx-qt5 files to qt
sudo cp /usr/local/lib/libFcitxQt5DBusAddons.so* /opt/qt*/lib/
sudo cp /usr/local/lib/libFcitxQt5WidgetsAddons.so* /opt/qt*/lib/
tree /opt/qt59/lib/
cd ${project_dir}
mkdir build
cd build
qmake -v
qmake CONFIG+=release -spec linux-g++-64 ../VNote.pro
make -j$(nproc)
#
# Pack AppImage using linuxdeployqt
#
mkdir dist
INSTALL_ROOT=${project_dir}/build/dist make install ; tree dist/
# Copy SVG module
mkdir -p ./dist/usr/plugins/iconengines
mkdir -p ./dist/usr/plugins/imageformats
mkdir -p ./dist/usr/plugins/platforminputcontexts
cp /opt/qt59/plugins/iconengines/* ./dist/usr/plugins/iconengines/
cp /opt/qt59/plugins/imageformats/* ./dist/usr/plugins/imageformats/
cp /opt/qt59/plugins/platforminputcontexts/* ./dist/usr/plugins/platforminputcontexts/
# Copy other project files
cp "${project_dir}/README.md" "dist/README.md"
cp "${project_dir}/LICENSE" "dist/LICENSE"
echo ${version} > ./dist/version
echo "${TRAVIS_COMMIT}" >> ./dist/version
# Get linuxdeployqt tool
git clone https://github.com/tamlok/vnote-utils.git vnote-utils.git
cp vnote-utils.git/linuxdeployqt-continuous-x86_64.AppImage ./linuxdeployqt-continuous-x86_64.AppImage
# wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
./linuxdeployqt*.AppImage ./dist/usr/share/applications/*.desktop -bundle-non-qt-libs -exclude-libs=libnss3,libnssutil3 -extra-plugins=platformthemes/libqt5ct.so,styles/libqt5ct-style.so
# Copy translations
cp /opt/qt59/translations/*_zh_CN.qm ./dist/usr/translations/
# Package it for the second time.
./linuxdeployqt*.AppImage ./dist/usr/share/applications/*.desktop -appimage -exclude-libs=libnss3,libnssutil3 -extra-plugins=platformthemes/libqt5ct.so,styles/libqt5ct-style.so
tree dist/
ls -l *.AppImage
mv VNote-*.AppImage VNote-${version}-x86_64.AppImage
cd ..
exit 0