Skip to content

Commit

Permalink
Merge pull request #21 from QuasarApp/version_1_0
Browse files Browse the repository at this point in the history
added shared build
  • Loading branch information
EndrII authored Sep 22, 2018
2 parents d12da4e + 5c4fb0e commit 6449ca4
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ CMakeLists.txt.user*
snap/\.snapcraft/

\.buildconfig

sharedQt/
3 changes: 2 additions & 1 deletion CQtDeployer/CQtDeployer.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ DISTFILES += \
../snapBuild.sh \
../staticBuild.sh \
../snap/snapcraft.yaml \
../README.md
../README.md \
../sharedBuild.sh
2 changes: 1 addition & 1 deletion CQtDeployer/deploy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ bool Deploy::createRunScript() {

QString content =
"#!/bin/sh\n"
"BASEDIR=$(dirname $0)\n"
"BASE_DIR=$(dirname \"$(readlink -f \"$0\")\")\n"
"export LD_LIBRARY_PATH=$BASEDIR/lib:$BASEDIR:$LD_LIBRARY_PATH\n"
"export QML_IMPORT_PATH=$BASEDIR/qml:QML_IMPORT_PATH\n"
"export QML2_IMPORT_PATH=$BASEDIR/qml:QML2_IMPORT_PATH\n"
Expand Down
49 changes: 49 additions & 0 deletions sharedBuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

declare -a QTLIBS

BASE_DIR=$(dirname "$(readlink -f "$0")")

QTLIBS=( libQt5Sql.so libQt5Xml.so libQt5Core.so libQt5Test.so libQt5Network.so libQt5Concurrent.so)

cd $BASE_DIR/qtBase

for var in "${QTLIBS[@]}"
do
if [ -e "$BASE_DIR/sharedQt/lib/$var" ]
then
echo "$var - ok"
else
echo "$var - not exits!. rebuild qt ..."

sudo apt install libpcre2-dev

rm -rdf $BASE_DIR/sharedQt

git clean -xdf

./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

make install -j$(nproc)
break
fi
done

cd ..
rm -rdf $BASE_DIR/build

export PATH=$PATH:$BASE_DIR/sharedQt

$BASE_DIR/sharedQt/bin/qmake CQtDeployer.pro

make -j$(nproc)

strip build/*

chmod +x $BASE_DIR/build/CQtDeployer

$BASE_DIR/build/CQtDeployer -runScript cqtdeployer.sh -bin $BASE_DIR/build/CQtDeployer -qmake $BASE_DIR/sharedQt/bin/qmake

tar -czvf $BASE_DIR/build/cqtdeployer.tar.gz $BASE_DIR/build/*

rm $BASE_DIR/build/lib -rdf $BASE_DIR/build/*.so* $BASE_DIR/build/*.sh*
23 changes: 15 additions & 8 deletions staticBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,39 @@

declare -a QTLIBS

BASE_DIR=$(dirname $0)
BASE_DIR=$(dirname "$(readlink -f "$0")")

QTLIBS=( libQt5Sql.a libQt5Xml.a libQt5Core.a libQt5Test.a libqtpcre2.a libQt5Network.a libQt5Bootstrap.a libQt5Concurrent.a)

cd qtBase
echo "base dir $BASE_DIR"

cd $BASE_DIR/qtBase

for var in "${QTLIBS[@]}"
do
if [ -e "$BASE_DIR/lib/$var" ]
if [ -e "$BASE_DIR/staticQt/lib/$var" ]
then
echo "$var - ok"
else
echo "$var - not exits!. rebuild qt ..."

git clean -xfd
rm -rdf $BASE_DIR/staticQt

git clean -xdf

./configure -confirm-license -release -optimize-size -static -no-opengl -no-openssl -opensource -nomake tests -nomake examples -no-gui -no-widgets -no-dbus -no-accessibility
./configure -confirm-license -prefix $BASE_DIR/staticQt -release -optimize-size -static -no-opengl -no-openssl -opensource -nomake tests -nomake examples -no-gui -no-widgets -no-dbus -no-accessibility

make -j$(nproc)
make install -j$(nproc)
break
fi
done

cd ..
export PATH=$PATH:/qtBase
rm -rdf $BASE_DIR/build

export PATH=$PATH:$BASE_DIR/staticQt

./qtBase/bin/qmake CQtDeployer.pro
$BASE_DIR/staticQt/bin/qmake CQtDeployer.pro

make -j$(nproc)

Expand Down

0 comments on commit 6449ca4

Please sign in to comment.