-
Notifications
You must be signed in to change notification settings - Fork 17
/
dist_linux.sh
executable file
·78 lines (53 loc) · 1.9 KB
/
dist_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
#!/bin/bash
# Stop at any error
set -e
# For Github actions: install-qt-action sets the Qt5_DIR environment variable
if [[ -z "${Qt5_DIR}" ]]; then
echo "Qt5_DIR not detected, skipping"
else
QTDIR=${Qt5_DIR}
echo "Using Qt tools from ${QTDIR}"
fi
# Location of the QT tools
if [ -z ${QTDIR+x} ]; then
echo "QTDIR not defined- please set it to the location containing the Qt version to build against. For example:"
echo " export QTDIR=~/Qt/5.15.0/gcc_64"
exit 1
fi
QMAKE=${QTDIR}/bin/qmake
MAKE=make
LINUXDEPLOYQT=`pwd`/linuxdeployqt-continuous-x86_64.AppImage
# Location of the source tree
SOURCEDIR=`pwd`/src
# Location to build PatternPaint
BUILDDIR='build-dist-linux'
################### Extract the version info ###################
source ./gitversion.sh
################## Build PatternPaint ##########################
mkdir -p ${BUILDDIR}
pushd ${BUILDDIR}
${QMAKE} ${SOURCEDIR}/PatternPaint.pro \
-spec linux-g++
#${MAKE} clean
${MAKE} -j6
popd
################## Run Unit Tests ##############################
pushd ${BUILDDIR}
LD_LIBRARY_PATH=libblinky libblinky-test/libblinky-test
popd
################## Package using linuxdeployqt #################
pushd ${BUILDDIR}
pushd app
icns2png ${SOURCEDIR}/app/images/patternpaint.icns -x
cp patternpaint_256x256x32.png patternpaint.png
cp ${SOURCEDIR}/app/patternpaint.desktop ./
popd
# TODO: this should be done automagically though the qt build tools?
mkdir -p app/lib
cp libblinky/libblinky.so.1 app/lib
unset LD_LIBRARY_PATH # Remove too old Qt from the search path; TODO: Move inside the linuxdeployqt AppImage
#LINUXDEPLOYQT_OPTS=-unsupported-allow-new-glibc
PATH=${QTDIR}/bin:${PATH} ${LINUXDEPLOYQT} app/PatternPaint -bundle-non-qt-libs ${LINUXDEPLOYQT_OPTS}
PATH=${QTDIR}/bin:${PATH} ${LINUXDEPLOYQT} app/PatternPaint -appimage ${LINUXDEPLOYQT_OPTS}
tar -cjf PatternPaint-${VERSION}-x86_64.tar.bz2 PatternPaint-${VERSION}-x86_64.AppImage
popd