3 ####################################################################################
5 # Created : Thu Dec 18 12:01:00 2002
6 # Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
8 # Module : Installation Wizard
9 # Copyright : 2002-2007 CEA
11 # This script is the part of the SALOME installation procedure.
13 ####################################################################################
17 if [ -n "${PYQTDIR}" ] && [ -f ${PYQTDIR}/pyqtconfig.py ] ; then
18 ver=`cd ${PYQTDIR} && python -c "from pyqtconfig import Configuration; c=Configuration();print c.__getattr__('pyqt_version_str')" 2>/dev/null`
19 if [ -n "$ver" ] ; then
20 maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
21 min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
22 rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
23 let ver=$maj_ver*10000+$min_ver*100+$rel_ver
24 if [ $ver -eq 031300 ] ; then
34 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
35 #$DELIM ${PRODUCT_TYPE} $DELIM
36 export PYQTDIR=\${INSTALL_ROOT}/${PRODUCT}
37 export PYQT_SIPS=\${PYQTDIR}/sip
38 export PATH=\${PYQTDIR}:\$PATH
39 export PYTHONPATH=\${PYQTDIR}:\${PYTHONPATH}
40 export LD_LIBRARY_PATH=\${PYQTDIR}:\$LD_LIBRARY_PATH
43 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
44 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
47 # looks for the native product and collects it's environment (used by make_env())
48 # we need version 3.13 or newer
51 pyqtdir="`find_in_path pyuic ${PATH}:/usr/bin`"
52 if [ -z "${pyqtdir}" ] ; then return 1 ; fi
54 pyqt_sips="`find_in_path qtmod.sip ${pyqtdir}/sip/qt:/usr/share/sip/qt:/usr/share/sip/qt/qt`"
55 if [ -z "${pyqt_sips}" ] ; then return 1 ; fi
56 pyqt_sips=`cd $pyqt_sips/.. ; pwd`
57 # check configuration file
58 python_version="`python -c 'import sys; print sys.version[:3]'`"
59 pyqt_cfg="`find_in_path pyqtconfig.py ${pyqtdir}:/usr/lib/python${python_version}/site-packages`"
60 if [ -z "${pyqt_cfg}" ] ; then return 1 ; fi
62 pyqt_lib="`find_in_path qt.so ${pyqtdir}:/usr/lib/python${python_version}/site-packages`"
63 if [ -z "${pyqt_lib}" ] ; then return 1 ; fi
65 ver=`cd ${pyqt_cfg} && python -c "from pyqtconfig import Configuration; c=Configuration();print c.__getattr__('pyqt_version_str')" 2>/dev/null`
66 if [ -n "$ver" ] ; then
67 maj_ver=`echo $ver | awk -F. '{if(NF>0) print $1; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
68 min_ver=`echo $ver | awk -F. '{if(NF>1) print $2; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
69 rel_ver=`echo $ver | awk -F. '{if(NF>2) print $3; else print 0}' | sed -e 's/^\([0-9]*\).*$/\1/'`
70 let ver=$maj_ver*10000+$min_ver*100+$rel_ver
71 # version number should be at least 3.13
72 if [ $ver -ge 031300 ] ; then
73 tmp="${pyqtdir} ${pyqtdir} \${PATH} ${PATH}";
74 path=`sort_path ${tmp}`
75 tmp="${pyqt_lib} ${pyqt_lib} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
76 ld_library_path=`sort_path ${tmp}`
77 tmp="${pyqt_cfg} ${pyqt_cfg} \${PYTHONPATH} ${PYTHONPATH}";
78 pythonpath=`sort_path ${tmp}`
79 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
80 #$DELIM ${PRODUCT_TYPE} $DELIM
81 export PYQT_SIPS=${pyqt_sips}
83 export PYTHONPATH=${pythonpath}
84 export LD_LIBRARY_PATH=${ld_library_path}
87 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
95 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
101 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
102 source ${INSTALL_WORK}/$SHRC
104 makedir ${PRODUCT_DIR}
106 check_jb tar xfz ${SOURCE_DIR}/PyQt-3.13.tar.gz -C ${INSTALL_WORK}
109 sed -e 's%check_license()$%#check_license()%g' configure.py > configure.py.new
110 mv -f configure.py.new configure.py
112 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
113 python configure.py -b ${PRODUCT_DIR} -d ${PRODUCT_DIR} -v ${PRODUCT_DIR}/sip
115 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
118 check_job ${PRODUCT_DIR}/MAKE.LOG make
119 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
121 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
122 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
128 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
129 source ${INSTALL_WORK}/$SHRC
131 check_jb tar xfz ${SOURCE_DIR}/PyQt-3.13.tar.gz -C ${INSTALL_ROOT}
133 # modify pyqtconfig.py file
135 sed -e "s%\('pyqt_bin_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}',%g" pyqtconfig.py > pyqtconfig.py.1
136 sed -e "s%\('pyqt_mod_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}',%g" pyqtconfig.py.1 > pyqtconfig.py
137 sed -e "s%\('pyqt_sip_dir':[[:space:]]*\).*%\1'${PRODUCT_DIR}/sip',%g" pyqtconfig.py > pyqtconfig.py.1
138 mv pyqtconfig.py.1 pyqtconfig.py
144 export INSTALL_WORK=$2;
145 export SOURCE_DIR=$3;
146 export INSTALL_ROOT=$4;
147 export PRODUCT_SEQUENCE=$5;
148 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="pyqt" ; fi
149 export PRODUCT="PyQt-3.13"
150 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
151 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}