1 | #!/bin/sh
|
---|
2 |
|
---|
3 | ### qt ###
|
---|
4 | cd ${SRC}
|
---|
5 | LOG=qt-blfs.log
|
---|
6 |
|
---|
7 | SELF=`basename ${0}`
|
---|
8 | set_buildenv
|
---|
9 | set_libdirname
|
---|
10 | setup_multiarch
|
---|
11 |
|
---|
12 | # qt-setup.sh should have been sourced
|
---|
13 | #QT_INSTALL_SELF_CONTAINED=Y
|
---|
14 | #USE_MYSQL=Y
|
---|
15 | #USE_PGSQL=Y
|
---|
16 | #USE_UNIXODBC=Y
|
---|
17 |
|
---|
18 | if [ "Y" = "${QT_INSTALL_SELF_CONTAINED}" ]; then
|
---|
19 | # for now, install to /opt
|
---|
20 | qtprefix="/opt/qt-${QT_VER}"
|
---|
21 | qtheaderdir="${qtprefix}/include"
|
---|
22 | extra_conf="${extra_conf} -libdir ${qtprefix}/${libdirname}"
|
---|
23 | # TODO: probably only want to do this if BIARCH, but hey
|
---|
24 | # plugins should probably go under libdir
|
---|
25 | # This stops the plugins from each arch getting clobbering
|
---|
26 | extra_conf="${extra_conf} -plugindir ${qtprefix}/${libdirname}/plugins"
|
---|
27 | headerdir=
|
---|
28 | else
|
---|
29 | qtprefix="/usr"
|
---|
30 | qtheaderdir="${qtprefix}/include/qt"
|
---|
31 | extra_conf="${extra_conf} -docdir ${qtprefix}/share/doc/qt"
|
---|
32 | extra_conf="${extra_conf} -headerdir ${qtprefix}/include/qt"
|
---|
33 | extra_conf="${extra_conf} -libdir ${qtprefix}/${libdirname}"
|
---|
34 | extra_conf="${extra_conf} -plugindir ${qtprefix}/${libdirname}/qt/plugins"
|
---|
35 | extra_conf="${extra_conf} -datadir ${qtprefix}/share/qt"
|
---|
36 | extra_conf="${extra_conf} -translationdir ${qtprefix}/share/qt/translations"
|
---|
37 | extra_conf="${extra_conf} -sysconfdir /etc/qt"
|
---|
38 | fi
|
---|
39 |
|
---|
40 | if [ "${USE_MYSQL}" = "Y" ]; then
|
---|
41 | extra_conf="${extra_conf} -plugin-sql-mysql $( mysql_config --include )"
|
---|
42 | echo extra_conf
|
---|
43 | fi
|
---|
44 |
|
---|
45 |
|
---|
46 | if [ "${USE_POSTGRES}" = "Y" ]; then
|
---|
47 | extra_conf="${extra_conf} -plugin-sql-psql -I$( pg_config --includedir )"
|
---|
48 | fi
|
---|
49 |
|
---|
50 | if [ "${USE_ODBC}" = "Y" ]; then
|
---|
51 | extra_conf="${extra_conf} -plugin-sql-odbc -I/usr/include"
|
---|
52 | fi
|
---|
53 |
|
---|
54 | unpack_tarball qt-x11-free-${QT_VER}
|
---|
55 | cd ${PKGDIR}
|
---|
56 |
|
---|
57 | # Here we have to handle lib / lib64 , and also handle multilib compilers
|
---|
58 | if [ "Y" = "${MULTIARCH}" ]; then
|
---|
59 | platform="linux-g++"
|
---|
60 | if [ "${libdirname}" = "lib64" ]; then platform="linux-g++-64" ; fi
|
---|
61 | fi
|
---|
62 |
|
---|
63 | sed -i "s@\(gcc\|g++\)@& ${ARCH_CFLAGS} ${TGT_CFLAGS}@g" \
|
---|
64 | mkspecs/${platform}/qmake.conf
|
---|
65 |
|
---|
66 | # Force removal of existing file when installing
|
---|
67 | echo "QMAKE_INSTALL_FILE = cp --remove-destination" \
|
---|
68 | >> mkspecs/${platform}/qmake.conf
|
---|
69 | sed -i -e 's@cp -f@cp --remove-destination@g' \
|
---|
70 | qmake/Makefile.unix
|
---|
71 |
|
---|
72 | extra_conf="${extra_conf} -platform ${platform}"
|
---|
73 |
|
---|
74 | export QTDIR="${SRC}/${PKGDIR}"
|
---|
75 | export LD_LIBRARY_PATH="${QTDIR}/lib:${LD_LIBRARY_PATH}"
|
---|
76 | export PATH=${QTDIR}/bin:${PATH}
|
---|
77 |
|
---|
78 | max_log_init qt ${QT_VER} "blfs (shared)" ${CONFLOGS} ${LOG}
|
---|
79 | echo "yes" | ./configure \
|
---|
80 | -prefix ${qtprefix} ${extra_conf} \
|
---|
81 | -no-exceptions -thread -plugin-imgfmt-png \
|
---|
82 | -system-libpng -system-libmng -system-zlib -system-libjpeg \
|
---|
83 | -system-nas-sound -qt-gif -tablet \
|
---|
84 | >> ${LOGFILE} 2>&1 &&
|
---|
85 | echo " o Configure OK" || barf
|
---|
86 |
|
---|
87 | min_log_init ${BUILDLOGS} &&
|
---|
88 | make \
|
---|
89 | >> ${LOGFILE} 2>&1 &&
|
---|
90 | echo " o Build OK" || barf
|
---|
91 |
|
---|
92 | if [ "Y" = "${MULTIARCH}" ]; then
|
---|
93 | # Preserve any existing configurations for the other
|
---|
94 | # qt platform during install
|
---|
95 | case ${platform} in
|
---|
96 | linux-g++ )
|
---|
97 | if [ -d ${qtprefix}/mkspecs/linux-g++-64 ];then
|
---|
98 | mv ${qtprefix}/mkspecs/linux-g++-64 \
|
---|
99 | ${qtprefix}/mkspecs/linux-g++-64-ORIG
|
---|
100 | fi
|
---|
101 | ;;
|
---|
102 | linux-g++-64 )
|
---|
103 | if [ -d ${qtprefix}/mkspecs/linux-g++ ];then
|
---|
104 | mv ${qtprefix}/mkspecs/linux-g++ \
|
---|
105 | ${qtprefix}/mkspecs/linux-g++-ORIG
|
---|
106 | fi
|
---|
107 | ;;
|
---|
108 | esac
|
---|
109 | fi
|
---|
110 |
|
---|
111 | min_log_init ${INSTLOGS} &&
|
---|
112 | make install \
|
---|
113 | >> ${LOGFILE} 2>&1 &&
|
---|
114 | echo " o ALL OK" || barf
|
---|
115 |
|
---|
116 | if [ "Y" = "${MULTIARCH}" ]; then
|
---|
117 | case ${platform} in
|
---|
118 | linux-g++ )
|
---|
119 | if [ -d ${qtprefix}/mkspecs/linux-g++-64-ORIG ];then
|
---|
120 | rm -rf ${qtprefix}/mkspecs/linux-g++-64
|
---|
121 | mv ${qtprefix}/mkspecs/linux-g++-64-ORIG \
|
---|
122 | ${qtprefix}/mkspecs/linux-g++-64
|
---|
123 | fi
|
---|
124 | ;;
|
---|
125 | linux-g++-64 )
|
---|
126 | if [ -d ${qtprefix}/mkspecs/linux-g++-ORIG ];then
|
---|
127 | rm -rf ${qtprefix}/mkspecs/linux-g++
|
---|
128 | mv ${qtprefix}/mkspecs/linux-g++-ORIG \
|
---|
129 | ${qtprefix}/mkspecs/linux-g++
|
---|
130 | fi
|
---|
131 | ;;
|
---|
132 | esac
|
---|
133 | fi
|
---|
134 |
|
---|
135 | if [ "Y" = "${QT_INSTALL_SELF_CONTAINED}" ]; then
|
---|
136 | ln -sfn qt-${QT_VER} /opt/qt
|
---|
137 | cp -r doc/man ${qtprefix}/doc
|
---|
138 | cp -r examples ${qtprefix}/doc
|
---|
139 | else
|
---|
140 | cp -r doc/man ${qtprefix}/share
|
---|
141 | cp -r examples ${qtprefix}/share/doc/qt
|
---|
142 | fi
|
---|
143 |
|
---|
144 | ln -s libqt-mt.so ${qtprefix}/${libdirname}/libqt.so &&
|
---|
145 | rm ${qtprefix}/bin/qmake &&
|
---|
146 | install -m755 -oroot -groot qmake/qmake ${qtprefix}/bin
|
---|
147 |
|
---|
148 | if [ "Y" = "${MULTIARCH}" ]; then
|
---|
149 | use_wrapper ${qtprefix}/bin/{qmake,uic,moc,qtconfig}
|
---|
150 |
|
---|
151 | # There is one header file (qconfig.h) which will be different
|
---|
152 | # between 32 and 64 bit ( stores things such as size of long long
|
---|
153 | # for the given architecture ). Here we move it to a subdir and
|
---|
154 | # create a stub header
|
---|
155 | create_stub_hdrs ${qtheaderdir}/qconfig.h
|
---|
156 | fi
|
---|