1
- #! /bin/bash
1
+ #! /bin/sh
2
2
set -ex
3
3
4
4
export MAKEFLAGS=-j$( nproc)
5
5
export QDEP_CACHE_DIR=/tmp/qdep-cache
6
6
7
7
DS_NAME=qdsappd
8
- QT_VERSION_TAG=v5.12.1
9
- MAIN_DEP=" libssl1.1 zlib1g libdbus-1-3 libc6 libglib2.0-0 libudev1 libpcre2-16-0 libpq5 libdouble-conversion1 libicu57 libinput10 ca-certificates"
10
- DEV_DEP=" openssl libssl-dev zlib1g-dev dbus libdbus-1-dev libc6-dev libglib2.0-dev libudev-dev libdouble-conversion-dev libicu-dev libpcre2-dev libpq-dev libinput-dev make gcc g++ curl python3 python3-pip git perl gawk"
8
+ MAIN_DEP=" qt5-qtbase qt5-qtbase-postgresql qt5-qtwebsockets icu-libs"
9
+ DEV_DEP=" qt5-qtbase-dev qt5-qtwebsockets-dev qt5-qttools qt5-qttools-dev icu-dev build-base python3 git perl gawk"
11
10
PIP_DEV_DEPS=" qdep appdirs lockfile argcomplete"
12
11
13
12
if [ ! -d " /tmp/src/.git" ]; then
14
13
echo " Failed to find .git directory - not supported!"
15
14
exit 1
16
15
fi
17
16
18
- apt-get -qq update
19
- apt-get -qq install --no-install-recommends $MAIN_DEP $DEV_DEP
17
+ apk add --no-cache $MAIN_DEP $DEV_DEP
20
18
pip3 install $PIP_DEV_DEPS
21
19
22
- mkdir /tmp/sysbuild
23
- cd /tmp/sysbuild
24
-
25
- # build qt
26
- git clone --depth 1 https://code.qt.io/qt/qt5.git ./qt5 --branch $QT_VERSION_TAG
27
- cd qt5
28
- ./init-repository --module-subset=" qtbase,qtwebsockets,qttools"
29
- _qt5_prefix=/usr/lib/qt5
30
- _qt5_datadir=/usr/share/qt5
31
- ./configure -confirm-license -opensource \
32
- -prefix /usr \
33
- -archdatadir " $_qt5_prefix " \
34
- -datadir " $_qt5_prefix " \
35
- -importdir " $_qt5_prefix " /imports \
36
- -libexecdir " $_qt5_prefix " /libexec \
37
- -plugindir " $_qt5_prefix " /plugins \
38
- -translationdir " $_qt5_datadir " /translations \
39
- -sysconfdir /etc/xdg \
40
- -release -reduce-exports \
41
- -make libs -make tools \
42
- -glib \
43
- -no-rpath \
44
- -no-separate-debug-info \
45
- -openssl-linked \
46
- -plugin-sql-psql \
47
- -dbus-linked \
48
- -system-pcre \
49
- -system-zlib \
50
- -no-reduce-relocations \
51
- -no-gui -no-widgets -no-feature-accessibility -no-feature-dom
52
- make > /dev/null
53
- make install
54
- cd ..
55
-
56
20
# prepare qdep
57
- qdep prfgen
21
+ qdep prfgen --qmake qmake-qt5
58
22
59
23
# build json serializer, qtservice
24
+ mkdir /tmp/sysbuild
25
+ cd /tmp/sysbuild
60
26
for repo in QtJsonSerializer QtService; do
61
27
git clone https://github.com/Skycoder42/$repo .git ./$repo
62
28
cd $repo
63
- latesttag=$( git describe --tags --abbrev=0)
64
- echo checking out ${latesttag}
65
- git checkout ${latesttag}
29
+ git checkout $( git describe --tags --abbrev=0)
66
30
67
- if [[ -f src/imports/imports.pro ] ]; then
31
+ if [ -f src/imports/imports.pro ]; then
68
32
echo " SUBDIRS -= imports" >> src/src.pro
69
33
fi
70
34
71
- qmake
72
- make > /dev/null
35
+ qmake-qt5
36
+ make
73
37
make install
74
38
cd ..
75
39
done
@@ -80,22 +44,22 @@ echo "SUBDIRS = 3rdparty messages" >> src/src.pro
80
44
echo " SUBDIRS = " >> examples/examples.pro
81
45
echo " SUBDIRS = " >> tests/tests.pro
82
46
83
- qmake
47
+ qmake-qt5
84
48
make qmake_all
85
49
make
86
50
make install
87
51
88
52
# create special symlinks, dirs and move the env script
89
53
mkdir -p /etc/$DS_NAME
90
- ln -s $( qmake -query QT_INSTALL_BINS) /$DS_NAME /usr/bin/$DS_NAME || true # allow to fail if already exists
54
+ ln -s $( qmake-qt5 -query QT_INSTALL_BINS) /$DS_NAME /usr/bin/$DS_NAME || true # allow to fail if already exists
91
55
mv /tmp/src/tools/appserver/dockerbuild/env_start.sh /usr/bin/
92
56
93
57
# test if working
94
58
/usr/bin/$DS_NAME --version
95
59
96
60
# remove unused stuff
97
- pip3 uninstall $PIP_DEV_DEPS
98
- apt-get -qq autoremove --purge $DEV_DEP
61
+ pip3 uninstall -y $PIP_DEV_DEPS
62
+ apk del --no-cache --purge " *-dev " $DEV_DEP
99
63
rm -rf /tmp/*
100
64
rm -rf $HOME /.cache/qpmx
101
65
rm -rf /usr/local/bin/qpm
0 commit comments