CQtDeployer/sharedBuild.sh

96 lines
2.1 KiB
Bash
Raw Normal View History

2018-09-22 20:43:29 +03:00
#!/bin/bash
2019-01-26 07:54:56 +03:00
#
# Copyright (C) 2018-2019 QuasarApp.
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
2018-09-22 20:43:29 +03:00
declare -a QTLIBS
BASE_DIR=$(dirname "$(readlink -f "$0")")
QTLIBS=( libQt5Sql.so libQt5Xml.so libQt5Core.so libQt5Test.so libQt5Network.so libQt5Concurrent.so)
2018-11-11 15:57:35 +03:00
RELEASE_DIR=$BASE_DIR/distro
2019-01-26 19:03:37 +03:00
CQDEPLOYER_DIR=$BASE_DIR/CQtDeployer/build/release
DEPLOYER=$BASE_DIR/CQtDeployerBinaries/Linux/cqtdeployer.sh
2018-10-31 18:12:13 +03:00
cd $BASE_DIR
2018-09-22 23:07:27 +03:00
make clean
find $BASE_DIR -type f -name 'Makefile' -exec rm {} \;
2019-01-26 19:03:37 +03:00
find $BASE_DIR/QuasarAppLib -type f -name '*.so*' -exec rm {} \;
find $BASE_DIR/Deploy -type f -name '*.so*' -exec rm {} \;
2018-10-31 17:38:38 +03:00
rm $BASE_DIR/QuasarAppLib/Makefile.QuasarApp
2018-11-11 15:57:35 +03:00
rm -rdf $RELEASE_DIR
2018-10-31 17:38:38 +03:00
2018-11-03 23:24:44 +03:00
if [ -e "$1" ]
2018-10-31 17:38:38 +03:00
then
echo "use qmake from params!"
2018-11-03 23:24:44 +03:00
QMAKE=$1
2018-10-31 17:38:38 +03:00
else
echo "use qmake from build!"
QMAKE=$BASE_DIR/sharedQt/bin/qmake
2018-11-03 23:24:44 +03:00
2018-10-31 17:38:38 +03:00
cd $BASE_DIR/qtBase
2018-09-22 23:07:27 +03:00
2018-11-03 23:24:44 +03:00
2018-10-31 17:38:38 +03:00
for var in "${QTLIBS[@]}"
do
if [ -e "$BASE_DIR/sharedQt/lib/$var" ]
then
echo "$var - ok"
else
echo "$var - not exits!. rebuild qt ..."
rm -rdf $BASE_DIR/sharedQt
git clean -xdf
2019-03-26 23:03:40 +03:00
./configure -confirm-license -prefix $BASE_DIR/sharedQt -release -shared -no-opengl -no-openssl -opensource -nomake tests -nomake examples -no-gui -no-widgets -no-dbus -no-accessibility
2018-10-31 17:38:38 +03:00
make install -j$(nproc)
break
fi
done
cd ..
export PATH=$PATH:$BASE_DIR/sharedQt
fi
2019-01-26 19:03:37 +03:00
$QMAKE $BASE_DIR/CQtDeployer.pro -r
2018-09-22 20:43:29 +03:00
make -j$(nproc)
2018-09-30 16:35:51 +03:00
2018-11-02 10:59:42 +03:00
if [ $? -eq 0 ]
then
echo ""
echo "Build is successfully completed!"
else
echo ""
echo "Build is failed!" >&2
exit 1;
fi
2018-09-30 16:35:51 +03:00
2019-01-26 19:03:37 +03:00
$DEPLOYER -targetDir $RELEASE_DIR -bin $CQDEPLOYER_DIR -libDir $BASE_DIR -recursiveDepth 5 -qmake $QMAKE
2018-10-31 17:38:38 +03:00
strip $RELEASE_DIR/*
2018-09-22 20:43:29 +03:00
2018-09-22 23:07:27 +03:00
2018-11-03 23:28:19 +03:00
if [ -e "$1" ]
2018-10-31 18:12:13 +03:00
then
2018-11-02 10:59:42 +03:00
echo ""
2018-10-31 18:12:13 +03:00
echo "deploy done (shared mode with custom qmake)"
else
2018-12-24 19:47:49 +03:00
cd $RELEASE_DIR
tar -czvf $RELEASE_DIR/cqtdeployer.tar.gz ./*
2018-10-31 18:12:13 +03:00
cd $BASE_DIR
rm $TEMP_INSTALL_DIR -rdf
echo ""
2018-10-31 18:12:13 +03:00
echo "deploy done (shared mode with own qmake)"
exit 0
2018-10-31 18:12:13 +03:00
fi