]> SALOME platform Git repositories - tools/install.git/blob - config_files/PyQt-3.13.sh
Salome HOME
27d2b21efda6c32f68859ebcdcb4c2063e9d94fb
[tools/install.git] / config_files / PyQt-3.13.sh
1 #!/bin/sh
2
3 check_version()
4 {
5 if [ -n "${PYQTDIR}" ]; then
6     check_lib_version qt.so $PYQTDIR
7     if [ "$?" -eq "0" ]; then
8         return 0
9     fi
10 fi
11 return 1
12 }
13
14 print_env()
15 {
16 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
17 #$DELIM ${PRODUCT_TYPE} $DELIM
18 export PYQTDIR=\${INSTALL_ROOT}/${PRODUCT}
19 export PYQT_SIPS=\${PYQTDIR}/sip
20 export PATH=\${PYQTDIR}:\$PATH 
21 export LD_LIBRARY_PATH=\${PYQTDIR}:\$LD_LIBRARY_PATH 
22 export PYTHONPATH=\${PYQTDIR}:\${PYTHONPATH}
23 ##
24 EOF
25 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
26 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
27 }
28
29 # looks for the native product and collects it's environment (used by make_env())
30 try_native(){
31 pyqtdir="`find_in_path pyuic ${PATH}`"
32 if [ -z "${pyqtdir}" ] ; then
33     pyqtdir="`find_in_path pyuic /usr/bin`"
34 fi
35 if [ -n "${pyqtdir}" ] ; then
36     pyqt_sips=${pyqtdir}/sip
37     if [ ! -d "${pyqt_sips}" ] ; then
38         pyqt_sips="/usr/share/sip/qt"
39         if [ ! -d "${pyqt_sips}" ] ; then
40             return 1
41         fi
42     fi
43     python_version="`python -c 'import sys; print sys.version[:3]'`"
44     pythonpath="`find_in_path qt.so ${PYTHONPATH}`"
45     if [ -z "${pythonpath}" ] ; then
46         pythonpath="`find_in_path qt.so /usr/lib/python${python_version}/site-packages`"
47     fi
48     if [ -n "${pythonpath}" ] ; then
49         tmp="${pyqtdir} ${pyqtdir} \${PATH} ${PATH}";  
50         path=`sort_path ${tmp}`
51         tmp="${pythonpath} ${pythonpath} \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
52         ld_library_path=`sort_path ${tmp}`
53         tmp="${pythonpath} ${pythonpath} \${PYTHONPATH} ${PYTHONPATH}";  
54         pythonpath=`sort_path ${tmp}`
55         cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
56 #$DELIM ${PRODUCT_TYPE} $DELIM
57 export PYQT_SIPS=${pyqt_sips}
58 export PATH=${path}
59 export PYTHONPATH=${pythonpath}
60 export LD_LIBRARY_PATH=${ld_library_path}
61 ##
62 EOF
63         make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
64         return 0
65     fi
66 fi
67 return 1;
68 }
69
70 try_preinstalled(){
71 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
72 return $?
73 }
74
75 install_source()
76 {
77 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
78 source ${INSTALL_WORK}/$SHRC
79
80 makedir ${PRODUCT_DIR}
81
82 check_jb tar xfz ${SOURCE_DIR}/PyQt-3.13.tar.gz -C ${INSTALL_WORK}
83 cd ${PRODUCT_WORK}
84
85 sed -e 's%check_license()$%#check_license()%g' configure.py > configure.py.new
86 mv -f configure.py.new configure.py
87
88 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
89     python configure.py -b ${PRODUCT_DIR} -d ${PRODUCT_DIR} -v ${PRODUCT_DIR}/sip
90 GCC=`which gcc`
91 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
92 used gcc=$GCC
93 EOF
94 check_job ${PRODUCT_DIR}/MAKE.LOG make
95 check_job ${PRODUCT_DIR}/INSTALL.LOG make install
96
97 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
98 rm -fr ${PRODUCT_WORK}
99 print_env
100 }
101
102 install_binary()
103 {
104 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
105 source ${INSTALL_WORK}/$SHRC
106
107 check_jb tar xfz ${SOURCE_DIR}/PyQt-3.13.tar.gz -C ${INSTALL_ROOT}
108
109 print_env
110 }
111
112 export PROCEDURE=$1;
113 export INSTALL_WORK=$2;
114 export SOURCE_DIR=$3;
115 export INSTALL_ROOT=$4;
116 export PRODUCT_SEQUENCE=$5;
117 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="pyqt" ; fi
118 export PRODUCT="PyQt-3.13"
119 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
120 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
121 source ./common.sh
122 $PROCEDURE