Fri, 16 Jan 2009 10:58:21 +0100
Correct and improve code logic, buildconf, and packaging. In particular:
1. Use descriptive variable names <var>libs instead of just <var>.
2. Although Nokia states in all Qt builds that 'NOTE: When linking
against OpenSSL, you can override the default library names
through OPENSSL_LIBS.' and even gives an example, their own
configuration logic rejects such an attempt. Correct this by
hard coding the OpenSSL library string in the configure script.
3. Consistently use the whitespace substitution [\t ] throughout.
4. Patch the buggy INCPATH of SQL plugin Qmake project files.
5. Add the 'x11' configuration variable to the qtconfig Qmake
project using the src/gui/gui.pro file as a model. This is
needed for qtconfig although not in other tools, because
the qtconfig buildconf indirectly includes qt_x11_p.h which
is dependent on X11 headers.
6. Avoid 'ld.so: fatal: hardware capability unsupported: SSE2 AMD_3DNow'
on platforms for which the config.tests/unix/[3dnow|sse2] succeed
although unsopported at run time by testing for the x86-64
instruction set at build time and regulating hardware capabilities.
7. Correctly install the desinger plugin by explicitly building it.
8. Remove custom plugin installation logic which is unnecessary.
9. Correct removal of temporary paths from shared object files.
qt/qt.spec | file | annotate | diff | comparison | revisions |
1.1 --- a/qt/qt.spec Thu Jan 15 21:41:03 2009 +0100 1.2 +++ b/qt/qt.spec Fri Jan 16 10:58:21 2009 +0100 1.3 @@ -105,7 +105,9 @@ 1.4 %setup -q -n qt-x11-opensource-src-%{version} 1.5 x11_incdir=`%{l_rc} --query x11_incdir` 1.6 x11_libdir=`%{l_rc} --query x11_libdir` 1.7 - fontconf=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig` 1.8 + fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig` 1.9 + openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl` 1.10 + 1.11 loclibs='' 1.12 case "%{l_platform -t}" in 1.13 *-sunos* ) 1.14 @@ -119,10 +121,13 @@ 1.15 done 1.16 ) || exit $? 1.17 %{l_shtool} subst \ 1.18 - -e 's;\(-z[ \t][ \t]*\)\([^ \t\"][^ \t\"]*\);\1"\2";g' \ 1.19 + -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \ 1.20 configure 1.21 %{l_shtool} subst \ 1.22 - -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconf;" \ 1.23 + -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconflibs;" \ 1.24 + configure 1.25 + %{l_shtool} subst \ 1.26 + -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \ 1.27 configure 1.28 %{l_shtool} subst \ 1.29 -e 's;-silent|;-rpath|-silent|;' \ 1.30 @@ -134,7 +139,7 @@ 1.31 -e 's;/freetype2;/freetype;' \ 1.32 config.tests/unix/freetype/freetype.pri 1.33 %{l_shtool} subst \ 1.34 - -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconf;" \ 1.35 + -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \ 1.36 config.tests/x11/fontconfig/fontconfig.pro 1.37 %{l_shtool} subst \ 1.38 -e "s;\(LIBS += -lpq\);\1 -lssl -lcrypto $loclibs;" \ 1.39 @@ -153,6 +158,9 @@ 1.40 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ 1.41 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ 1.42 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_SQLITE;INCPATH += `pkg-config --cflags-only-I sqlite3 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ 1.43 + src/plugins/sqldrivers/mysql/mysql.pro \ 1.44 + src/plugins/sqldrivers/psql/psql.pro \ 1.45 + src/plugins/sqldrivers/sqlite/sqlite.pro \ 1.46 src/sql/drivers/drivers.pri 1.47 %{l_shtool} subst \ 1.48 -e "s;QMAKE_CXXFLAGS += \$\$QT_CFLAGS_DBUS;INCPATH += `pkg-config --cflags-only-I dbus-1 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \ 1.49 @@ -180,6 +188,9 @@ 1.50 %{l_shtool} subst \ 1.51 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \ 1.52 src/plugins/imageformats/tiff/qtiffhandler.cpp 1.53 + %{l_shtool} subst \ 1.54 + -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \ 1.55 + tools/qtconfig/qtconfig.pro 1.56 # for projfile in `find examples/ -name '*.pro' -print`; do 1.57 # echo 'CONFIG += release' >>$projfile 1.58 # done 1.59 @@ -188,6 +199,7 @@ 1.60 # protect against sloppy code inclusion of all unused subprojects 1.61 rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win* 1.62 1.63 + # detect which platform for which to build 1.64 case "%{l_platform -t}" in 1.65 sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;; 1.66 i?86-sunos* ) platcomp="solaris-g++" ;; 1.67 @@ -201,9 +213,21 @@ 1.68 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;; 1.69 esac 1.70 1.71 + # detect which architecture extensions are available 1.72 + archflags='' 1.73 + case "%{l_platform -t}" in 1.74 + amd64-* ) 1.75 + break 1.76 + ;; 1.77 + * ) 1.78 + archflags='-no-sse2 -no-3dnow' 1.79 + ;; 1.80 + esac 1.81 + 1.82 %if "%{with_shared}" == "yes" 1.83 # optional shared build (precedes mandatory static build) 1.84 echo 'yes' | ./configure \ 1.85 + $archflags \ 1.86 -prefix %{l_prefix} \ 1.87 -bindir %{l_prefix}/bin \ 1.88 -libdir %{l_prefix}/lib/qt \ 1.89 @@ -270,6 +294,9 @@ 1.90 sub-script sub-testlib sub-qt3support sub-dbus \ 1.91 sub-opengl sub-xmlpatterns sub-svg sub-plugins 1.92 ) || exit $? 1.93 + ( cd demos 1.94 + %{l_make} %{l_mflags -O} sub-arthurplugin 1.95 + ) || exit $? 1.96 1.97 # cache shared libs and initialize the build configuration, which 1.98 # would otherwise still contain references to our shared libs build 1.99 @@ -283,6 +310,7 @@ 1.100 1.101 # mandatory static build (follows optional shared build) 1.102 echo 'yes' | ./configure \ 1.103 + $archflags \ 1.104 -prefix %{l_prefix} \ 1.105 -bindir %{l_prefix}/bin \ 1.106 -libdir %{l_prefix}/lib \ 1.107 @@ -387,7 +415,7 @@ 1.108 # offer limited support of pkg-config(1) for shared libs 1.109 # substitution unfortunately only handles paths with no whitespace 1.110 %{l_shtool} subst \ 1.111 - -e "s;[\ \t][\ \t]*qt-x11-opensource-src-%{version};%{l_prefix};g" \ 1.112 + -e "s;[^\t ][^\t ]*qt-x11-opensource-src-%{version};%{l_prefix};g" \ 1.113 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/* 1.114 1.115 # explain nonstandard shared library placement 1.116 @@ -406,20 +434,12 @@ 1.117 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig." 1.118 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README 1.119 1.120 - # install plugins, which are otherwise only useless static objects 1.121 - for plug in accessible codecs designer iconengines \ 1.122 - imageformats inputmethods script sqldrivers; do \ 1.123 - %{l_shtool} mkdir -f -p -m 755 \ 1.124 - $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/${plug}; \ 1.125 - %{l_shtool} install -c -m 644 \ 1.126 - plugins/${plug}/*.so plugins/${plug}/*.so.debug \ 1.127 - $RPM_BUILD_ROOT%{l_prefix}/lib/qt/plugins/${plug}/; \ 1.128 - done 1.129 - 1.130 # remove temporary dynamic link paths 1.131 %{l_shtool} subst \ 1.132 - -e 's;\(QMAKE_PRL_BUILD_DIR[^=]*=\).*\(qt-x11-opensource-src.*\);\1 /tmp/\2;' \ 1.133 - $RPM_BUILD_ROOT%{l_prefix}/lib/*.prl 1.134 + -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-x11-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \ 1.135 + -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-x11-opensource-src-%{version}.*\);\1/tmp/\2;" \ 1.136 + $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \ 1.137 + $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la 1.138 %endif 1.139 1.140 # determine internal file listing