diff -r 495dc52debb0 -r f4a0b439d0fb qt/qt.spec --- a/qt/qt.spec Fri Oct 15 18:58:09 2010 +0200 +++ b/qt/qt.spec Fri Oct 15 19:06:09 2010 +0200 @@ -31,6 +31,10 @@ # FIXME: MSvB: # FIXME: MSvB: -no-webkit added to broken static buildconf # FIXME: MSvB: as work around for 'ld: cannot find -ljscore' +# FIXME: MSvB: +# FIXME: MSvB: Test all of -R %{l_prefix}/lib/qt/dynamic, +# FIXME: MSvB: -no-rpath, -rpath, and removing $xll_libdir from +# FIXME: MSvB: shtool subst. Anschliessend mkspecs/qconfig.pri. # package information Name: qt @@ -43,7 +47,7 @@ Group: Development License: GPL Version: 4.7.0 -Release: 20101010 +Release: 20101012 # build options %option with_tools yes @@ -88,7 +92,7 @@ %track prog qt = { version = %{version} - url = ftp://ftp.trolltech.com/qt/source/ + url = ftp://ftp.qt.nokia.com/qt/source/ regex = qt-everywhere-opensource-src-(__VER__)\.tar\.gz } @@ -96,10 +100,10 @@ # announce exceptional build requirements ( echo "This package has exceptional build requirements:" echo " qt-%{version}-root (2,5 Go)" - echo " qt-everywhere-opensource-src-%{version} (4,5 Go)" - echo " qt-%{version}-.--.rpm (1 Go)" - echo "Building with no options takes 0,5 hours on a dual core" - echo "2 GHz CPU, or 2 hours with all build options enabled." + echo " qt-everywhere-opensource-src-%{version} (5,5 Go)" + echo " qt-%{version}-.--.rpm (2 Go)" + echo "Building with no options takes 2,0 hours on a dual core" + echo "2 GHz CPU, or 6 hours with all build options enabled." ) | %{l_rpmtool} msg -b -t notice %setup -q -n qt-everywhere-opensource-src-%{version} @@ -125,17 +129,15 @@ -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \ configure %{l_shtool} subst \ + -e 's;\(RPATH_FLAGS\)=.*\$QT_INSTALL_LIBS.*\(\$RPATH_FLAGS\)";\1="%{l_prefix}/lib/qt/dynamic \2";' \ + configure + %{l_shtool} subst \ -e 's; *QMakeVar set QMAKE_CFLAGS_X11.*QT_CFLAGS_FONTCONFIG.*;;' \ -e 's; *QMakeVar set QMAKE_LIBS_X11.*QT_LIBS_FONTCONFIG.*;;' \ configure %{l_shtool} subst \ -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \ configure - %{l_shtool} subst \ - -e 's;-silent|;-rpath|-silent|;' \ - -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \ - -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \ - configure # yes this is needed several times to catch nested occurences of '--cflags' %{l_shtool} subst \ -e 's;\(QT_CFLAGS_[^=][^=]*=.*PKG_CONFIG.*\) --cflags ;\1 --cflags-only-other ;g' \ @@ -190,7 +192,7 @@ src/dbus/dbus.pro %{l_shtool} subst \ -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \ - -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \ + -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1;' \ -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \ -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \ -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \ @@ -204,6 +206,8 @@ -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \ mkspecs/qws/solaris*/qmake.conf \ mkspecs/solaris*/qmake.conf + echo "QMAKE_LIBDIR += %{l_prefix}/lib/qt/dynamic" \ + >>mkspecs/features/shared.prf %{l_shtool} subst \ -e 's; *\.\./3rdparty/freetype/.*;;g' \ -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \ @@ -214,9 +218,16 @@ %{l_shtool} subst \ -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ tools/qtconfig/qtconfig.pro -# for projfile in `find examples/ -name '*.pro' -print`; do -# echo 'CONFIG += release' >>$projfile -# done + #%{l_shtool} subst \ + # -e "s;\(\\title\) All Classes;\1 Qt's Classes;" \ + # doc/src/classes.qdoc + %{l_shtool} subst \ + -e "s;Qt's Classes;All Classes;" \ + tools/assistant/tools/assistant/doc/assistant.qdoc \ + tools/qdoc3/doc/qdoc-manual.qdoc \ + tools/qdoc3/doc/files/qt.qdocconf \ + tools/qdoc3/test/qt-build-docs.qdocconf \ + tools/qdoc3/test/qt.qdocconf %build # protect against sloppy code inclusion of all unused subprojects @@ -254,7 +265,7 @@ -opensource \ -prefix %{l_prefix} \ -bindir %{l_prefix}/bin \ - -libdir %{l_prefix}/lib/qt \ + -libdir %{l_prefix}/lib/qt/dynamic \ -docdir %{l_prefix}/share/qt/doc \ -headerdir %{l_prefix}/include \ -plugindir %{l_prefix}/lib/qt/plugins \ @@ -340,18 +351,16 @@ # arthur plugin requires libQtDesigner ( cd demos ( cd ../tools/designer/src/lib - %{l_make} %{l_mflags -O} staticlib + %{l_make} %{l_mflags -O} ) || exit $? %{l_make} %{l_mflags -O} sub-arthurplugin - ( cd ../tools/designer/src/lib - %{l_make} %{l_mflags -O} distclean - ) || exit $? ) || exit $? # cache shared libs and initialize the build configuration, which # would otherwise still contain references to our shared libs build - %{l_shtool} mkdir -f -p -m 755 dynamic - mv lib/* dynamic/ + %{l_shtool} mkdir -f -p -m 755 sharbuild/dynamic + mv lib/* sharbuild/dynamic/ + mv plugins sharbuild/ %{l_make} %{l_mflags} confclean %endif @@ -456,7 +465,6 @@ sub-script-install_subtargets-ordered \ sub-declarative-install_subtargets-ordered \ sub-scripttools-install_subtargets-ordered \ - sub-plugins-install_subtargets-ordered \ sub-imports-install_subtargets-ordered \ sub-translations-install_subtargets-ordered" @@ -469,11 +477,18 @@ targets="$targets install_qmake install_mkspecs" %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT" + # only install static or shared plugins according to user choice +%if "%{with_shared}" != "yes" + %{l_make} %{l_mflags} sub-plugins-install_subtargets-ordered INSTALL_ROOT="$RPM_BUILD_ROOT" +%else + %{l_tar} cf - sharbuild/plugins | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt +%endif + %if "%{with_shared}" == "yes" # install shared libs and symlinks %{l_shtool} mkdir -f -p -m 755 \ $RPM_BUILD_ROOT%{l_prefix}/lib/qt - %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt + %{l_tar} cf - sharbuild/dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt # offer limited support of pkg-config(1) for shared libs # substitution unfortunately only handles paths with no whitespace @@ -484,23 +499,36 @@ # explain nonstandard shared library placement ( echo "This OpenPKG Qt build is using the with_shared option." echo "" - echo "This directory contains optional shared libraries as" - echo "defined by the OpenPKG build specification. Although" - echo "shared libraries have been optionally built (see the" - echo "build time 'with_shared yes' option), static libraries" - echo "were built by default as usual, and installed in the" + echo "The directory %{l_prefix}/lib/qt/dynamic contains the" + echo "requested shared libraries. Although shared libraries" + echo "have been optionally built (see the build time" + echo "'with_shared yes' option), static libraries were" + echo "built by default as usual, and installed in the" echo "standard library directory %{l_prefix}/lib." echo "" echo "To build applications using shared libraries instead," echo "please direct pkg-config(1) to use the proper definitions" echo "by setting the environment variable PKG_CONFIG_PATH to " echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." + echo "" + echo "Note: If building via qmake(1), please append" + echo " either 'static' or 'shared' to the line" + echo " 'CONFIG +=' in the project file (name.pro)." + echo " Then execute %{l_prefix}/bin/qmake on this file." ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README +%endif - # remove temporary dynamic link paths + # correct temporary runtime link paths (static libs) %{l_shtool} subst \ + -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ - -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-everywhere-opensource-src-%{version}.*\);\1/tmp/\2;" \ + $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl \ + $RPM_BUILD_ROOT%{l_prefix}/lib/*.la +%if "%{with_shared}" == "yes" + # correct temporary runtime link paths (dynamic libs) + %{l_shtool} subst \ + -e "s;\(QMAKE_PRL_BUILD_DIR[\t ][\t ]*=\).*;\1 /.../qt-everywhere-opensource-src-%{version};" \ + -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-everywhere-opensource-src-%{version}/lib;-L\1%{l_prefix}/lib/qt/dynamic;g" \ $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la %endif