forked from flameshot-org/flameshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_linux.sh
112 lines (94 loc) · 4.54 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
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
if [[ "${DIST}" != "trusty" ]]; then
git clone https://github.com/packpack/packpack.git packpack ;
mkdir ./dist ;
pwd && ls ;
packpack/packpack ;
if [ $OS == "ubuntu" ];
then curl --upload-file build/flameshot_*_*.deb "https://transfer.sh/flameshot_$VERSION-$DIST-$ARCH_$ARCH.$EXTEN" ;
# copy deb to dist path for distribution
cp build/flameshot_*_*.deb dist/flameshot_$VERSION-$DIST-$ARCH_$ARCH.$EXTEN ;
elif [ $OS == "debian" ];
then curl --upload-file build/flameshot_*_*.deb "https://transfer.sh/flameshot_$VERSION-$DIST-$ARCH_$ARCH.$EXTEN" ;
cp build/flameshot_*_*.deb dist/flameshot_$VERSION-$DIST-$ARCH_$ARCH.$EXTEN ;
elif [ $OS == "fedora" ];
then curl --upload-file build/flameshot-$VERSION-$RELEASE.*.$ARCH.rpm "https://transfer.sh/flameshot_$VERSION-fedora$DIST-$ARCH_$ARCH.$EXTEN" ;
cp build/flameshot-$VERSION-$RELEASE.*.$ARCH.rpm dist/flameshot_$VERSION-fedora$DIST-$ARCH_$ARCH.$EXTEN ;
else echo "";
fi
echo -e "\n" ;
pwd && ls ;
elif [[ "${DIST}" == "trusty" ]]; then
project_dir=$(pwd)
DIST_PATH='dist'
BUILD_DST_PATH='build-test'
APPIMAGE_DST_PATH='build-appimage'
# Install qt5.3.2
sudo add-apt-repository ppa:beineri/opt-qt532-trusty -y
sudo apt-get update -qq
sudo apt-get -y install qt53base qt53tools
source /opt/qt53/bin/qt53-env.sh && qmake --version
export CC=gcc-4.9 CXX=g++-4.9
# Install fcitx-frontend-qt5
sudo apt-get -y install fcitx-frontend-qt5
mkdir build-test
qmake QMAKE_CXX=$CXX QMAKE_CC=$CC QMAKE_LINK=$CXX DESTDIR=$BUILD_DST_PATH
# Building flameshot
make -j$(nproc)
# Running flameshot tests
make check -j$(nproc)
ls -alhR
#
# Packaging AppImage using linuxdeployqt
#
mkdir build-appimage
mkdir -p ./build-appimage/appdir/usr/bin
mkdir -p ./build-appimage/appdir/usr/share/applications
mkdir -p ./build-appimage/appdir/usr/share/dbus-1/interfaces
mkdir -p ./build-appimage/appdir/usr/share/dbus-1/services
mkdir -p ./build-appimage/appdir/usr/share/metainfo
mkdir -p ./build-appimage/appdir/usr/share/bash-completion/completions
mkdir -p ./build-appimage/appdir/usr/share/flameshot/translations
cp $BUILD_DST_PATH/flameshot $APPIMAGE_DST_PATH/appdir/usr/bin
cp ${project_dir}/dbus/org.dharkael.Flameshot.xml $APPIMAGE_DST_PATH/appdir/usr/share/dbus-1/interfaces
cp ${project_dir}/dbus/package/org.dharkael.Flameshot.service $APPIMAGE_DST_PATH/appdir/usr/share/dbus-1/services
cp ${project_dir}/docs/appdata/flameshot.appdata.xml $APPIMAGE_DST_PATH/appdir/usr/share/metainfo
cp ${project_dir}/docs/bash-completion/flameshot $APPIMAGE_DST_PATH/appdir/usr/share/bash-completion/completions
cp ${project_dir}/translations/*.qm $APPIMAGE_DST_PATH/appdir/usr/share/flameshot/translations
cp ${project_dir}/docs/desktopEntry/package/* $APPIMAGE_DST_PATH/appdir/usr/share/applications
cp ${project_dir}/img/flameshot.png $APPIMAGE_DST_PATH/appdir
ls -alhR $APPIMAGE_DST_PATH/appdir
# Copy other project files
cp "${project_dir}/README.md" "$APPIMAGE_DST_PATH/appdir/README.md"
cp "${project_dir}/LICENSE" "$APPIMAGE_DST_PATH/appdir/LICENSE"
echo ${VERSION} > ./$APPIMAGE_DST_PATH/appdir/version
echo "${TRAVIS_COMMIT}" >> ./$APPIMAGE_DST_PATH/appdir/version
# Configure env vars
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
tree $APPIMAGE_DST_PATH/appdir
# Get linuxdeployqt tool
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O linuxdeployqt
chmod +x linuxdeployqt
# Packaging
# -verbose=2
./linuxdeployqt $APPIMAGE_DST_PATH/appdir/usr/bin/flameshot -bundle-non-qt-libs
rm -f $APPIMAGE_DST_PATH/appdir/usr/lib/libatk-1.0.so.0
cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so $APPIMAGE_DST_PATH/appdir/usr/plugins/platforminputcontexts/
cd $APPIMAGE_DST_PATH/appdir/usr/bin
ln -sf ../plugins/platforms/ . # An unknown bug
cd ${project_dir}
# -verbose=2
./linuxdeployqt $APPIMAGE_DST_PATH/appdir/usr/share/applications/flameshot.desktop -appimage
ls -alhR ./*.AppImage
cp *.AppImage $APPIMAGE_DST_PATH/
tree $APPIMAGE_DST_PATH/
ls -l $APPIMAGE_DST_PATH/*.AppImage
mkdir dist
# Rename AppImage and move AppImage to DIST_PATH
cd $APPIMAGE_DST_PATH && mv Flameshot-${VERSION}-${ARCH}.AppImage flameshot_${ARCH}_${VERSION}.AppImage
cd .. && cp $APPIMAGE_DST_PATH/flameshot_${ARCH}_${VERSION}.AppImage $DIST_PATH/flameshot_${ARCH}_${VERSION}.$EXTEN
pwd
curl --upload-file $DIST_PATH/flameshot_${ARCH}_${VERSION}.AppImage "https://transfer.sh/flameshot_${ARCH}_${VERSION}.$EXTEN" ;
exit 0 ;
else echo "" ;
fi