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