# QWT version
#
QWT_VERSION=5.2.1
+QWT_MAJOR_VERSION=`echo ${QWT_VERSION} | awk -F. '{print $1}'`
check_version()
{
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
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
}