1- #! /bin/bash
1+ #! /bin/sh
22set -ex
33
44export MAKEFLAGS=-j$( nproc)
55export QDEP_CACHE_DIR=/tmp/qdep-cache
66
77DS_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"
1110PIP_DEV_DEPS=" qdep appdirs lockfile argcomplete"
1211
1312if [ ! -d " /tmp/src/.git" ]; then
1413 echo " Failed to find .git directory - not supported!"
1514 exit 1
1615fi
1716
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
2018pip3 install $PIP_DEV_DEPS
2119
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-
5620# prepare qdep
57- qdep prfgen
21+ qdep prfgen --qmake qmake-qt5
5822
5923# build json serializer, qtservice
24+ mkdir /tmp/sysbuild
25+ cd /tmp/sysbuild
6026for repo in QtJsonSerializer QtService; do
6127 git clone https://github.com/Skycoder42/$repo .git ./$repo
6228 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)
6630
67- if [[ -f src/imports/imports.pro ] ]; then
31+ if [ -f src/imports/imports.pro ]; then
6832 echo " SUBDIRS -= imports" >> src/src.pro
6933 fi
7034
71- qmake
72- make > /dev/null
35+ qmake-qt5
36+ make
7337 make install
7438 cd ..
7539done
@@ -80,22 +44,22 @@ echo "SUBDIRS = 3rdparty messages" >> src/src.pro
8044echo " SUBDIRS = " >> examples/examples.pro
8145echo " SUBDIRS = " >> tests/tests.pro
8246
83- qmake
47+ qmake-qt5
8448make qmake_all
8549make
8650make install
8751
8852# create special symlinks, dirs and move the env script
8953mkdir -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
9155mv /tmp/src/tools/appserver/dockerbuild/env_start.sh /usr/bin/
9256
9357# test if working
9458/usr/bin/$DS_NAME --version
9559
9660# 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
9963rm -rf /tmp/*
10064rm -rf $HOME /.cache/qpmx
10165rm -rf /usr/local/bin/qpm
0 commit comments