From d55d8dd6af5dcf280f83679088cd5dcb84d63ac0 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 11:00:27 +0100 Subject: [PATCH 01/31] stdlib.h is not found with -I/usr/include directive. --- eddypro_lin.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/eddypro_lin.pro b/eddypro_lin.pro index e63f2e6..244472a 100644 --- a/eddypro_lin.pro +++ b/eddypro_lin.pro @@ -46,7 +46,6 @@ CONFIG(debug, debug|release) { DEFINES += QT_DEBUG # to suppress qt and 3rdparty library warnings - QMAKE_CXXFLAGS += -isystem "$$QT_PATH/include" QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip" win32 { From da0b3a8ded11e03f907e1ce6151806f443853b23 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 11:04:02 +0100 Subject: [PATCH 02/31] v14 of C++ is needed (use of 14's funcionalities). Same as in win/mac pro files by the way. --- eddypro_lin.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eddypro_lin.pro b/eddypro_lin.pro index 244472a..ae26758 100644 --- a/eddypro_lin.pro +++ b/eddypro_lin.pro @@ -16,7 +16,7 @@ QT_PATH = $$[QT_INSTALL_PREFIX] QT += core gui widgets network concurrent CONFIG += warn_on CONFIG += debug_and_release -CONFIG += c++11 +CONFIG += c++14 # Build tree with shadow building approach include(build_tree.pri) From b8a10d43b64dcd520152efdc966c0fd0d9f193b8 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 11:07:33 +0100 Subject: [PATCH 03/31] Using of BOOST_ASSERT needs extra include of boost lib headers. --- src/polyfit.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/polyfit.hpp b/src/polyfit.hpp index 17107ee..1b9d530 100644 --- a/src/polyfit.hpp +++ b/src/polyfit.hpp @@ -12,6 +12,7 @@ #include #include +#include #include #include From 156a994769d094266a72e6f67ce1b88f3de912ef Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 11:23:35 +0100 Subject: [PATCH 04/31] Test of equality in sh is '=' not '=='. --- scripts/build/lin-pre-link.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 99f5566..49f1a64 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -3,7 +3,7 @@ echo "Copying dynamic libraries in the debug or release build folder... " DEBUG_OR_RELEASE=$1 -if [ "$DEBUG_OR_RELEASE" == "debug" ]; then +if [ "$DEBUG_OR_RELEASE" = "debug" ]; then QUAZIP_LIB="libquazip_debug.so.1.0.0" else QUAZIP_LIB="libquazip.so.1.0.0" From 8ed8cb544fa9d0a903ff395d829306fe08a0509b Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 15:32:14 +0100 Subject: [PATCH 05/31] Add script to ease ressources' files update. --- scripts/build/lin-update-ressources.sh | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/build/lin-update-ressources.sh diff --git a/scripts/build/lin-update-ressources.sh b/scripts/build/lin-update-ressources.sh new file mode 100755 index 0000000..86044ad --- /dev/null +++ b/scripts/build/lin-update-ressources.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +UNZIP="unzip" # un-zip program + +if [ ! -d fonts -o ! -d tra ] ; then + echo "It seems script '`basename $0`' is not launched from project's root directory !" + exit 1 +fi + +if [ "$1" = "clean" ] ; then + CLEAN="true" +else + CLEAN="false" +fi + +$CLEAN && echo "Cleaning ressources files ... " || echo "Updating ressources files ... " + +echo " > OpenSans fonts files" +if $CLEAN ; then + rm -f fonts/OpenSans*.ttf fonts/Apache*.txt +else + if [ -f fonts/OpenSans-Light.ttf ] ; then echo " seems to be already unzipped" ; else cd fonts ; $UNZIP open-sans.zip ; cd - ; fi +fi + +echo " > Translation files" +if $CLEAN ; then + rm -f tra/*.qm +else + if [ -z "`ls tra/*.qm`" ] ; then lrelease eddypro_lin.pro ; else echo " seems to be already converted to binary (qm)" ; fi +fi + From 1dd939ba6eeaf2b9c213053dbc527af57b49762c Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 15:35:16 +0100 Subject: [PATCH 06/31] Add tool to ease quazip compilation. --- scripts/build/lin-build-quazip.sh | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 scripts/build/lin-build-quazip.sh diff --git a/scripts/build/lin-build-quazip.sh b/scripts/build/lin-build-quazip.sh new file mode 100755 index 0000000..5592fe4 --- /dev/null +++ b/scripts/build/lin-build-quazip.sh @@ -0,0 +1,39 @@ +#!/bin/sh + + +if [ "$1" = "debug" ]; then + DEBUG_OR_RELEASE=$1 +else + DEBUG_OR_RELEASE="release" +fi + +QZ="quazip-0.7.1" +# full path is (from root) : +# libs//quazip +cd libs +if [ ! -d $QZ ] ; then + echo " > Extracting archive" + if [ -f $QZ.tar.gz ] ; then tar zxvf $QZ.tar.gz ; else echo " Missing archive file '$QZ.tar.gz' !" ; exit 1 ; fi +fi +cd $QZ || { echo " Can't go to $QZ directory" ; exit 2 ; } +cd quazip +# apply patch +if [ -f ../../$QZ.patch ] ; then + echo " > Apply patch" + if [ -n "`grep '\-lz' quazip.pro`" ] ; then # this test depends on patch content + # hard to know simply know whether patch has already benn applied ! + # but applying it twice is no good + echo " seems that patch has already been apllied" + else + patch -b < ../../$QZ.patch + fi +fi + +if [ ! -f Makefile ] ; then + echo " > Launch qmake (in-place building)" + qmake +fi + +echo " > Launch make for $DEBUG_OR_RELEASE" +make $DEBUG_OR_RELEASE + From 575691bdf2c7caf0c323d7a66f71257aea8e4e6f Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 15:39:27 +0100 Subject: [PATCH 07/31] In patch file, include "_debug" naming for lib files (.so) for unix case --- libs/quazip-0.7.1.patch | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/libs/quazip-0.7.1.patch b/libs/quazip-0.7.1.patch index 0e009c4..465e9ac 100644 --- a/libs/quazip-0.7.1.patch +++ b/libs/quazip-0.7.1.patch @@ -1,7 +1,5 @@ -diff --git 1/quazip-0.7.1_orig/quazip/quazip.pro 2/quazip-0.7.1/quazip/quazip.pro -index c869e59..c30ab1c 100644 ---- 1/quazip-0.7.1_orig/quazip/quazip.pro -+++ 2/quazip-0.7.1/quazip/quazip.pro +--- quazip-0.7.1_orig/quazip/quazip.pro 2019-02-04 14:47:51.970412924 +0100 ++++ quazip-0.7.1/quazip/quazip.pro 2019-02-04 15:01:06.040975847 +0100 @@ -1,7 +1,9 @@ TEMPLATE = lib -CONFIG += qt warn_on @@ -13,7 +11,7 @@ index c869e59..c30ab1c 100644 # The ABI version. !win32:VERSION = 1.0.0 -@@ -22,7 +24,6 @@ QT -= gui +@@ -22,7 +24,6 @@ # 2.0, VERSION to 2.0.0. # And so on. @@ -21,19 +19,20 @@ index c869e59..c30ab1c 100644 # This one handles dllimport/dllexport directives. DEFINES += QUAZIP_BUILD -@@ -30,6 +31,11 @@ DEFINES += QUAZIP_BUILD +@@ -30,6 +31,12 @@ # than qmake or using QuaZIP sources directly in your project. CONFIG(staticlib): DEFINES += QUAZIP_STATIC +CONFIG(debug, debug|release) { + mac: TARGET = $$join(TARGET,,,_debug) ++ unix: TARGET = $$join(TARGET,,,_debug) + win32: TARGET = $$join(TARGET,,,d) +} + # Input include(quazip.pri) -@@ -39,9 +45,8 @@ unix:!symbian { +@@ -39,9 +46,8 @@ target.path=$$PREFIX/lib/$${LIB_ARCH} INSTALLS += headers target @@ -45,7 +44,7 @@ index c869e59..c30ab1c 100644 } win32 { -@@ -53,9 +58,7 @@ win32 { +@@ -53,9 +59,7 @@ DEFINES += NOMINMAX } From d97f91a23407d7c773c0b320a3720afb788574ab Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Mon, 4 Feb 2019 15:52:44 +0100 Subject: [PATCH 08/31] Add translations directive for lrelease in pro file. --- eddypro_lin.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eddypro_lin.pro b/eddypro_lin.pro index ae26758..b012dba 100644 --- a/eddypro_lin.pro +++ b/eddypro_lin.pro @@ -18,6 +18,8 @@ CONFIG += warn_on CONFIG += debug_and_release CONFIG += c++14 +TRANSLATIONS = tra/eddypro_en.ts + # Build tree with shadow building approach include(build_tree.pri) From 5d731258d6d002b9761df73597c8351e4938fff3 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Tue, 5 Feb 2019 07:41:31 +0100 Subject: [PATCH 09/31] Update pre-link script for linux : try to find appropriate quazip building directory. --- scripts/build/lin-pre-link.sh | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 49f1a64..ba56ea8 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -2,6 +2,11 @@ echo "Copying dynamic libraries in the debug or release build folder... " DEBUG_OR_RELEASE=$1 +if [ -n "$2" ] ; then + ROOT_DIR="$2" +else + ROOT_DIR="../eddypro-gui" +fi if [ "$DEBUG_OR_RELEASE" = "debug" ]; then QUAZIP_LIB="libquazip_debug.so.1.0.0" @@ -15,8 +20,34 @@ echo "[pwd: $PWD]" BUILD_DIR="./$DEBUG_OR_RELEASE" echo "[BUILD_DIR: $BUILD_DIR]" -QUAZIP_BUILD_DIR="build-quazip-0.7.1-qt-5.7.0-centos-gcc-4.8.5-x86_64/quazip" +# search for any shadow building, if any +d=`ls -d $ROOT_DIR/libs/build-${QZ}*` +if [ -n "$d" ] ;then + # found at least one dir + if [ `echo "$d" | wc -l` -gt 1 ] ; then + echo " > too many building directories : can't choose one !" ; exit 1 ; + fi + QUAZIP_BUILD_DIR="`basename $d`" +else +# otherwise, use default in-place building + QUAZIP_BUILD_DIR="quazip-0.7.1/quazip" +fi + echo "[QUAZIP_BUILD_DIR: $QUAZIP_BUILD_DIR]" echo "Copy quazip in the app binary folder..." -cp "../libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR" +cp "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR" +# link to .so file (for ld building) +qzlib=`basename $QUAZIP_LIB .1.0.0` +ln -s "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR/$qzlib" +# link to .so.1 file (for binary linking) +qzlib=`basename $QUAZIP_LIB .1.0.0` +ln -s "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR/$qzlib.1" +# add a launching wrapper, as a quick hack for installation lack +cat > "$BUILD_DIR/eddypro.sh" << EOF +#!/bin/sh +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:\`dirname \$0\` \$0" +./eddypro_${DEBUG_OR_RELEASE} +EOF +chmod +x "$BUILD_DIR/eddypro.sh" + From 1e710ef7e2f63ab9a84d5bc0cf058cc5d492ee56 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 07:30:29 +0100 Subject: [PATCH 10/31] Include quazip library's path for inplace building. --- libs.pri | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs.pri b/libs.pri index 8a9b1fe..d9d0744 100644 --- a/libs.pri +++ b/libs.pri @@ -17,7 +17,9 @@ CONFIG(debug, debug|release) { } linux { # quazip - LIBS += -L$$OUT_PWD/../libs/build-quazip-0.7.1-qt-5.7.0-centos-gcc-4.8.5-x86_64/quazip -lquazip_debug + # set LIBS, although -Ldebug should be enough as + # .so files are copied there by PRE_LINK script + LIBS += -L$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip -lquazip_debug # linking QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug @@ -39,7 +41,9 @@ CONFIG(debug, debug|release) { } linux { # quazip - LIBS += -L$$OUT_PWD/../libs/build-quazip-0.7.1-qt-5.7.0-centos-gcc-4.8.5-x86_64/quazip -lquazip + # set LIBS, although -Lrelease should be enough as + # .so files are copied there by PRE_LINK script + LIBS += -L$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip -lquazip # linking QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release From d79240b252d1977c68c58e186bba8ca666cd3b19 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 07:31:28 +0100 Subject: [PATCH 11/31] Add quazip building in shadow directory. --- scripts/build/lin-build-quazip.sh | 45 +++++++++++++++++++++++++++---- scripts/build/lin-pre-link.sh | 11 +++++--- 2 files changed, 47 insertions(+), 9 deletions(-) diff --git a/scripts/build/lin-build-quazip.sh b/scripts/build/lin-build-quazip.sh index 5592fe4..75b42dc 100755 --- a/scripts/build/lin-build-quazip.sh +++ b/scripts/build/lin-build-quazip.sh @@ -1,11 +1,26 @@ #!/bin/sh -if [ "$1" = "debug" ]; then - DEBUG_OR_RELEASE=$1 +# shadow build in debug or release +# usage +# $ scripts/build/lin-build-eddypro.sh [debug|release] + +echo "### Running '$ $0 $@' in '$PWD'..." + +if [ "$#" -eq 0 ]; then + echo "Usage: $0 debug|release [dir-or-auto]\n\tMust be launched from project's root directory" 1>&2 + exit 1 +fi +if [ "$1" = "debug" ] ; then + DEBUG_OR_RELEASE="debug" else DEBUG_OR_RELEASE="release" fi +if [ ! -d libs ] ; then + echo "seems not to be launched from project's root directory" >&2 + exit 1 +fi + QZ="quazip-0.7.1" # full path is (from root) : @@ -13,10 +28,11 @@ QZ="quazip-0.7.1" cd libs if [ ! -d $QZ ] ; then echo " > Extracting archive" - if [ -f $QZ.tar.gz ] ; then tar zxvf $QZ.tar.gz ; else echo " Missing archive file '$QZ.tar.gz' !" ; exit 1 ; fi + if [ -f $QZ.tar.gz ] ; then tar zxvf $QZ.tar.gz ; else echo " Missing archive file '$QZ.tar.gz' !" >&2 ; exit 1 ; fi fi -cd $QZ || { echo " Can't go to $QZ directory" ; exit 2 ; } +cd $QZ || { echo " Can't go to $QZ directory" >&2 ; exit 2 ; } cd quazip +SRC_DIR="$PWD" # apply patch if [ -f ../../$QZ.patch ] ; then echo " > Apply patch" @@ -29,9 +45,28 @@ if [ -f ../../$QZ.patch ] ; then fi fi +build_dir="build-$QZ-$DEBUG_OR_RELEASE" +qmake_project="$SRC_DIR/quazip.pro" + +# make shadow build +# if $2 is defined : can be an arbitrary building shadow directory +# or +if [ -n "$2" ] ; then + if [ "$2" = "auto" ] ; then + SHADOW_DIR="../../$build_dir" + else + cd ../.. + SHADOW_DIR="$2" + fi + mkdir -p "$SHADOW_DIR" + cd "$SHADOW_DIR" +fi + +echo "### Make shadow build in '$PWD'..." + if [ ! -f Makefile ] ; then echo " > Launch qmake (in-place building)" - qmake + qmake -Wall $qmake_project fi echo " > Launch make for $DEBUG_OR_RELEASE" diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index ba56ea8..9784a72 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -38,16 +38,19 @@ echo "[QUAZIP_BUILD_DIR: $QUAZIP_BUILD_DIR]" echo "Copy quazip in the app binary folder..." cp "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR" # link to .so file (for ld building) +cd $BUILD_DIR qzlib=`basename $QUAZIP_LIB .1.0.0` -ln -s "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR/$qzlib" +ln -s "$QUAZIP_LIB" "$qzlib" # link to .so.1 file (for binary linking) qzlib=`basename $QUAZIP_LIB .1.0.0` -ln -s "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR/$qzlib.1" +ln -s "$QUAZIP_LIB" "$qzlib.1" +cd - # add a launching wrapper, as a quick hack for installation lack cat > "$BUILD_DIR/eddypro.sh" << EOF #!/bin/sh -export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:\`dirname \$0\` \$0" -./eddypro_${DEBUG_OR_RELEASE} +BINDIR="\`dirname \$0\`" +export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:\$BINDIR" +\$BINDIR/eddypro_${DEBUG_OR_RELEASE} EOF chmod +x "$BUILD_DIR/eddypro.sh" From 14dcc72c92c9ed2cdeef67a77d86f18fe3102952 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 07:33:49 +0100 Subject: [PATCH 12/31] Add one-shot building script for linux (one might not use qtcreator). --- scripts/build/lin-build-eddypro.sh | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 scripts/build/lin-build-eddypro.sh diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh new file mode 100755 index 0000000..e97ef1d --- /dev/null +++ b/scripts/build/lin-build-eddypro.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +# shadow build in debug or release +# usage +# $ scripts/build/lin-build-eddypro.sh [debug|release] + +echo "### Running '$ $0 $@' in '$PWD'..." + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 [debug|release]\n\tMust be launched from project's root directory" 1>&2 + exit 1 +fi +if [ "$1" = "debug" ] ; then + DEBUG_OR_RELEASE=$1 +else + DEBUG_OR_RELEASE="release" +fi +if [ ! -f eddypro_lin.pro ] ; then + echo "seems not to be launched from project's root directory" >&2 + exit 1 +fi +SRC_DIR="$PWD" + +# build libs +$SRC_DIR/scripts/build/lin-build-quazip.sh $DEBUG_OR_RELEASE + +# update ressource +$SRC_DIR/scripts/build/lin-update-ressources.sh $DEBUG_OR_RELEASE + +# set build directory +app_name="eddypro" +qt_version="qt-`qmake -v | grep Qt | cut -d ' ' -f 4`" +distrib=`{ lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | grep PRETTY_NAME cut -d = -f 2 ; } | sed 's/ /_/g;s/"//g;'` +[ -z "$distrib" ] && distrib="linux" +platform=`uname -m` +build_dir="build-$app_name-$DEBUG_OR_RELEASE+$qt_version+$distrib+$platform" + +# set qmake project file +qmake_project="$SRC_DIR/eddypro_lin.pro" + +# make shadow build +#SHADOW_DIR="../build/$build_dir" +SHADOW_DIR="../$build_dir" +mkdir -p "$SHADOW_DIR" + +cd "$SHADOW_DIR" +echo "### Make shadow build in '$PWD'..." + +echo "### Run 'qmake'..." +qmake -Wall $qmake_project + +echo "### Run 'make'..." +make $DEBUG_OR_RELEASE + + From 50dca460e3b2c97d0ff06ab4bcc4991ffd6b2990 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 08:20:14 +0100 Subject: [PATCH 13/31] Use shadow building for quazip : change config and scripts. --- libs.pri | 4 ++-- scripts/build/lin-build-eddypro.sh | 15 +++++++++------ scripts/build/lin-build-quazip.sh | 4 ++-- scripts/build/lin-pre-link.sh | 21 +++++++++++++-------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/libs.pri b/libs.pri index d9d0744..78ca745 100644 --- a/libs.pri +++ b/libs.pri @@ -19,7 +19,7 @@ CONFIG(debug, debug|release) { # quazip # set LIBS, although -Ldebug should be enough as # .so files are copied there by PRE_LINK script - LIBS += -L$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip -lquazip_debug + LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-debug -lquazip_debug # linking QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug @@ -43,7 +43,7 @@ CONFIG(debug, debug|release) { # quazip # set LIBS, although -Lrelease should be enough as # .so files are copied there by PRE_LINK script - LIBS += -L$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip -lquazip + LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -lquazip # linking QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index e97ef1d..bb9c7ba 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -41,13 +41,16 @@ qmake_project="$SRC_DIR/eddypro_lin.pro" # make shadow build #SHADOW_DIR="../build/$build_dir" SHADOW_DIR="../$build_dir" -mkdir -p "$SHADOW_DIR" - -cd "$SHADOW_DIR" +if [ ! -d "$SHADOW_DIR" ] ; then + echo "### Use shadow build $SHADOW_DIR" + mkdir -p "$SHADOW_DIR" +fi echo "### Make shadow build in '$PWD'..." - -echo "### Run 'qmake'..." -qmake -Wall $qmake_project +cd "$SHADOW_DIR" +if [ ! -f Makefile ] ; then + echo "### Run 'qmake'..." + qmake -Wall $qmake_project +fi echo "### Run 'make'..." make $DEBUG_OR_RELEASE diff --git a/scripts/build/lin-build-quazip.sh b/scripts/build/lin-build-quazip.sh index 75b42dc..73b9c28 100755 --- a/scripts/build/lin-build-quazip.sh +++ b/scripts/build/lin-build-quazip.sh @@ -37,9 +37,9 @@ SRC_DIR="$PWD" if [ -f ../../$QZ.patch ] ; then echo " > Apply patch" if [ -n "`grep '\-lz' quazip.pro`" ] ; then # this test depends on patch content - # hard to know simply know whether patch has already benn applied ! + # hard to know simply know whether patch has already been applied ! # but applying it twice is no good - echo " seems that patch has already been apllied" + echo " seems that patch has already been applied" else patch -b < ../../$QZ.patch fi diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 9784a72..2c024ba 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -1,18 +1,23 @@ #!/bin/sh echo "Copying dynamic libraries in the debug or release build folder... " -DEBUG_OR_RELEASE=$1 +if [ "$#" -eq 0 ]; then + echo "Usage: $0 debug|release [project-root-dir]\n" 1>&2 + exit 1 +fi +if [ "$1" = "debug" ] ; then + DEBUG_OR_RELEASE="debug" + QUAZIP_LIB="libquazip_debug.so.1.0.0" +else + DEBUG_OR_RELEASE="release" + QUAZIP_LIB="libquazip.so.1.0.0" +fi if [ -n "$2" ] ; then ROOT_DIR="$2" else ROOT_DIR="../eddypro-gui" fi -if [ "$DEBUG_OR_RELEASE" = "debug" ]; then - QUAZIP_LIB="libquazip_debug.so.1.0.0" -else - QUAZIP_LIB="libquazip.so.1.0.0" -fi PWD=$(pwd) echo "[pwd: $PWD]" @@ -21,11 +26,11 @@ BUILD_DIR="./$DEBUG_OR_RELEASE" echo "[BUILD_DIR: $BUILD_DIR]" # search for any shadow building, if any -d=`ls -d $ROOT_DIR/libs/build-${QZ}*` +d=`ls -d $ROOT_DIR/libs/build-quazip*-$DEBUG_OR_RELEASE` if [ -n "$d" ] ;then # found at least one dir if [ `echo "$d" | wc -l` -gt 1 ] ; then - echo " > too many building directories : can't choose one !" ; exit 1 ; + echo " > too many building directories : can't choose one !" >&2 ; exit 1 ; fi QUAZIP_BUILD_DIR="`basename $d`" else From 4671c53cf1582e0423cebac9cb00850652e0b1dd Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 08:44:12 +0100 Subject: [PATCH 14/31] Bug : use appropriate option for use of shadow building. --- scripts/build/lin-build-eddypro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index bb9c7ba..ffe349d 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -22,7 +22,7 @@ fi SRC_DIR="$PWD" # build libs -$SRC_DIR/scripts/build/lin-build-quazip.sh $DEBUG_OR_RELEASE +$SRC_DIR/scripts/build/lin-build-quazip.sh $DEBUG_OR_RELEASE auto # update ressource $SRC_DIR/scripts/build/lin-update-ressources.sh $DEBUG_OR_RELEASE From a111a0993fea65ff106869253fcabaad37c9c5b6 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 09:19:32 +0100 Subject: [PATCH 15/31] Buggy launching script for release : wrong binary file name. --- scripts/build/lin-pre-link.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 2c024ba..78dcba9 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -8,9 +8,11 @@ fi if [ "$1" = "debug" ] ; then DEBUG_OR_RELEASE="debug" QUAZIP_LIB="libquazip_debug.so.1.0.0" + BINFILE="eddypro_debug" else DEBUG_OR_RELEASE="release" QUAZIP_LIB="libquazip.so.1.0.0" + BINFILE="eddypro" fi if [ -n "$2" ] ; then ROOT_DIR="$2" @@ -55,7 +57,7 @@ cat > "$BUILD_DIR/eddypro.sh" << EOF #!/bin/sh BINDIR="\`dirname \$0\`" export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:\$BINDIR" -\$BINDIR/eddypro_${DEBUG_OR_RELEASE} +\$BINDIR/${BINFILE} EOF chmod +x "$BUILD_DIR/eddypro.sh" From d65ccb7fdde2f29f91a8dde568add34179a98dcd Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 09:28:58 +0100 Subject: [PATCH 16/31] Add '/' filter in building directory name. --- scripts/build/lin-build-eddypro.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index ffe349d..9609860 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -30,7 +30,7 @@ $SRC_DIR/scripts/build/lin-update-ressources.sh $DEBUG_OR_RELEASE # set build directory app_name="eddypro" qt_version="qt-`qmake -v | grep Qt | cut -d ' ' -f 4`" -distrib=`{ lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | grep PRETTY_NAME cut -d = -f 2 ; } | sed 's/ /_/g;s/"//g;'` +distrib=`{ lsb_release -ds 2>/dev/null || cat /etc/*release 2>/dev/null | grep PRETTY_NAME cut -d = -f 2 ; } | sed 's/ /_/g;s/"//g;s/\//_/g;'` [ -z "$distrib" ] && distrib="linux" platform=`uname -m` build_dir="build-$app_name-$DEBUG_OR_RELEASE+$qt_version+$distrib+$platform" From 4cbee1e394050c40349b5aca83af92878bb5beb0 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 11:31:16 +0100 Subject: [PATCH 17/31] Add linux README instructions. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 80e9740..4c85be2 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,15 @@ directory where the source code is: 1. $ cd eddypro-source-dir/source/scripts/build/ 2. $ ./mac-build-eddypro.sh [debug|release] +##### On Linux +In a terminal enter the following commands, where `eddypro-source-dir` is the +directory where the source code is: + + 1. $ cd eddypro-source-dir scripts/build/ + 2. $ scripts/build/mac-lin-eddypro.sh [debug|release] + +Note : you will need zlib and boost-math library (binary and dev files) installed. + #### Build the GUI using QtCreator (on Windows or Mac) 1. Open 'source\eddypro.pro' From 822b1573a3b5f644a7589d55298c3f8927cfc943 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 12:27:49 +0100 Subject: [PATCH 18/31] Use project path in pre-link : avoid problems when not defaut base directory. --- libs.pri | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs.pri b/libs.pri index 78ca745..948d6b7 100644 --- a/libs.pri +++ b/libs.pri @@ -22,7 +22,7 @@ CONFIG(debug, debug|release) { LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-debug -lquazip_debug # linking - QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug $$_PRO_FILE_PWD_ } } else { win32 { @@ -46,6 +46,6 @@ CONFIG(debug, debug|release) { LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -lquazip # linking - QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release $$_PRO_FILE_PWD_ } } From b16e7f8706773af1cf4fbc7d3eac4539108a241b Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 13:04:25 +0100 Subject: [PATCH 19/31] Use system quazip lib if installed. --- scripts/build/lin-build-quazip.sh | 7 +++++++ scripts/build/lin-pre-link.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/scripts/build/lin-build-quazip.sh b/scripts/build/lin-build-quazip.sh index 73b9c28..c15ea3f 100755 --- a/scripts/build/lin-build-quazip.sh +++ b/scripts/build/lin-build-quazip.sh @@ -11,6 +11,13 @@ if [ "$#" -eq 0 ]; then echo "Usage: $0 debug|release [dir-or-auto]\n\tMust be launched from project's root directory" 1>&2 exit 1 fi + +if [ -n "`ldconfig -p | grep libquazip`" ] ; then + echo "Make use of system quazip lib rather than building it." + exit +fi + + if [ "$1" = "debug" ] ; then DEBUG_OR_RELEASE="debug" else diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 78dcba9..57d3834 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -5,6 +5,13 @@ if [ "$#" -eq 0 ]; then echo "Usage: $0 debug|release [project-root-dir]\n" 1>&2 exit 1 fi + +if [ -n "`ldconfig -p | grep libquazip`" ] ; then + echo "Make use of system quazip lib rather than build it." + exit +fi + + if [ "$1" = "debug" ] ; then DEBUG_OR_RELEASE="debug" QUAZIP_LIB="libquazip_debug.so.1.0.0" From 052bb576d99e847767eea0f0101550b6bb68911b Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 13:09:22 +0100 Subject: [PATCH 20/31] Update readme for quazip usage. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c85be2..8a96532 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,9 @@ directory where the source code is: 1. $ cd eddypro-source-dir scripts/build/ 2. $ scripts/build/mac-lin-eddypro.sh [debug|release] -Note : you will need zlib and boost-math library (binary and dev files) installed. +Note : you will need zlib and boost-math library (binary and dev files) installed, + and you might also install quazip lib (binary and dev files) rather than + using embedded one. #### Build the GUI using QtCreator (on Windows or Mac) From 63219c78f968c3a2faa4f0866b79bf6d0902d4d5 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 6 Feb 2019 13:18:40 +0100 Subject: [PATCH 21/31] Add include path in pro file : shoud we use includes.pri ? --- eddypro_lin.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eddypro_lin.pro b/eddypro_lin.pro index b012dba..0a87efd 100644 --- a/eddypro_lin.pro +++ b/eddypro_lin.pro @@ -48,6 +48,7 @@ CONFIG(debug, debug|release) { DEFINES += QT_DEBUG # to suppress qt and 3rdparty library warnings + QMAKE_CXXFLAGS += -isystem /usr/include/quazip QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip" win32 { @@ -102,6 +103,7 @@ CONFIG(debug, debug|release) { DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += QT_NO_WARNING_OUTPUT + QMAKE_CXXFLAGS += -isystem /usr/include/quazip macx { QMAKE_PRE_LINK += && $$_PRO_FILE_PWD_/scripts/build/mac-update-translations.sh$$escape_expand(\\n\\t) From 86108e3dd7164b90078f6a5feadf7a29cde43c5c Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Thu, 7 Feb 2019 16:40:14 +0100 Subject: [PATCH 22/31] Improve library choice for quazip : local/system. --- libs.pri | 4 +-- scripts/build/lin-pre-link.sh | 62 ++++++++++++++++++++++++++++++----- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/libs.pri b/libs.pri index 948d6b7..a33e5c9 100644 --- a/libs.pri +++ b/libs.pri @@ -22,7 +22,7 @@ CONFIG(debug, debug|release) { LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-debug -lquazip_debug # linking - QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug $$_PRO_FILE_PWD_ + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug auto $$_PRO_FILE_PWD_ } } else { win32 { @@ -46,6 +46,6 @@ CONFIG(debug, debug|release) { LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -lquazip # linking - QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release $$_PRO_FILE_PWD_ + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release auto $$_PRO_FILE_PWD_ } } diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 57d3834..0cb4aed 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -1,17 +1,40 @@ #!/bin/sh + + echo "Copying dynamic libraries in the debug or release build folder... " if [ "$#" -eq 0 ]; then echo "Usage: $0 debug|release [project-root-dir]\n" 1>&2 - exit 1 -fi + cat 1>&2 << END +Usage: $0 debug|release [system|local] [project-root-dir] -if [ -n "`ldconfig -p | grep libquazip`" ] ; then - echo "Make use of system quazip lib rather than build it." - exit -fi + debug or release : mandatory + specifies which version of library is to be copied + and which folder it copied to (before linking). + This is ignored if system's library is used. + + system or local or auto : optional + specifies if library to be used is system's or local one. + If 'auto' (or anything else but 'system' or 'local'), use + system's if any (according ldconfig), local's one otherwise. + project-root-dir : optional + specify project's directory, used for finding local library + (libs/quazip-*) +In case of local library usage (previously made), +copy dynamic libraries in the debug or release build folder, +make appropriate links for linking and dynamic load, +and create bash launcher for appropriate use of library (if needed), +as no proper lib install is automatically done. + +Note : +Debug library may not be available with system's one. +END + exit 1 +fi + +## arguments processing if [ "$1" = "debug" ] ; then DEBUG_OR_RELEASE="debug" QUAZIP_LIB="libquazip_debug.so.1.0.0" @@ -21,9 +44,26 @@ else QUAZIP_LIB="libquazip.so.1.0.0" BINFILE="eddypro" fi -if [ -n "$2" ] ; then - ROOT_DIR="$2" +# use local or system's lib ? +if [ -n "`ldconfig -p | grep libquazip`" ] ; then + if [ "$2" = "local" ] ; then + echo "warning : use of local lib quazip for building while existing in system : can lead to problems at execution." >&2 + else + # i.e for system, auto, "" or anything + echo "Make use of system quazip lib rather than build it => nothing to do" + exit + else + fi +elif [ "$2" = "system" ] ; then + # no lib, but system required + echo "system's library is required but none was detected on system (using ldconfig)" 1>&2 + exit 1 +fi + +if [ -n "$3" ] ; then + ROOT_DIR="$3" else + # suppose ROOT_DIR is the same as git's repo name ROOT_DIR="../eddypro-gui" fi @@ -55,11 +95,15 @@ cp "$ROOT_DIR/libs/$QUAZIP_BUILD_DIR/$QUAZIP_LIB" "$BUILD_DIR" cd $BUILD_DIR qzlib=`basename $QUAZIP_LIB .1.0.0` ln -s "$QUAZIP_LIB" "$qzlib" -# link to .so.1 file (for binary linking) +# link to .so.1 file (for binary linking) at runtime +# not useful is properly installed qzlib=`basename $QUAZIP_LIB .1.0.0` ln -s "$QUAZIP_LIB" "$qzlib.1" cd - + # add a launching wrapper, as a quick hack for installation lack +# not useful is properly installed +echo "Create sh launcher eddypro.sh" cat > "$BUILD_DIR/eddypro.sh" << EOF #!/bin/sh BINDIR="\`dirname \$0\`" From cacbfa1aee3decc23e9971b30e4b158800f2584e Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Thu, 7 Feb 2019 16:56:35 +0100 Subject: [PATCH 23/31] Use same qmake command as qtcreator. --- scripts/build/lin-build-eddypro.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index 9609860..fdd169c 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -49,7 +49,11 @@ echo "### Make shadow build in '$PWD'..." cd "$SHADOW_DIR" if [ ! -f Makefile ] ; then echo "### Run 'qmake'..." - qmake -Wall $qmake_project + if [ "$$DEBUG_OR_RELEASE" = "debug" ] ; then + qmake -Wall $qmake_project -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug + else + qmake -Wall $qmake_project -spec linux-g++ + fi fi echo "### Run 'make'..." From 8532773a4f758aff3e0c5a071e3d1bb781259cac Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Fri, 8 Feb 2019 09:35:49 +0100 Subject: [PATCH 24/31] Let quazip build append if requested (whatever system's version is installed or not). Add help and comments. --- scripts/build/lin-build-quazip.sh | 45 ++++++++++++++++++++++++------- scripts/build/lin-pre-link.sh | 3 ++- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/scripts/build/lin-build-quazip.sh b/scripts/build/lin-build-quazip.sh index c15ea3f..ffd176b 100755 --- a/scripts/build/lin-build-quazip.sh +++ b/scripts/build/lin-build-quazip.sh @@ -1,5 +1,6 @@ #!/bin/sh +QZ="quazip-0.7.1" # shadow build in debug or release # usage @@ -8,13 +9,33 @@ echo "### Running '$ $0 $@' in '$PWD'..." if [ "$#" -eq 0 ]; then - echo "Usage: $0 debug|release [dir-or-auto]\n\tMust be launched from project's root directory" 1>&2 - exit 1 -fi + cat 1>&2 << END +Usage: $0 debug|release [dir-or-auto] + + debug or release : mandatory + build in debug or release profile + dir-or-auto : optional + specify shadow directory where build will be made. + If 'auto', automatic creation of shadow directory is done. + If not used, build will be made "in-place", i.e. in quazip + ($QZ) directory. + +Quazip libray used is the one ($QZ) in libs directory. +Patch is applied, shadow directory created (if needed), +qmake applied (Makefile generation), then make. + +Note: +If compilation directory is not 'auto' or 'in-place', i.e. custom +defined, pre-link script won't find appropriate path, unless specified as option. +In such a case, main building script can't be used. + +Note : +Must be launched from project's root directory (for paths finding). -if [ -n "`ldconfig -p | grep libquazip`" ] ; then - echo "Make use of system quazip lib rather than building it." - exit +Dependencies : + quazip depends on zlib (library and headers) +END + exit 1 fi @@ -29,7 +50,6 @@ if [ ! -d libs ] ; then fi -QZ="quazip-0.7.1" # full path is (from root) : # libs//quazip cd libs @@ -44,7 +64,7 @@ SRC_DIR="$PWD" if [ -f ../../$QZ.patch ] ; then echo " > Apply patch" if [ -n "`grep '\-lz' quazip.pro`" ] ; then # this test depends on patch content - # hard to know simply know whether patch has already been applied ! + # hard to simply know whether patch has already been applied ! # but applying it twice is no good echo " seems that patch has already been applied" else @@ -70,10 +90,15 @@ if [ -n "$2" ] ; then fi echo "### Make shadow build in '$PWD'..." - if [ ! -f Makefile ] ; then + # if Makefile is already existing, guess that qmake was already launched before, + # hence don't do it again echo " > Launch qmake (in-place building)" - qmake -Wall $qmake_project + if [ "$$DEBUG_OR_RELEASE" = "debug" ] ; then + qmake -Wall $qmake_project -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug + else + qmake -Wall $qmake_project -spec linux-g++ + fi fi echo " > Launch make for $DEBUG_OR_RELEASE" diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 0cb4aed..160475d 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -29,7 +29,8 @@ and create bash launcher for appropriate use of library (if needed), as no proper lib install is automatically done. Note : -Debug library may not be available with system's one. +Debug version of quazip library may not be available on system. + END exit 1 fi From cecbc43df0364da89781b797ec68895d9babbb7c Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Fri, 8 Feb 2019 12:57:52 +0100 Subject: [PATCH 25/31] Add qmake config for quazip choice (local/system). --- eddypro_lin.pro | 25 ++++++++++++-- includes.pri | 8 +++-- libs.pri | 6 +++- scripts/build/lin-build-eddypro.sh | 52 ++++++++++++++++++++++++++++-- 4 files changed, 82 insertions(+), 9 deletions(-) diff --git a/eddypro_lin.pro b/eddypro_lin.pro index 0a87efd..3159769 100644 --- a/eddypro_lin.pro +++ b/eddypro_lin.pro @@ -18,6 +18,22 @@ CONFIG += warn_on CONFIG += debug_and_release CONFIG += c++14 +unix{ + CONFIG(debug, debug|release) { + CONFIG += quazip-local + } + CONFIG(quazip-qt5, quazip|quazip-qt5|quazip-local) { + QUAZIP_NAME = quazip5 + QUAZIP_INC = /usr/include/quazip5 + } else:CONFIG(quazip-local, quazip|quazip-qt5|quazip-local) { + QUAZIP_NAME = quazip + QUAZIP_INC = $$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip + } else { + QUAZIP_NAME = quazip + QUAZIP_INC = /usr/include/quazip + } +} + TRANSLATIONS = tra/eddypro_en.ts # Build tree with shadow building approach @@ -48,8 +64,12 @@ CONFIG(debug, debug|release) { DEFINES += QT_DEBUG # to suppress qt and 3rdparty library warnings - QMAKE_CXXFLAGS += -isystem /usr/include/quazip - QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip" + unix { + QMAKE_CXXFLAGS += -isystem $$QUAZIP_DEV + } else { + QMAKE_CXXFLAGS += -isystem "$$QT_PATH/include" + QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip" + } win32 { # mingw warnings @@ -103,7 +123,6 @@ CONFIG(debug, debug|release) { DEFINES += QT_NO_DEBUG_OUTPUT DEFINES += QT_NO_WARNING_OUTPUT - QMAKE_CXXFLAGS += -isystem /usr/include/quazip macx { QMAKE_PRE_LINK += && $$_PRO_FILE_PWD_/scripts/build/mac-update-translations.sh$$escape_expand(\\n\\t) diff --git a/includes.pri b/includes.pri index d677f4f..04e0a99 100644 --- a/includes.pri +++ b/includes.pri @@ -1,4 +1,8 @@ # include paths -INCLUDEPATH += $$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip -INCLUDEPATH += $$_PRO_FILE_PWD_/../../../libs/c++/boost_1_61_0 +unix{ + INCLUDEPATH += $$QUAZIP_INC +} else { + INCLUDEPATH += $$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip + INCLUDEPATH += $$_PRO_FILE_PWD_/../../../libs/c++/boost_1_61_0 +} INCLUDEPATH += $$_PRO_FILE_PWD_/src/lisp_parser diff --git a/libs.pri b/libs.pri index a33e5c9..1d086a6 100644 --- a/libs.pri +++ b/libs.pri @@ -43,7 +43,11 @@ CONFIG(debug, debug|release) { # quazip # set LIBS, although -Lrelease should be enough as # .so files are copied there by PRE_LINK script - LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -lquazip + CONFIG(quazip-local, quazip|quazip-qt5|quazip-local) { + LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -l$$QUAZIP_NAME + } else { + LIBS += -l$$QUAZIP_NAME + } # linking QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release auto $$_PRO_FILE_PWD_ diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index fdd169c..e8c5f86 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -7,7 +7,41 @@ echo "### Running '$ $0 $@' in '$PWD'..." if [ "$#" -ne 1 ]; then - echo "Usage: $0 [debug|release]\n\tMust be launched from project's root directory" 1>&2 + cat 1>&2 << END +Usage: $0 [debug|release] [quazip-library] + + debug or release : + build according debug or release profile. + + quazip-library : optional + can be 'quazip', 'quazip-qt4', 'quazip-qt5', 'auto' or nothing + - local : use (and build) quazip's local library + - quazip : use quazip's system library, whatever it is + - quazip-qt4 : use quazip's system library, qt4 compiled version + - quazip-qt5 : use quazip's system library, qt5 compiled version + - auto or nothing : use quazip's system library if any, local's one otherwise + +This script will extract and convert needed ressources files (translations, fonts), +compile quazip lib if needed, create a shadow building directory, + and build eddypro application (with needed library and a launching script if +local quazip is used. + +Re-launching this script should not re-do things already done. +If you wan't to rebuild from scratch, just remove building shadow directory +(but this will keep project's extracted files, such as fonts, translations or quazip files) + +About quazip : + you can use quazip library included in this repository (local version) + (and a compilation will then be done) + or use the quazip library of you're system (we then need dynamic + library and headers). There might be then a problem of version. + For more details, see README.linux and ./scripts/build/lin-build-quazip.sh. + +Note : +Must be launched from project's root directory, i.e. +$ scripts/build/lin-build-eddypro.sh + +END exit 1 fi if [ "$1" = "debug" ] ; then @@ -49,10 +83,22 @@ echo "### Make shadow build in '$PWD'..." cd "$SHADOW_DIR" if [ ! -f Makefile ] ; then echo "### Run 'qmake'..." + case "$2" in + local) CFG="quazip-local" ;; + quazip|quazip-qt4) CFG="quazip" ;; + quazip-qt5) CFG="quazip-qt5" ;; + *) + if [ -n "`ldconfig -p | grep libquazip`" ] ; then + CFG="quazip" + else + CFG="quazip-local" + fi + ;; + esac if [ "$$DEBUG_OR_RELEASE" = "debug" ] ; then - qmake -Wall $qmake_project -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug + qmake -Wall $qmake_project -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug CONFIG+=$CFG else - qmake -Wall $qmake_project -spec linux-g++ + qmake -Wall $qmake_project -spec linux-g++ CONFIG+=$CFG fi fi From 43e50044f1be2f78f6bef3ebb7612da33f2945d0 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Fri, 8 Feb 2019 13:10:35 +0100 Subject: [PATCH 26/31] Debug build script. --- scripts/build/lin-build-eddypro.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index e8c5f86..3f69a52 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -6,7 +6,7 @@ echo "### Running '$ $0 $@' in '$PWD'..." -if [ "$#" -ne 1 ]; then +if [ $# -eq 0 ]; then cat 1>&2 << END Usage: $0 [debug|release] [quazip-library] @@ -54,9 +54,23 @@ if [ ! -f eddypro_lin.pro ] ; then exit 1 fi SRC_DIR="$PWD" +case "$2" in + local) CFG="quazip-local" ;; + quazip|quazip-qt4) CFG="quazip" ;; + quazip-qt5) CFG="quazip-qt5" ;; + *) + if [ -n "`ldconfig -p | grep libquazip`" ] ; then + CFG="quazip" + else + CFG="quazip-local" + fi + ;; +esac # build libs -$SRC_DIR/scripts/build/lin-build-quazip.sh $DEBUG_OR_RELEASE auto +if [ "$CFG" = "quazip-local" -o $DEBUG_OR_RELEASE = "debug" ] ; then + $SRC_DIR/scripts/build/lin-build-quazip.sh $DEBUG_OR_RELEASE auto +fi # update ressource $SRC_DIR/scripts/build/lin-update-ressources.sh $DEBUG_OR_RELEASE @@ -83,18 +97,6 @@ echo "### Make shadow build in '$PWD'..." cd "$SHADOW_DIR" if [ ! -f Makefile ] ; then echo "### Run 'qmake'..." - case "$2" in - local) CFG="quazip-local" ;; - quazip|quazip-qt4) CFG="quazip" ;; - quazip-qt5) CFG="quazip-qt5" ;; - *) - if [ -n "`ldconfig -p | grep libquazip`" ] ; then - CFG="quazip" - else - CFG="quazip-local" - fi - ;; - esac if [ "$$DEBUG_OR_RELEASE" = "debug" ] ; then qmake -Wall $qmake_project -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug CONFIG+=$CFG else From b825cbde909468eea90456ebc0ca15fc34b83692 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Fri, 8 Feb 2019 14:46:08 +0100 Subject: [PATCH 27/31] Bug : unwanted (remaining ?) 'else' directive. --- scripts/build/lin-pre-link.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/build/lin-pre-link.sh b/scripts/build/lin-pre-link.sh index 160475d..243e01c 100755 --- a/scripts/build/lin-pre-link.sh +++ b/scripts/build/lin-pre-link.sh @@ -53,7 +53,6 @@ if [ -n "`ldconfig -p | grep libquazip`" ] ; then # i.e for system, auto, "" or anything echo "Make use of system quazip lib rather than build it => nothing to do" exit - else fi elif [ "$2" = "system" ] ; then # no lib, but system required From 09db1204b7666ff4f12a1ec630c9b16991566c20 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Fri, 8 Feb 2019 15:34:51 +0100 Subject: [PATCH 28/31] Bug : missing appropriate option for local quazip lib. --- libs.pri | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs.pri b/libs.pri index 1d086a6..b052695 100644 --- a/libs.pri +++ b/libs.pri @@ -22,7 +22,7 @@ CONFIG(debug, debug|release) { LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-debug -lquazip_debug # linking - QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug auto $$_PRO_FILE_PWD_ + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh debug local $$_PRO_FILE_PWD_ } } else { win32 { @@ -45,11 +45,13 @@ CONFIG(debug, debug|release) { # .so files are copied there by PRE_LINK script CONFIG(quazip-local, quazip|quazip-qt5|quazip-local) { LIBS += -L$$_PRO_FILE_PWD_/libs/build-quazip-0.7.1-release -l$$QUAZIP_NAME + # pre-linking actions + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release local $$_PRO_FILE_PWD_ } else { LIBS += -l$$QUAZIP_NAME + # pre-linking actions + QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release system $$_PRO_FILE_PWD_ } - # linking - QMAKE_PRE_LINK += $$_PRO_FILE_PWD_/scripts/build/lin-pre-link.sh release auto $$_PRO_FILE_PWD_ } } From 6432a2cc0f1da075d6fa6dcfd1051fba4e35ffa7 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Fri, 8 Feb 2019 15:49:06 +0100 Subject: [PATCH 29/31] Add readme file for linux compilation. --- README.linux | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 README.linux diff --git a/README.linux b/README.linux new file mode 100644 index 0000000..71ba912 --- /dev/null +++ b/README.linux @@ -0,0 +1,19 @@ + +Dependencies (besides building tools): + * libboost-math : library and headers + Debian-based packages : libboost-math*, libboost-math*-dev, libboost-dev + * lib quazip : library and headers + Debian-based packages : libquazip1, libquazip-headers, libquazip-dev + or libquazip5-1, libquazip5-headers, libquazip5-dev + * zlib if quazip local compiled : library and headers + Debian-based packages : zlib1g, zlib1g-dev + +Tested : + * Ubuntu 18.04 / gcc 7 / Qt version 5.9.5 + - libboost-math 1.65, libquazip 0.7.3 (qt4/qt5 versions) + - zlib 1.2.11 + * Debian 9 / gcc 6 / Qt version 5.7.1 + - libboost-math 1.62, libquazip 0.7.2 (qt4/qt5 versions) + - + + From 205f14cf2bf4be556adea05b7935d8b611ee2d8d Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 13 Feb 2019 11:59:18 +0100 Subject: [PATCH 30/31] debug building : use un-appropriaye variable. --- eddypro_lin.pro | 2 +- scripts/build/lin-build-eddypro.sh | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/eddypro_lin.pro b/eddypro_lin.pro index 3159769..a2f273b 100644 --- a/eddypro_lin.pro +++ b/eddypro_lin.pro @@ -65,7 +65,7 @@ CONFIG(debug, debug|release) { # to suppress qt and 3rdparty library warnings unix { - QMAKE_CXXFLAGS += -isystem $$QUAZIP_DEV + QMAKE_CXXFLAGS += -isystem $$QUAZIP_INC } else { QMAKE_CXXFLAGS += -isystem "$$QT_PATH/include" QMAKE_CXXFLAGS += -isystem "$$_PRO_FILE_PWD_/libs/quazip-0.7.1/quazip" diff --git a/scripts/build/lin-build-eddypro.sh b/scripts/build/lin-build-eddypro.sh index 3f69a52..23f03d7 100755 --- a/scripts/build/lin-build-eddypro.sh +++ b/scripts/build/lin-build-eddypro.sh @@ -46,6 +46,7 @@ END fi if [ "$1" = "debug" ] ; then DEBUG_OR_RELEASE=$1 + CFG="quazip-local" else DEBUG_OR_RELEASE="release" fi @@ -54,18 +55,20 @@ if [ ! -f eddypro_lin.pro ] ; then exit 1 fi SRC_DIR="$PWD" -case "$2" in - local) CFG="quazip-local" ;; - quazip|quazip-qt4) CFG="quazip" ;; - quazip-qt5) CFG="quazip-qt5" ;; - *) - if [ -n "`ldconfig -p | grep libquazip`" ] ; then - CFG="quazip" - else - CFG="quazip-local" - fi - ;; -esac +if [ -z "$CFG" ] ; then + case "$2" in + local) CFG="quazip-local" ;; + quazip|quazip-qt4) CFG="quazip" ;; + quazip-qt5) CFG="quazip-qt5" ;; + *) + if [ -n "`ldconfig -p | grep libquazip`" ] ; then + CFG="quazip" + else + CFG="quazip-local" + fi + ;; + esac +fi # build libs if [ "$CFG" = "quazip-local" -o $DEBUG_OR_RELEASE = "debug" ] ; then From 679bf069b5817ba5b550389891e4af6844b880f6 Mon Sep 17 00:00:00 2001 From: BotoKopo Date: Wed, 27 Mar 2019 09:49:42 +0100 Subject: [PATCH 31/31] Update README files. --- README.linux | 2 +- README.md | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.linux b/README.linux index 71ba912..7edf0f4 100644 --- a/README.linux +++ b/README.linux @@ -14,6 +14,6 @@ Tested : - zlib 1.2.11 * Debian 9 / gcc 6 / Qt version 5.7.1 - libboost-math 1.62, libquazip 0.7.2 (qt4/qt5 versions) - - + - zlib 1.2.8 diff --git a/README.md b/README.md index 8a96532..46f09ea 100644 --- a/README.md +++ b/README.md @@ -96,11 +96,14 @@ In a terminal enter the following commands, where `eddypro-source-dir` is the directory where the source code is: 1. $ cd eddypro-source-dir scripts/build/ - 2. $ scripts/build/mac-lin-eddypro.sh [debug|release] + 2. $ scripts/build/lin-build-eddypro.sh [debug|release] Note : you will need zlib and boost-math library (binary and dev files) installed, - and you might also install quazip lib (binary and dev files) rather than - using embedded one. + and you might also (previously) install quazip lib (qt5-compiled binary + and dev files) rather than compiling and using embedded one (default if + no quazip is found on system) + +Use `scripts/build/lin-build-eddypro.sh` for more help, especially for quazip. #### Build the GUI using QtCreator (on Windows or Mac)