]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
SALOME 6.5.0 preparation: update qwt script for version 6.0.1 (currect version is...
authorinv <inv@opencascade.com>
Wed, 4 Apr 2012 13:17:49 +0000 (13:17 +0000)
committerinv <inv@opencascade.com>
Wed, 4 Apr 2012 13:17:49 +0000 (13:17 +0000)
config_files/qwt.sh

index 6ffa4697389f684d729ca677424cd37bf88a78b0..308a383822a1366ac4115effabdf7013e9ddd4c7 100755 (executable)
@@ -16,6 +16,7 @@
 # QWT version
 #
 QWT_VERSION=5.2.1
+QWT_MAJOR_VERSION=`echo ${QWT_VERSION} | awk -F. '{print $1}'`
 
 check_version()
 {
@@ -83,13 +84,21 @@ install_source
 cd ${PRODUCT_SRC_DIR}
 test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 
-sed -e "s%\(INSTALLBASE[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" \
-    -e "s%#\(CONFIG[[:space:]]*+=[[:space:]]*QwtSVGItem\)%\1%g" qwtconfig.pri > qwtconfig.pri.new
-mv -f qwtconfig.pri.new qwtconfig.pri
+# specify install path
+if [ "${QWT_MAJOR_VERSION}" == "5" ] ; then
+    # for Qwt 5.x the variable is INSTALLBASE
+    sed -i "s%\(INSTALLBASE[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri
+else
+    # for Qwt 6.x the variable is QWT_INSTALL_PREFIX
+    sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri
+fi
 
-sed -e "s%\(target\.path[[:space:]]*\)=\([[:space:]]*\).*%\1=\2\$\$INSTALLBASE/plugins/designer%g" \
-    designer/designer.pro > designer/designer.pro.new
-mv -f designer/designer.pro.new designer/designer.pro
+if [ "${QWT_MAJOR_VERSION}" == "5" ] ; then
+    # include QwtSvg support (required only for qwt 5.x)
+    sed -i "s%#\(CONFIG[[:space:]]*+=[[:space:]]*QwtSVGItem\)%\1%g" qwtconfig.pri
+    # specify correct installation path for the designer plugin (required only for qwt 5.x)
+    sed -i "s%\(target\.path[[:space:]]*\)=\([[:space:]]*\).*%\1=\2\$\$INSTALLBASE/plugins/designer%g" designer/designer.pro
+fi
 
 INSTALL_ROOT_PREV=$INSTALL_ROOT
 unset INSTALL_ROOT
@@ -136,6 +145,11 @@ test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
 
 check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
 
+# patch features files (required for Qwt 6.x only)
+if [ "${QWT_MAJOR_VERSION}" == "6" ] ; then
+    test -f ${PRODUCT_DIR}/features/qwtconfig.pri && cd ${PRODUCT_DIR}/features && sed -i "s%\(QWT_INSTALL_PREFIX[[:space:]]*\)=\([[:space:]]*\).*%\1=\2${PRODUCT_DIR}%g" qwtconfig.pri
+fi
+
 # to generate environment script for sources
 try_preinstalled
 }