]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Adding QT 3.3.6 to IP for Mandriva2006
authormaintenance team <salome-mnt@opencascade.com>
Tue, 25 Sep 2007 10:20:46 +0000 (10:20 +0000)
committermaintenance team <salome-mnt@opencascade.com>
Tue, 25 Sep 2007 10:20:46 +0000 (10:20 +0000)
config_files/qt-3.3.6.sh [new file with mode: 0755]

diff --git a/config_files/qt-3.3.6.sh b/config_files/qt-3.3.6.sh
new file mode 100755 (executable)
index 0000000..012d478
--- /dev/null
@@ -0,0 +1,219 @@
+#!/bin/bash -noprofile
+
+####################################################################################
+#  File      : qt-3.3.6.sh
+#  Created   : Thu Dec 18 12:01:00 2002
+#  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
+#  Project   : SALOME
+#  Module    : Installation Wizard
+#  Copyright : 2002-2007 CEA
+#
+#  This script is the part of the SALOME installation procedure.
+#
+####################################################################################
+
+check_version(){
+if [ -z "$QTDIR" ]; then
+   return 1
+fi
+ver=`grep "QT_VERSION_STR" ${QTDIR}/include/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
+if [ "$ver" == "3.3.6" ] ; then
+    return 0
+fi
+return 1
+}
+
+print_env()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export QTDIR=\${INSTALL_ROOT}/${PRODUCT}
+export PATH=\${QTDIR}/bin:\$PATH 
+export LD_LIBRARY_PATH=\${QTDIR}/lib:\${LD_LIBRARY_PATH}
+##
+EOF
+(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+}
+
+# looks for the native product and collects it's environment (used by make_env())
+try_native(){
+
+qtdir=""
+  if test `uname -m` = "x86_64" ; then
+      export QT_LD_PREFIX='64'
+  else
+      QT_LD_PREFIX=''
+  fi
+
+if [ -d /usr/share/qt3/lib${QT_LD_PREFIX} ] ; then
+    qtdir="`find_in_path libqt-mt.so.3.3 /usr/share/qt3/lib\${QT_LD_PREFIX}`"
+fi
+if [ -z "${qtdir}" ] && [ -d /usr/lib/qt3/lib${QT_LD_PREFIX} ] ; then
+    qtdir="`find_in_path libqt-mt.so.3.3 /usr/lib/qt3/lib${QT_LD_PREFIX}`"
+fi
+if [ -z "${qtdir}" ] ; then
+    qtdir="`find_in_path libqt-mt.so.3.3 /usr/lib${QT_LD_PREFIX}`"
+fi
+if [ -z "${qtdir}" ] ; then
+    qtdir="`find_in_path libqt-mt.so.3.3 ${LD_LIBRARY_PATH}`"
+fi
+if [ -n "${qtdir}" ] ; then
+    qtdir=`cd ${qtdir}/..; pwd`
+    moc="`find_in_path moc ${qtdir}/bin`"
+    uic="`find_in_path uic ${qtdir}/bin`"
+    if [ -n "${moc}" ] && [ -n "${uic}" ] ; then
+       tmp="\${QTDIR}/bin ${qtdir}/bin \${PATH} ${PATH}";  
+       path=`sort_path ${tmp}`
+       tmp="\${QTDIR}/lib${QT_LD_PREFIX} ${qtdir}/lib${QT_LD_PREFIX} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
+       ld_library_path=`sort_path ${tmp}`
+       cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM
+export QTDIR=${qtdir}
+export PATH=${path}
+export LD_LIBRARY_PATH=${ld_library_path}
+##
+EOF
+       make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+       return 0
+    fi
+fi
+return 1
+}
+
+try_preinstalled(){
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+return $?
+}
+
+install_source()
+{
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+makedir ${PRODUCT_DIR}
+
+check_jb tar xfz ${SOURCE_DIR}/qt-3.3.6.tar.gz -C ${INSTALL_WORK}
+
+cd ${PRODUCT_WORK}
+
+mv -f configure configure-orig
+sed -e "s%read acceptance%acceptance=yes%" configure-orig > configure
+chmod +x configure
+
+export QTDIR=${PRODUCT_WORK}
+export LD_LIBRARY_PATH=${QTDIR}/lib:$LD_LIBRARY_PATH
+
+# basic flags
+  if test `uname -m` = "x86_64" ; then
+      QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++-64"
+  else
+      QT_FLAGS="-release -thread -shared -qt-gif -platform linux-g++"
+  fi
+# use system graphics libraries
+QT_FLAGS=$QT_FLAGS" -system-libjpeg -system-libpng -system-libmng -qt-imgfmt-jpeg -qt-imgfmt-png -qt-imgfmt-mng -lpng -lmng -ljpeg"
+
+# add -dlopen-opengl flag (ONLY if the corresponding patch was applied)
+if [ "$patched_for_gl" == "yes" ] ; then
+    QT_FLAGS=$QT_FLAGS" -dlopen-opengl"
+fi
+
+# plugins
+if [ -e /etc/mandriva-release ] ; then
+    version=`cat /etc/mandriva-release | awk '{print $1$4}'`
+    if [ "$version" == "Mandriva2006.0" ] ; then
+    QT_FLAGS=$QT_FLAGS" -plugin-style-cde -plugin-style-compact -plugin-style-motif -plugin-style-motifplus -plugin-style-platinum -plugin-style-sgi"
+    fi
+fi
+
+# configure
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure $QT_FLAGS -prefix ${PRODUCT_DIR}
+
+sed -e "s%^all: symlinks src-qmake src-moc sub-src sub-tools sub-tutorial sub-examples%all: symlinks src-qmake src-moc sub-src sub-tools%g" Makefile > _Makefile
+mv -f _Makefile Makefile
+
+GCC=`which gcc`
+cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
+used gcc=$GCC
+EOF
+# small trick: INSTALL_ROOT is used inside qt-3.3.3 installation
+# so it should be set to empty string
+export INSTALL_ROOT_BACKUP=$INSTALL_ROOT
+export INSTALL_ROOT=""
+check_job ${PRODUCT_DIR}/MAKE.LOG make 
+check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
+
+if test `uname -m` = "x86_64" ; then
+     cd ${PRODUCT_DIR}; ln -sf lib lib64
+fi
+
+export INSTALL_ROOT=$INSTALL_ROOT_BACKUP
+
+for b in `find bin -mindepth 1 -maxdepth 1 -name "*"`; do
+    b=`basename $b`;
+    if [ ! -e ${PRODUCT_DIR}/bin/$b ] || [ -h ${PRODUCT_DIR}/bin/$b ]; then
+       if [ -h ${PRODUCT_DIR}/bin/$b ]; then
+           rm -f ${PRODUCT_DIR}/bin/$b
+       fi
+       cp -f ${PRODUCT_WORK}/bin/$b ${PRODUCT_DIR}/bin/$b
+    fi
+done
+
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" ${PRODUCT_DIR}/lib/libqt-mt.la`
+gllibdir="`where_gl_libs`"
+if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
+    sed -e "s%-lGL%%g" \
+       -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
+       ${PRODUCT_DIR}/lib/libqt-mt.la > ${PRODUCT_DIR}/lib/libqt-mt.la.new
+    mv -f ${PRODUCT_DIR}/lib/libqt-mt.la.new ${PRODUCT_DIR}/lib/libqt-mt.la
+fi
+
+#rm -rf ${PRODUCT_DIR}/doc
+
+#du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
+cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
+print_env
+}
+
+install_binary()
+{
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+check_jb tar xfz ${SOURCE_DIR}/qt-3.3.6.tar.gz -C ${INSTALL_ROOT}
+
+# modify libdir
+cd ${PRODUCT_DIR}/lib
+sed -e "s%^libdir='\(.*\)'%libdir='${PRODUCT_DIR}/lib'%g" libqt-mt.la > libqt-mt.la.new
+mv -f libqt-mt.la.new libqt-mt.la
+
+# modify libGL.so flags
+has_gl_dep=`grep -E "^dependency_libs=.*-lGL.*" libqt-mt.la`
+gllibdir="`where_gl_libs`"
+if [ "$has_gl_dep" != "" ] && [ "$gllibdir" != "" ] ; then
+    sed -e "s%-lGL%%g" \
+       -e "s%^dependency_libs='\(.*\)%dependency_libs='-L$gllibdir -lGL \1%g" \
+       libqt-mt.la > libqt-mt.la.new
+    mv -f libqt-mt.la.new libqt-mt.la
+fi
+
+# modify qt package config
+cd ${PRODUCT_DIR}/lib/pkgconfig
+sed -e "s%^prefix=\(.*\)%prefix=${PRODUCT_DIR}%g" qt-mt.pc > qt-mt.pc.new
+mv -f qt-mt.pc.new qt-mt.pc
+
+print_env
+}
+
+export PROCEDURE=$1;
+export INSTALL_WORK=$2;
+export SOURCE_DIR=$3;
+export INSTALL_ROOT=$4;
+export PRODUCT_SEQUENCE=$5;
+if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="qt" ; fi
+export PRODUCT="qt-3.3.6"
+export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+source ./common.sh
+$PROCEDURE