Sat, 18 Jul 2009 14:08:34 +0200
Adjust buildconf until Nokia corrects flawed GNU iconv integration.
The problem corrected by this adjustment involves font glyphs appearing
as normal font sized empty squares. All text is illegible.
1 ##
2 ## qt.spec -- OpenPKG RPM Specification
3 ## Copyright (c) 2009 Michael Schloh von Bennewitz <michael@schloh.com>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # FIXME: MSvB: It appears that bugs in current versions of binutils
25 # FIXME: MSvB: fail to properly link Qt object code, resulting in
26 # FIXME: MSvB: 'ld: libQt*.so: pthread_mutex...: invalid version 6
27 # FIXME: MSvB: libQt*.so: could not read symbols: Bad value'
28 # FIXME: MSvB: The effects of these bugs are platform dependent.
29 # FIXME: MSvB: Solaris 11 IA-32 builds fail while Linux 2.6.25.18
30 # FIXME: MSvB: AMD64 builds succeed.
31 # FIXME: MSvB:
32 # FIXME: MSvB: GNU iconv integration is flawed in Qt 4.5.2, and
33 # FIXME: MSvB: has been disabled in this build until a new release
34 # FIXME: MSvB: corrects the problem.
36 # package information
37 Name: qt
38 Summary: Cross-platform Application Framework
39 URL: http://www.trolltech.com/products/qt/
40 Vendor: Nokia Corporation
41 Packager: Michael Schloh von Bennewitz
42 Distribution: MSvB Recherche Production
43 Class: EVAL
44 Group: Development
45 License: GPL
46 Version: 4.5.2
47 Release: 20090718
49 # build options
50 %option with_tools yes
51 %option with_mysql no
52 %option with_pgsql no
53 %option with_shared no
54 %option with_examples no
56 # list of sources
57 Source0: ftp://ftp.trolltech.com/qt/source/qt-x11-opensource-src-%{version}.tar.gz
59 # build information
60 Prefix: %{l_prefix}
61 BuildRoot: %{l_buildroot}
62 BuildPreReq: OpenPKG, openpkg >= 20050726, make, gcc, pkgconfig
63 PreReq: OpenPKG, openpkg >= 20050726
64 BuildPreReq: X11, png, mng, jpeg, tiff, mesa, xrender
65 PreReq: X11, png, mng, jpeg, tiff, mesa, xrender
66 BuildPreReq: openssl, zlib, libiconv, sqlite, dbus
67 PreReq: openssl, zlib, libiconv, sqlite, dbus
68 BuildPreReq: fontconfig, freetype
69 PreReq: fontconfig, freetype
70 %if "%{with_mysql}" == "yes"
71 BuildPreReq: mysql
72 PreReq: mysql
73 %endif
74 %if "%{with_pgsql}" == "yes"
75 BuildPreReq: postgresql
76 PreReq: postgresql
77 %endif
78 AutoReq: no
79 AutoReqProv: no
80 Provides: QTSDK
82 %description
83 Qt is a comprehensive C++ framework for cross-platform application
84 development. Using Qt, you can develop applications and user
85 interfaces once, and deploy them across many desktop and embedded
86 operating systems without rewriting the source code. This package
87 distribution builds all modules of the Qt/X11 Open Source Edition.
89 %track
90 prog qt = {
91 version = %{version}
92 url = ftp://ftp.trolltech.com/qt/source/
93 regex = qt-x11-opensource-src-(__VER__)\.tar\.gz
94 }
96 %prep
97 # announce exceptional build requirements
98 ( echo "This package has exceptional storage requirements:"
99 echo " qt-%{version}-root (2,5 Go)"
100 echo " qt-x11-opensource-src-%{version} (4,5 Go)"
101 echo " qt-%{version}-<date>.<arch>-<os>-<tag>.rpm (1 Go)"
102 echo "Building with no options takes 0,5 hours on a dual core"
103 echo "2 GHz CPU, or 2 hours with all build options enabled."
104 ) | %{l_rpmtool} msg -b -t notice
106 %setup -q -n qt-x11-opensource-src-%{version}
107 x11_incdir=`%{l_rc} --query x11_incdir`
108 x11_libdir=`%{l_rc} --query x11_libdir`
109 fontconflibs=`%{l_prefix}/bin/pkg-config --libs-only-l --static fontconfig`
110 openssllibs=`%{l_prefix}/bin/pkg-config --libs --static openssl`
112 loclibs=''
113 case "%{l_platform -t}" in
114 *-sunos* )
115 loclibs='-lsocket -lnsl'
116 ;;
117 esac
118 ( cd mkspecs/qws
119 for plat in freebsd-generic-g++ macx-generic-g++ solaris-generic-g++;
120 do
121 ln -s $plat `echo $plat | %{l_shtool} subst -e 's;\(.*\)-generic-\(.*\);\1-x86-\2;'`
122 done
123 ) || exit $?
124 %{l_shtool} subst \
125 -e 's;\(-z[\t ][\t ]*\)\([^\t \"][^\t \"]*\);\1"\2";g' \
126 configure
127 %{l_shtool} subst \
128 -e "s;\(QMAKE_LIBS_X11.*\)-lfreetype -lfontconfig;\1$fontconflibs;" \
129 configure
130 %{l_shtool} subst \
131 -e "s;\(OPENSSL_LIBS *=\) *-lssl -lcrypto;\1 $openssllibs;" \
132 configure
133 %{l_shtool} subst \
134 -e 's;-silent|;-rpath|-silent|;' \
135 -e 's;\(RPATH_FLAGS="\)\\"\$QT_INSTALL_LIBS\\" \($RPATH_FLAGS"\);\1\2;' \
136 -e "s;\(echo.*QMAKE_RPATHDIR +=\).*\$QT_INSTALL_LIBS\\\\\"\\\";\1 $x11_libdir\";" \
137 configure
138 %{l_shtool} subst \
139 -e 's;\(TRY_INCLUDEPATHS = \).*\(\$\$INCLUDEPATH\);\1\2;' \
140 -e 's;/freetype2;/freetype;' \
141 config.tests/unix/freetype/freetype.pri
142 %{l_shtool} subst \
143 -e "s;^\(LIBS += \)-lfreetype -lfontconfig;\1$fontconflibs;" \
144 config.tests/x11/fontconfig/fontconfig.pro
145 %{l_shtool} subst \
146 -e "s;\(LIBS += -lpq\);\1 `%{l_prefix}/bin/pg_config --libs` $loclibs;" \
147 config.tests/unix/psql/psql.pro
148 %{l_shtool} subst \
149 -e 's;^mac:\(LIBS\);\1;' \
150 config.tests/unix/iconv/iconv.pro
151 %{l_shtool} subst \
152 -e 's;LIBS .*= -lpq$;LIBS += -lpq -lssl -lcrypto;' \
153 src/sql/drivers/drivers.pri
154 %{l_shtool} subst \
155 -e "s;QMAKE_CXXFLAGS += \$\$QT_CFLAGS_GLIB;INCPATH += `pkg-config --cflags-only-I glib-2.0 gthread-2.0 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
156 src/corelib/kernel/kernel.pri \
157 src/gui/kernel/kernel.pri
158 %{l_shtool} subst \
159 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_PSQL;INCPATH += `pg_config --includedir 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
160 -e "s;QMAKE_CXXFLAGS \*= \$\$QT_CFLAGS_MYSQL;INCPATH += `mysql_config --include 2>/dev/null | %{l_shtool} subst -e 's;-I;;g'`;g" \
161 -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" \
162 src/plugins/sqldrivers/mysql/mysql.pro \
163 src/plugins/sqldrivers/psql/psql.pro \
164 src/plugins/sqldrivers/sqlite/sqlite.pro \
165 src/sql/drivers/drivers.pri
166 %{l_shtool} subst \
167 -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" \
168 src/dbus/dbus.pro
169 %{l_shtool} subst \
170 -e 's;^\(QMAKE_INCDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/include;' \
171 -e 's;^\(QMAKE_LIBDIR[^a-zA-Z0-9=]*=\).*;\1 %{l_prefix}/lib;' \
172 -e "s;^\(QMAKE_INCDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/include \2;" \
173 -e "s;^\(QMAKE_LIBDIR_OPENGL[^=]*=\) *\(.*\);\1 %{l_prefix}/lib \2;" \
174 -e 's;^\(QMAKE_LFLAGS_RELEASE.*\);\1 -s;' \
175 mkspecs/qws/*/qmake.conf \
176 mkspecs/*/*.conf
177 %{l_shtool} subst \
178 -e 's;^\(QMAKE_LIBS +=.*\);\1 -liconv;' \
179 src/corelib/corelib.pro
180 %{l_shtool} subst \
181 -e "s;^\(QMAKE_INCDIR_X11[^=]*=\).*;\1 %{l_prefix}/include $x11_incdir;" \
182 -e "s;^\(QMAKE_LIBDIR_X11[^=]*=\).*;\1 %{l_prefix}/lib $x11_libdir;" \
183 mkspecs/qws/solaris*/qmake.conf \
184 mkspecs/solaris*/qmake.conf
185 %{l_shtool} subst \
186 -e 's; *\.\./3rdparty/freetype/.*;;g' \
187 -e 's;^\( *contains(QT_CONFIG, freetype) {\);\1 LIBS += -lfreetype;' \
188 src/gui/text/text.pri
189 %{l_shtool} subst \
190 -e 's;\(#include *"\)\(tiffio.h"\);\1tiff/\2;' \
191 src/plugins/imageformats/tiff/qtiffhandler.cpp
192 %{l_shtool} subst \
193 -e 's;\(CONFIG[\t ]*+=[\t ]*qt\);\1 x11;' \
194 tools/qtconfig/qtconfig.pro
195 # for projfile in `find examples/ -name '*.pro' -print`; do
196 # echo 'CONFIG += release' >>$projfile
197 # done
199 %build
200 # protect against sloppy code inclusion of all unused subprojects
201 rm -rf src/3rdparty/[^cdhmsw]* src/3rdparty/sql* src/3rdparty/win*
203 # detect which platform for which to build
204 case "%{l_platform -t}" in
205 sun4[uv]-sunos* | amd64-sunos* ) platcomp="solaris-g++-64" ;;
206 i?86-sunos* ) platcomp="solaris-g++" ;;
207 amd64-linux* ) platcomp="linux-g++-64" ;;
208 i?86-linux* ) platcomp="linux-g++" ;;
209 amd64-freebsd* | i?86-freebsd* ) platcomp="freebsd-g++" ;;
210 *-aix* ) platcomp="aix-g++" ;;
211 *-darwin* ) platcomp="macx-g++" ;;
212 *-hpux* ) platcomp="hpux-g++" ;;
213 *-irix* ) platcomp="irix-g++" ;;
214 * ) echo "Platform '%{l_platform -t}' is not supported." 2>&1; exit 1 ;;
215 esac
217 # detect which architecture extensions are available
218 archflags=''
219 case "%{l_platform -t}" in
220 amd64-* )
221 break
222 ;;
223 * )
224 archflags='-no-sse2 -no-3dnow'
225 ;;
226 esac
228 %if "%{with_shared}" == "yes"
229 # optional shared build (precedes mandatory static build)
230 echo 'yes' | ./configure \
231 $archflags \
232 -opensource \
233 -prefix %{l_prefix} \
234 -bindir %{l_prefix}/bin \
235 -libdir %{l_prefix}/lib/qt \
236 -docdir %{l_prefix}/share/qt/doc \
237 -headerdir %{l_prefix}/include \
238 -plugindir %{l_prefix}/lib/qt/plugins \
239 -datadir %{l_prefix}/share/qt \
240 -translationdir %{l_prefix}/share/qt/translations \
241 -sysconfdir %{l_prefix}/etc/qt \
242 -examplesdir %{l_prefix}/share/qt/examples \
243 -demosdir %{l_prefix}/share/qt/demos \
244 -release \
245 -shared \
246 -platform $platcomp \
247 -no-sql-ibase \
248 %if "%{with_mysql}" == "yes"
249 -qt-sql-mysql \
250 -plugin-sql-mysql \
251 %else
252 -no-sql-mysql \
253 %endif
254 %if "%{with_pgsql}" == "yes"
255 -qt-sql-psql \
256 -plugin-sql-psql \
257 %else
258 -no-sql-psql \
259 %endif
260 -no-sql-odbc \
261 -system-sqlite \
262 -qt-sql-sqlite \
263 -plugin-sql-sqlite \
264 -no-sql-sqlite2 \
265 -openssl-linked \
266 -xmlpatterns \
267 -svg \
268 -system-zlib \
269 -qt-gif \
270 -system-libpng \
271 -system-libmng \
272 -system-libjpeg \
273 -system-libtiff \
274 -rpath \
275 -no-cups \
276 -no-iconv \
277 -pch \
278 -dbus-linked \
279 -opengl \
280 -xrender \
281 -fontconfig \
282 -freetype \
283 -no-glib
285 # default options are implicitly used, for example...
286 #-no-fast -exceptions -accessibility -stl -qt3support -nis
287 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
289 # carry out shared build procedure
290 ( cd src
291 %{l_make} %{l_mflags -O} \
292 sub-moc sub-rcc sub-uic
293 %{l_make} %{l_mflags -O} \
294 sub-corelib sub-xml sub-network sub-gui sub-sql \
295 sub-script sub-testlib sub-qt3support sub-dbus \
296 sub-opengl sub-xmlpatterns sub-svg sub-plugins
297 ) || exit $?
299 # arthur plugin requires libQtDesigner
300 ( cd demos
301 ( cd ../tools/designer/src/lib
302 %{l_make} %{l_mflags -O} staticlib
303 ) || exit $?
304 %{l_make} %{l_mflags -O} sub-arthurplugin
305 ( cd ../tools/designer/src/lib
306 %{l_make} %{l_mflags -O} distclean
307 ) || exit $?
308 ) || exit $?
310 # cache shared libs and initialize the build configuration, which
311 # would otherwise still contain references to our shared libs build
312 %{l_shtool} mkdir -f -p -m 755 dynamic
313 mv lib/* dynamic/
314 ( cd qmake
315 %{l_make} %{l_mflags} distclean
316 ) || exit $?
317 rm -f .qmake.cache
318 %endif
320 # mandatory static build (follows optional shared build)
321 echo 'yes' | ./configure \
322 $archflags \
323 -opensource \
324 -prefix %{l_prefix} \
325 -bindir %{l_prefix}/bin \
326 -libdir %{l_prefix}/lib \
327 -docdir %{l_prefix}/share/qt/doc \
328 -headerdir %{l_prefix}/include \
329 -plugindir %{l_prefix}/lib/qt/plugins \
330 -datadir %{l_prefix}/share/qt \
331 -translationdir %{l_prefix}/share/qt/translations \
332 -sysconfdir %{l_prefix}/etc/qt \
333 -examplesdir %{l_prefix}/share/qt/examples \
334 -demosdir %{l_prefix}/share/qt/demos \
335 -release \
336 -static \
337 -platform $platcomp \
338 -no-sql-ibase \
339 %if "%{with_mysql}" == "yes"
340 -qt-sql-mysql \
341 %else
342 -no-sql-mysql \
343 %endif
344 %if "%{with_pgsql}" == "yes"
345 -qt-sql-psql \
346 %else
347 -no-sql-psql \
348 %endif
349 -no-sql-odbc \
350 -system-sqlite \
351 -qt-sql-sqlite \
352 -no-sql-sqlite2 \
353 -openssl-linked \
354 -xmlpatterns \
355 -svg \
356 -system-zlib \
357 -qt-gif \
358 -system-libpng \
359 -system-libmng \
360 -system-libjpeg \
361 -system-libtiff \
362 -rpath \
363 -no-cups \
364 -no-iconv \
365 -pch \
366 -dbus-linked \
367 -opengl \
368 -xrender \
369 -fontconfig \
370 -freetype \
371 -no-glib
373 # default options are implicitly used, for example...
374 #-no-fast -exceptions -accessibility -stl -qt3support -nis
375 #-sm -xshape -xinerama -xcursor -xfixes -xrandr -tablet -xkb
377 # carry out static build procedure
378 %{l_make} %{l_mflags -O} sub-src
379 %if "%{with_tools}" == "yes"
380 %{l_make} %{l_mflags -O} sub-tools
381 %endif
382 %if "%{with_examples}" == "yes"
383 %{l_make} %{l_mflags -O} \
384 sub-demos-make_default-ordered \
385 sub-examples-make_default-ordered
386 %endif
388 %install
389 rm -rf $RPM_BUILD_ROOT
391 # carry out installation procedure
392 targets="sub-moc-install_subtargets-ordered \
393 sub-rcc-install_subtargets-ordered \
394 sub-uic-install_subtargets-ordered \
395 sub-corelib-install_subtargets-ordered \
396 sub-xml-install_subtargets-ordered \
397 sub-network-install_subtargets-ordered \
398 sub-gui-install_subtargets-ordered \
399 sub-sql-install_subtargets-ordered \
400 sub-script-install_subtargets-ordered \
401 sub-testlib-install_subtargets-ordered \
402 sub-qt3support-install_subtargets-ordered \
403 sub-dbus-install_subtargets-ordered \
404 sub-uic3-install_subtargets-ordered \
405 sub-opengl-install_subtargets-ordered \
406 sub-xmlpatterns-install_subtargets-ordered \
407 sub-svg-install_subtargets-ordered \
408 sub-plugins-install_subtargets-ordered"
409 %if "%{with_tools}" == "yes"
410 targets="$targets sub-tools-install_subtargets-ordered"
411 %endif
412 %if "%{with_examples}" == "yes"
413 targets="$targets sub-demos-install_subtargets-ordered sub-examples-install_subtargets-ordered"
414 %endif
415 targets="$targets install_htmldocs install_qchdocs install_docimages install_translations install_qmake install_mkspecs"
416 %{l_make} %{l_mflags} $targets INSTALL_ROOT="$RPM_BUILD_ROOT"
418 %if "%{with_shared}" == "yes"
419 # install shared libs and symlinks
420 %{l_shtool} mkdir -f -p -m 755 \
421 $RPM_BUILD_ROOT%{l_prefix}/lib/qt
422 %{l_tar} cf - dynamic | %{l_tar} xf - -C $RPM_BUILD_ROOT%{l_prefix}/lib/qt
424 # offer limited support of pkg-config(1) for shared libs
425 # substitution unfortunately only handles paths with no whitespace
426 %{l_shtool} subst \
427 -e "s;[^\t ][^\t ]*qt-x11-opensource-src-%{version};%{l_prefix};g" \
428 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/pkgconfig/*
430 # explain nonstandard shared library placement
431 ( echo "This OpenPKG Qt build is using the with_shared option."
432 echo ""
433 echo "This directory contains optional shared libraries as"
434 echo "defined by the OpenPKG build specification. Although"
435 echo "shared libraries have been optionally built (see the"
436 echo "build time 'with_shared yes' option), static libraries"
437 echo "were built by default as usual, and installed in the"
438 echo "standard library directory %{l_prefix}/lib."
439 echo ""
440 echo "To build applications using shared libraries instead,"
441 echo "please direct pkg-config(1) to use the properdefinitions"
442 echo "by setting the environment variable PKG_CONFIG_PATH to "
443 echo "%{l_prefix}/lib/qt/dynamic/pkgconfig."
444 ) >$RPM_BUILD_ROOT%{l_prefix}/lib/qt/README
446 # remove temporary dynamic link paths
447 %{l_shtool} subst \
448 -e "s;-L\([\t ]*\)[^\t ][^\t ]*qt-x11-opensource-src-%{version}\(/[^\t ][^\t ]*\);-L\1%{l_prefix}\2;g" \
449 -e "s;\([\t ][\t ]*\)[^\t ][^\t ]*\(qt-x11-opensource-src-%{version}.*\);\1/tmp/\2;" \
450 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.prl \
451 $RPM_BUILD_ROOT%{l_prefix}/lib/qt/dynamic/*.la
452 %endif
454 # determine internal file listing
455 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
456 %{l_files_std} \
457 '%doc %{l_prefix}/share/qt/doc/*/*' \
458 '%not %dir %{l_prefix}/lib/pkgconfig'
460 %files -f files
462 %clean
463 rm -rf $RPM_BUILD_ROOT