Magellan Linux

Contents of /trunk/extras/qt4/qt4-4.8.7-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 27309 - (show annotations) (download)
Mon Dec 14 13:43:38 2015 UTC (8 years, 5 months ago) by niro
File size: 21172 byte(s)
-c++11 abi toolchain rebuild
1 # $Id$
2
3 PNAME="qt4"
4 PVER="4.8.7"
5 PBUILD="r3"
6
7 PCAT="x11-libs"
8
9 DESCRIPTION="Qt: Cross-Platform Rich Client Development Framework."
10 HOMEPAGE="http://qt-project.org/"
11
12 # build phonon or not (yes/no), disabled atm
13 QT4_PHONON="no"
14 SPECIAL_VARS="QT4_PHONON"
15
16 # use kde-qt patches or not (yes/no), disabled atm
17 KDE_QT_PATCHES="no"
18 # snapshot id of the patches
19 KDE_QT_SNAPSHOT_ID="8fa76375a2f030ecf8aa23c917f51f04333a1b2c"
20
21 # load qt4 here to overide all depends
22 # include kde4 to get the right KDEDIR for phonon!
23 sminclude mtools qt4 kde4 xdg fdo-mime
24
25 DEPEND_CORE=">= dev-libs/openssl-1.0.2
26 >= app-crypt/ca-certificates-2015
27 >= dev-libs/glib2-2.46
28 >= dev-libs/icu-55.1
29 >= sys-libs/zlib-1.2.8
30 >= sys-libs/libstdc++-5.3"
31
32 DEPEND_GUI="${DEPEND_CORE}
33 >= x11-libs/libICE-1
34 >= x11-libs/libSM-1.1
35 >= x11-libs/libXau-1
36 >= x11-libs/libxcb-1.10
37 >= x11-libs/libXdmcp-1
38 >= x11-libs/libX11-1.6
39 >= x11-libs/libXcursor-1.1
40 >= x11-libs/libXext-1.3
41 >= x11-libs/libXfont-1.4
42 >= x11-libs/libXfixes-5
43 >= x11-libs/libXft-2.2
44 >= x11-libs/libXi-1.7
45 >= x11-libs/libXinerama-1
46 >= x11-libs/libXrandr-1.3
47 >= x11-libs/libXrender-0.9
48 >= media-libs/libjpeg-8
49 >= media-libs/giflib-5.0
50 >= media-libs/libmng-2
51 >= media-libs/libpng-1.5
52 >= media-libs/libtiff-4
53 >= media-libs/freetype-2.6
54 >= media-libs/fontconfig-2.11
55 >= net-print/libcups-2.1
56 >= media-libs/nas-1.9"
57
58 DEPEND_SQL=">= dev-db/sqlite-3.9
59 >= dev-db/mysql-libs-5.5
60 >= dev-db/unixodbc-2.3"
61
62 DEPEND_DBUS=">= sys-apps/dbus-1.10"
63
64 DEPEND_OPENGL=">= virtual/opengl"
65
66 DEPEND_MULTIMEDIA=">= media-libs/alsa-lib-1.1"
67
68 DEPEND_BEARER=">= net-misc/networkmanager-1.0"
69
70 SDEPEND="${DEPEND_CORE}
71 ${DEPEND_GUI}
72 ${DEPEND_SQL}
73 ${DEPEND_DBUS}
74 ${DEPEND_OPENGL}
75 ${DEPEND_MULTIMEDIA}
76 ${DEPEND_BEARER}
77 >= sys-dev/bison-2.5
78 >= x11-proto/xineramaproto-1.1
79 >= x11-proto/xextproto-7
80 >= x11-proto/inputproto-2
81 >= dev-util/pkgconfig-0.25
82 >= dev-libs/expat-2
83 >= media-libs/lcms-1.19"
84
85 if [[ ${QT4_PHONON} = yes ]]
86 then
87 DEPEND_PHONON="${DEPEND_DBUS}
88 >= media-libs/gstreamer1.0-1.0
89 >= media-libs/gstreamer1.0-plugins-base-1.0
90 >= media-libs/gstreamer1.0-plugins-good-1.0"
91
92 SDEPEND+="
93 ${DEPEND_PHONON}"
94 fi
95
96 SRCFILE="${PNAME/4/}-everywhere-opensource-src-${PVER}.tar.gz"
97 SRCDIR="${BUILDDIR}/${PNAME/4/}-everywhere-opensource-src-${PVER}"
98
99 SPLIT_PACKAGES="qt4-core
100 qt4-dbus
101 qt4-script
102 qt4-gui
103 qt4-svg
104 qt4-sql
105 qt4-xmlpatterns
106 qt4-opengl
107 qt4-qt3support
108 qt4-webkit
109 qt4-test
110 qt4-multimedia
111 qt4-help
112 qt4-assistant
113 qt4-declarative
114 qt4-designer
115 qt4-linguist
116 qt4-pixeltool
117 qt4-qdbusviewer
118 qt4-bearer"
119
120 if [[ ${QT4_PHONON} = yes ]]
121 then
122 SPLIT_PACKAGES+="qt4-phonon"
123 fi
124
125 SRC_URI=(
126 http://download.qt-project.org/official_releases/qt/${PVER%.*}/${PVER}/${SRCFILE}
127 mirror://${PNAME}/${SRCFILE}
128 mirror://${PNAME}/qt-4.5.1-no-hardcoded_fonts.patch
129 mirror://${PNAME}/qt-4.8.1-improve-cups-support.patch
130 mirror://${PNAME}/qt-4.8.5-CVE-2013-4549.patch
131 mirror://${PNAME}/qt-4.8.7-moc-boost-workaround.patch
132 )
133
134 # add phonon patches
135 if [[ ${QT4_PHONON} = yes ]]
136 then
137 SRC_URI+=( mirror://${PNAME}/qt-4.5.3-phonon-2.patch )
138 fi
139
140 # use kde-qt?
141 if [[ ${KDE_QT_PATCHES} = yes ]]
142 then
143 SRC_URI+=( mirror://${PNAME}/qt-${PVER}-kde-qt-${KDE_QT_SNAPSHOT_ID}.patch )
144 fi
145
146 UP2DATE="updatecmd ${HOMEPAGE}/downloads | grep 4. | firsttarball gz"
147
148 #
149 ## global vars ##
150 #
151 # install prefix
152 # get this one from qt4.sminc, QTDIR gets overridden later on
153 export QT_PREFIX="${QTDIR}"
154 # source location
155 export QTDIR="${SRCDIR}"
156 export LD_LIBRARY_PATH="${QTDIR}/lib"
157 export PATH="${QTDIR}/bin:${PATH}"
158 export PLATFORM="linux-g++"
159 [[ ${ARCH} = x86_64 ]] && export PLATFORM="linux-g++-64"
160 # etc dir
161 export QT_SYSCONFDIR="/etc/${PNAME}"
162 # envfile
163 export QT_ENVFILE="/etc/env.d/45${PNAME}"
164 #
165 # do not export QMAKE from qt4.sminc
166 unset QMAKE
167 # do not run postinstall/remove from kde4 include
168 unset -f postinstall
169 unset -f postremove
170
171 split_info_qt4-core()
172 {
173 DESCRIPTION="Qt4: Cross-Platform Rich Client Development Framework."
174 DEPEND="${DEPEND_CORE}"
175 }
176
177 split_info_qt4-gui()
178 {
179 DESCRIPTION="The GUI module for the Qt4 toolkit."
180 DEPEND="== x11-libs/qt4-core-${PVER}
181 == x11-libs/qt4-script-${PVER}
182 == x11-libs/qt4-dbus-${PVER}
183 ${DEPEND_GUI}"
184 }
185
186 split_info_qt4-svg()
187 {
188 DESCRIPTION="The SVG module for the Qt4 toolkit."
189 DEPEND="== x11-libs/qt4-core-${PVER}
190 == x11-libs/qt4-gui-${PVER}"
191 }
192
193 split_info_qt4-sql()
194 {
195 DESCRIPTION="The SQL module for the Qt4 toolkit."
196 DEPEND="== x11-libs/qt4-core-${PVER}
197 ${DEPEND_SQL}"
198 }
199
200 split_info_qt4-script()
201 {
202 DESCRIPTION="The ECMAScript module for the Qt4 toolkit."
203 DEPEND="== x11-libs/qt4-core-${PVER}"
204 }
205
206 split_info_qt4-xmlpatterns()
207 {
208 DESCRIPTION="The patternist module for the Qt toolkit."
209 DEPEND="== x11-libs/qt4-core-${PVER}"
210 }
211
212 split_info_qt4-dbus()
213 {
214 DESCRIPTION="The DBus module for the Qt4 toolkit."
215 DEPEND="== x11-libs/qt4-core-${PVER}
216 ${DEPEND_DBUS}"
217 }
218
219 split_info_qt4-opengl()
220 {
221 DESCRIPTION="The OpenGL module for the Qt4 toolkit."
222 DEPEND="== x11-libs/qt4-core-${PVER}
223 == x11-libs/qt4-gui-${PVER}
224 ${DEPEND_OPENGL}"
225 }
226
227 if [[ ${QT4_PHONON} = yes ]]
228 then
229 split_info_qt4-phonon()
230 {
231 DESCRIPTION="The Phonon module for the Qt4 toolkit."
232 DEPEND="== x11-libs/qt4-gui-${PVER}
233 == x11-libs/qt4-dbus-${PVER}
234 ${DEPEND_PHONON}"
235
236 PROVIDE="virtual/phonon"
237 }
238
239 preinstall_qt4-phonon()
240 {
241 if [[ -n $(magequery -n phonon) ]]
242 then
243 die "please uninstall kde-base/phonon first!"
244 fi
245 }
246
247 postinstall_qt4-phonon()
248 {
249 # breaks compilation if the old phonon symlink from kde-phonon exist
250 if [[ -L ${MROOT}/opt/kde4/lib/libphonon.so ]]
251 then
252 rm ${MROOT}/opt/kde4/lib/libphonon.so
253 fi
254 }
255 fi
256
257 split_info_qt4-qt3support()
258 {
259 DESCRIPTION="The Qt3 support module for the Qt toolkit."
260 DEPEND="== x11-libs/qt4-core-${PVER}
261 == x11-libs/qt4-gui-${PVER}
262 == x11-libs/qt4-sql-${PVER}"
263 if [[ ${QT4_PHONON} = yes ]]
264 then
265 DEPEND+="
266 == x11-libs/qt4-phonon-${PVER}"
267 fi
268 }
269
270 split_info_qt4-webkit()
271 {
272 DESCRIPTION="The Webkit module for the Qt4 toolkit."
273 DEPEND="== x11-libs/qt4-core-${PVER}
274 == x11-libs/qt4-dbus-${PVER}
275 == x11-libs/qt4-gui-${PVER}
276 == x11-libs/qt4-xmlpatterns-${PVER}"
277 if [[ ${QT4_PHONON} = yes ]]
278 then
279 DEPEND+="
280 == x11-libs/qt4-phonon-${PVER}"
281 fi
282 }
283
284 split_info_qt4-test()
285 {
286 DESCRIPTION="The testing framework module for the Qt4 toolkit."
287 DEPEND="== x11-libs/qt4-core-${PVER}"
288 }
289
290 split_info_qt4-multimedia()
291 {
292 DESCRIPTION="The Multimedia module for the Qt4 toolkit."
293 DEPEND="== x11-libs/qt4-core-${PVER}
294 == x11-libs/qt4-gui-${PVER}
295 ${DEPEND_MULTIMEDIA}"
296 }
297
298 split_info_qt4-help()
299 {
300 DESCRIPTION="The assistant help module for the Qt4 toolkit."
301 DEPEND="x11-libs/qt4-core-${PVER}
302 == x11-libs/qt4-gui-${PVER}
303 == x11-libs/qt4-sql-${PVER}"
304 }
305
306 split_info_qt4-assistant()
307 {
308 DESCRIPTION="The assistant help module for the Qt4 toolkit."
309 DEPEND="x11-libs/qt4-core-${PVER}
310 == x11-libs/qt4-gui-${PVER}
311 == x11-libs/qt4-help-${PVER}
312 == x11-libs/qt4-sql-${PVER}
313 == x11-libs/qt4-webkit-${PVER}"
314 PCAT="x11-apps"
315 }
316
317 split_info_qt4-declarative()
318 {
319 DESCRIPTION="The Declarative module for the Qt4 toolkit."
320 DEPEND="== x11-libs/qt4-core-${PVER}
321 == x11-libs/qt4-gui-${PVER}
322 == x11-libs/qt4-multimedia-${PVER}
323 == x11-libs/qt4-opengl-${PVER}
324 == x11-libs/qt4-script-${PVER}
325 == x11-libs/qt4-sql-${PVER}
326 == x11-libs/qt4-svg-${PVER}
327 == x11-libs/qt4-webkit-${PVER}
328 == x11-libs/qt4-qt3support-${PVER}
329 == x11-libs/qt4-xmlpatterns-${PVER}"
330 }
331
332 split_info_qt4-designer()
333 {
334 DESCRIPTION="WYSIWYG tool for designing and building Qt-based GUIs."
335 DEPEND="== x11-libs/qt4-core-${PVER}
336 == x11-libs/qt4-gui-${PVER}
337 == x11-libs/qt4-script-${PVER}
338 == x11-libs/qt4-declarative-${PVER}
339 == x11-libs/qt4-qt3support-${PVER}
340 == x11-libs/qt4-webkit-${PVER}"
341 if [[ ${QT4_PHONON} = yes ]]
342 then
343 DEPEND+="
344 == x11-libs/qt4-phonon-${PVER}"
345 fi
346 PCAT="x11-apps"
347 }
348
349 split_info_qt4-linguist()
350 {
351 DESCRIPTION="Graphical tool for translating Qt applications."
352 DEPEND="== x11-libs/qt4-core-${PVER}
353 == x11-libs/qt4-gui-${PVER}
354 == x11-apps/qt4-designer-${PVER}"
355 PCAT="x11-apps"
356 }
357
358 split_info_qt4-pixeltool()
359 {
360 DESCRIPTION="Qt screen magnifier."
361 DEPEND="== x11-libs/qt4-core-${PVER}
362 == x11-libs/qt4-gui-${PVER}"
363 PCAT="x11-apps"
364 }
365
366 split_info_qt4-qdbusviewer()
367 {
368 DESCRIPTION="Graphical tool that lets you introspect D-Bus objects and messages."
369 DEPEND="== x11-libs/qt4-core-${PVER}
370 == x11-libs/qt4-gui-${PVER}
371 == x11-libs/qt4-dbus-${PVER}"
372 PCAT="x11-apps"
373 }
374
375 split_info_qt4-bearer()
376 {
377 DESCRIPTION="The network bearer plugins for the Qt toolkit."
378 DEPEND="== x11-libs/qt4-core-${PVER}
379 == x11-libs/qt4-dbus-${PVER}
380 ${DEPEND_BEARER}"
381 }
382
383 install_qt_target()
384 {
385 local targets
386 local i
387
388 targets="$@"
389
390 for i in ${targets}
391 do
392 mmake -C ${i} INSTALL_ROOT=${BINDIR} install || die "install of target '${i}' failed"
393 done
394 }
395
396 src_prepare()
397 {
398 munpack ${SRCFILE} || die
399 cd ${SRCDIR}
400
401 # security fix
402 mpatch qt-4.8.5-CVE-2013-4549.patch || die
403
404 # no hardcoded font-aliases
405 # see: https://cvs.fedoraproject.org/viewvc/rpms/qt4/F-8/qt-x11-opensource-src-4.3.4-no-hardcoded-font-aliases.patch?view=markup
406 mpatch qt-4.5.1-no-hardcoded_fonts.patch || die
407
408 # improve cups support
409 mpatch qt-4.8.1-improve-cups-support.patch || die
410
411 # fix BOOST_JOIN erros with moc (ex kdepim)
412 # see: https://bugreports.qt.io/browse/QTBUG-22829
413 mpatch qt-4.8.7-moc-boost-workaround.patch || die
414
415 if [[ ${QT4_PHONON} = yes ]]
416 then
417 # install service files needed by kde
418 mpatch qt-4.5.3-phonon-2.patch || die
419 # fix variable kdelocation from the patch
420 sed -i "s:@@KDEDIR@@:${KDEDIR}:g" ${SRCDIR}/src/plugins/phonon/gstreamer/gstreamer.pro || die
421 fi
422
423 if [[ ${KDE_QT_PATCHES} = yes ]]
424 then
425 # kdeqt patches from http://gitorious.org/+kde-developers/qt/kde-qt
426 mpatch qt-${PVER}-kde-qt-${KDE_QT_SNAPSHOT_ID}.patch || die
427 fi
428
429 # set our cflags and fix up our header and lib locations
430 cd ${SRCDIR}/mkspecs/${PLATFORM}
431 sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
432 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
433 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
434 -e 's:$(QTDIR)/include:&/qt${PVER%%.*}:' \
435 -e "s:\$(QTDIR)/lib:\$(QTDIR)/$(mlibdir):" \
436 qmake.conf \
437 || die
438
439 # fix libdir to lib64 on 64bit arches
440 sed -i "s:/lib$:/$(mlibdir):" qmake.conf || die
441
442 # disable rpath
443 sed -i "s:QMAKE_RPATH.*=.*:QMAKE_RPATH=:" qmake.conf || die
444
445 # get rid of /usr/X11R6
446 sed -i "s:X11R6/::" qmake.conf || die
447
448 # same goes for the g++ definitions
449 # they where moved to an extra file with qt4
450 cd ${SRCDIR}/mkspecs/common
451 sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CPPFLAGS} ${CFLAGS} ${ASFLAGS}:" \
452 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CPPFLAGS} ${CXXFLAGS} ${ASFLAGS}:" \
453 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
454 -e 's:$(QTDIR)/include:&/qt${PVER%%.*}:' \
455 -e "s:\$(QTDIR)/lib:\$(QTDIR)/$(mlibdir):" \
456 g++.conf \
457 || die
458
459 # fix libdir to lib64 on 64bit arches
460 sed -i "s:/lib$:/$(mlibdir):" g++.conf || die
461
462 # disable rpath
463 sed -i "s:QMAKE_RPATH.*=.*:QMAKE_RPATH=:" g++.conf || die
464
465 # get rid of /usr/X11R6
466 sed -i "s:X11R6/::" linux.conf || die
467 }
468
469 src_compile()
470 {
471 cd ${SRCDIR}
472 local myconf
473
474 # add missing lib64 search path on 64bit arches
475 [[ $(mlibdir) != lib ]] && myconf="-L/usr/$(mlibdir)"
476
477 # enable this only for binutils >=2.18
478 [[ $(ld -v | sed 's/.*\ \([0-9].[0-9].*\)/\1/') > 2.17 ]] && myconf+=" -reduce-relocations"
479
480 # enable static if requested
481 mqueryfeature "static" && myconf+=" -static"
482 # always build shared libs
483 myconf+=" -shared"
484
485 # disable openvg atm
486 myconf+=" -no-openvg"
487
488 if [[ ${QT4_PHONON} = yes ]]
489 then
490 myconf+=" -phonon"
491 myconf+=" -phonon-backend"
492 else
493 myconf+=" -no-phonon"
494 myconf+=" -no-phonon-backend"
495 fi
496
497 ./configure \
498 -prefix ${QT_PREFIX} \
499 -sysconfdir ${QT_SYSCONFDIR} \
500 -datadir ${QT_PREFIX}/share/qt${PVER%%.*} \
501 -docdir ${QT_PREFIX}/share/doc/qt${PVER%%.*}-${PVER} \
502 -headerdir ${QT_PREFIX}/include/qt${PVER%%.*} \
503 -plugindir ${QT_PREFIX}/$(mlibdir)/qt${PVER%%.*}/plugins \
504 -importdir ${QT_PREFIX}/$(mlibdir)/qt${PVER%%.*}/imports \
505 -libdir ${QT_PREFIX}/$(mlibdir) \
506 -datadir ${QT_PREFIX}/share/qt${PVER%%.*} \
507 -translationdir ${QT_PREFIX}/share/qt${PVER%%.*}/translations \
508 -confirm-license \
509 -opensource \
510 -platform ${PLATFORM} \
511 -xplatform ${PLATFORM} \
512 -verbose \
513 -silent \
514 -fast \
515 -release \
516 -no-separate-debug-info \
517 -optimized-qmake \
518 -system-libjpeg \
519 -system-libmng \
520 -system-libpng \
521 -system-libtiff \
522 -system-zlib \
523 -system-nas-sound \
524 -system-sqlite \
525 -nomake examples \
526 -nomake demos \
527 -nomake docs \
528 -no-rpath \
529 -no-pch \
530 -qt3support \
531 -stl \
532 -lpthread \
533 -largefile \
534 -sm \
535 -xrender \
536 -opengl \
537 -cups \
538 -dbus-linked \
539 -openssl \
540 -webkit \
541 -svg \
542 -icu \
543 -xmlpatterns \
544 -declarative \
545 -plugin-sql-sqlite \
546 -plugin-sql-mysql \
547 -plugin-sql-odbc \
548 -I/usr/include/mysql \
549 -L/usr/$(mlibdir)/mysql \
550 -graphicssystem raster \
551 ${myconf} \
552 || die
553
554 mmake all || die
555 }
556
557 src_install_qt4-core()
558 {
559 cd ${SRCDIR}
560
561 install_qt_target \
562 src/tools/bootstrap \
563 src/tools/moc \
564 src/tools/rcc \
565 src/tools/uic \
566 src/corelib \
567 src/xml \
568 src/network \
569 src/plugins/codecs \
570 tools/linguist/lrelease \
571 tools/linguist/lupdate \
572 tools/linguist/lconvert
573
574 # install missing qmake
575 mmake INSTALL_ROOT=${BINDIR} install_qmake || die
576 mlink qmake ${QT_PREFIX}/bin/qmake${PVER%%.*} || die
577
578 # install missing findtr
579 minstallexec ${SRCDIR}/bin/findtr ${QT_PREFIX}/bin || die
580
581 # install all spec files
582 mmake INSTALL_ROOT=${BINDIR} install_mkspecs || die
583
584 # remove unneeded specs
585 echo "removing unneeded specs ..."
586 install -d ${BUILDDIR}/keep
587 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/default ${BUILDDIR}/keep || die
588 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/common ${BUILDDIR}/keep || die
589 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/features ${BUILDDIR}/keep || die
590 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/qws ${BUILDDIR}/keep || die
591 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/${PLATFORM} ${BUILDDIR}/keep || die
592 if [[ ${ARCH} = x86_64 ]]
593 then
594 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/linux-g++ ${BUILDDIR}/keep || die
595 fi
596 mv ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/qconfig.pri ${BUILDDIR}/keep || die
597 rm -rf ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs/* || die
598 mv ${BUILDDIR}/keep/* ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/mkspecs || die
599
600 # fix qmake cache file
601 minstalldir ${QT_PREFIX}/share/qt${PVER%%.*} || die
602 sed "s:${SRCDIR}:${QT_PREFIX}:g" ${SRCDIR}/.qmake.cache > ${BINDIR}/${QT_PREFIX}/share/qt${PVER%%.*}/.qmake.cache || die
603
604 # # some needed symlinks
605 # mlink libqt-mt.so ${QT_PREFIX}/$(mlibdir)/libqt.so || die
606
607 # generate translations and install them
608 # use freshly built libraries
609 LD_LIBRARY_PATH=${SRCDIR}/lib ${SRCDIR}/bin/lrelease translations/*.ts || die
610 minstalldir ${QT_PREFIX}/share/qt${PVER%%.*}/translations || die
611 minstallfile translations/\*.qm ${QT_PREFIX}/share/qt${PVER%%.*}/translations || die
612
613 # keep the qt4 sysdir
614 mkeepdir ${QT_SYSCONFDIR} || die
615
616 # environ vars
617 minstalldir /etc/env.d || die
618 MCONFIG=${QT_ENVFILE}
619 mclearconfig || die
620 maddconfig "QMAKESPEC=\"${PLATFORM}\"" || die
621 maddconfig "QTDIR=\"${QT_PREFIX}\"" || die
622
623 if [[ ${QT_PREFIX} != /usr ]]
624 then
625 # overwrite the env file here, there may be one in usr
626 # and we want this as system-wide default
627 mclearconfig || die
628 maddconfig "PATH=\"${QT_PREFIX}/bin\"" || die
629 maddconfig "ROOTPATH=\"${QT_PREFIX}/bin\"" || die
630 maddconfig "LDPATH=\"${QT_PREFIX}/$(mlibdir)\"" || die
631 maddconfig "MANPATH=\"${QT_PREFIX}/share/man\"" || die
632 maddconfig "PKG_CONFIG_PATH=\"${QT_PREFIX}/$(mlibdir)/pkgconfig\"" || die
633 fi
634
635 minstalldocs GPL* changes-${PVER} LICENSE* OPENSOURCE* README* || die
636 }
637
638 src_install_qt4-gui()
639 {
640 cd ${SRCDIR}
641
642 install_qt_target \
643 src/gui \
644 src/scripttools \
645 src/plugins/imageformats/gif \
646 src/plugins/imageformats/ico \
647 src/plugins/imageformats/jpeg \
648 src/plugins/imageformats/mng \
649 src/plugins/imageformats/tiff \
650 src/plugins/imageformats/tga \
651 src/plugins/inputmethods \
652 src/plugins/accessible/widgets \
653 src/plugins/graphicssystems/trace \
654 tools/qttracereplay \
655 tools/qtconfig
656
657 # desktop icon
658 minstallpixmap tools/qtconfig/images/appicon.png qtconfig.png || die
659 minstall_desktop_icon \
660 --name "QT4 Config" \
661 --file "qt4-qtconfig" \
662 --comment "Configure Qt4 behavior, styles, fonts" \
663 --exec qtconfig \
664 --icon qtconfig \
665 --categories "Qt,Settings,DesktopSettings" \
666 || die
667 }
668
669 src_install_qt4-svg()
670 {
671 cd ${SRCDIR}
672
673 install_qt_target \
674 src/svg \
675 src/plugins/imageformats/svg \
676 src/plugins/iconengines/svgiconengine
677 }
678
679 src_install_qt4-sql()
680 {
681 cd ${SRCDIR}
682
683 install_qt_target src/sql src/plugins/sqldrivers
684 }
685
686 src_install_qt4-script()
687 {
688 cd ${SRCDIR}
689
690 install_qt_target src/script
691 }
692
693 src_install_qt4-xmlpatterns()
694 {
695 cd ${SRCDIR}
696
697 install_qt_target \
698 src/xmlpatterns \
699 tools/xmlpatterns \
700 tools/xmlpatternsvalidator
701 }
702
703 src_install_qt4-dbus()
704 {
705 cd ${SRCDIR}
706
707 install_qt_target \
708 src/dbus \
709 tools/qdbus/qdbus \
710 tools/qdbus/qdbusxml2cpp \
711 tools/qdbus/qdbuscpp2xml
712 }
713
714 src_install_qt4-opengl()
715 {
716 cd ${SRCDIR}
717
718 install_qt_target src/opengl src/plugins/graphicssystems/opengl
719 }
720
721 if [[ ${QT4_PHONON} = yes ]]
722 then
723 src_install_qt4-phonon()
724 {
725 cd ${SRCDIR}
726
727 install_qt_target \
728 src/phonon \
729 src/plugins/phonon
730
731 # needed symlink; kde-4.4 includes from Phonon/*
732 if [[ ! -e ${BINDIR}/${QT_PREFIX}/include/qt/Phonon ]]
733 then
734 mlink phonon ${QT_PREFIX}/include/qt/Phonon || die
735 fi
736 }
737 fi
738
739 src_install_qt4-qt3support()
740 {
741 cd ${SRCDIR}
742
743 install_qt_target \
744 src/qt3support \
745 src/tools/uic3 \
746 tools/porting
747 }
748
749 src_install_qt4-webkit()
750 {
751 cd ${SRCDIR}
752
753 install_qt_target \
754 src/3rdparty/webkit/Source/JavaScriptCore \
755 src/3rdparty/webkit/Source/WebCore \
756 src/3rdparty/webkit/Source/WebKit/qt
757 }
758
759 src_install_qt4-test()
760 {
761 cd ${SRCDIR}
762
763 install_qt_target src/testlib
764 }
765
766 src_install_qt4-multimedia()
767 {
768 cd ${SRCDIR}
769
770 install_qt_target src/multimedia
771 }
772
773 src_install_qt4-help()
774 {
775 cd ${SRCDIR}
776
777 install_qt_target \
778 tools/assistant/lib/fulltextsearch \
779 tools/assistant/lib \
780 tools/assistant/tools/qhelpgenerator \
781 tools/assistant/tools/qcollectiongenerator \
782 tools/assistant/tools/qhelpconverter \
783 tools/qdoc3
784 }
785
786 src_install_qt4-assistant()
787 {
788 cd ${SRCDIR}
789
790 install_qt_target tools/assistant/tools/assistant
791
792 # desktop icon
793 minstallpixmap tools/assistant/tools/assistant/images/assistant.png || die
794 minstall_desktop_icon \
795 --name "QT4 Assistant" \
796 --file "qt4-assistant" \
797 --comment "Shows Qt4 documentation and examples" \
798 --exec assistant \
799 --icon assistant \
800 --categories "Qt,Development,Documentation" \
801 || die
802 }
803
804 src_install_qt4-declarative()
805 {
806 cd ${SRCDIR}
807
808 install_qt_target \
809 src/declarative \
810 src/imports \
811 src/plugins/qmltooling \
812 tools/qml \
813 tools/qmlplugindump \
814 src/3rdparty/webkit/Source/WebKit/qt/declarative
815 }
816
817 src_install_qt4-designer()
818 {
819 cd ${SRCDIR}
820
821 install_qt_target tools/designer
822
823 # desktop icon
824 minstallpixmap tools/designer/src/designer/images/designer.png || die
825 minstall_desktop_icon \
826 --name "QT4 Designer" \
827 --file "qt4-designer" \
828 --comment "Design GUIs for Qt4 applications" \
829 --exec designer \
830 --icon designer \
831 --categories "Qt,Development,GUIDesigner" \
832 || die
833 }
834
835 src_install_qt4-linguist()
836 {
837 cd ${SRCDIR}
838
839 install_qt_target tools/linguist/linguist
840
841 # desktop icon
842 minstallpixmap tools/linguist/linguist/images/icons/linguist-128-32.png linguist.png || die
843 minstall_desktop_icon \
844 --name "QT4 Linguist" \
845 --file "qt4-linguist" \
846 --comment "Add translations to Qt4 applications" \
847 --exec linguist \
848 --icon linguist \
849 --categories "Qt,Development,Translation" \
850 || die
851 }
852
853 src_install_qt4-pixeltool()
854 {
855 cd ${SRCDIR}
856
857 install_qt_target tools/pixeltool
858 }
859
860 src_install_qt4-qdbusviewer()
861 {
862 cd ${SRCDIR}
863
864 install_qt_target tools/qdbus/qdbusviewer
865
866 # desktop icon
867 minstallpixmap tools/qdbus/qdbusviewer/images/qdbusviewer-128.png qdbusviewer.png || die
868 minstall_desktop_icon \
869 --name "QT4 QDbusViewer" \
870 --file "qt4-qdbusviewer" \
871 --comment "Debug D-Bus applications" \
872 --exec qdbusviewer \
873 --icon qdbusviewer \
874 --categories "Qt,Development,Debugger" \
875 || die
876 }
877
878 src_install_qt4-bearer()
879 {
880 cd ${SRCDIR}
881
882 install_qt_target \
883 src/plugins/bearer/generic \
884 src/plugins/bearer/networkmanager
885 }
886
887 postinstall_qt4-gui()
888 {
889 xdg_update_icon_resource
890 fdo-mime_update_desktop_db
891 }
892
893 postinstall_qt4-designer()
894 {
895 xdg_update_icon_resource
896 fdo-mime_update_desktop_db
897 }
898
899 postinstall_qt4-linguist()
900 {
901 xdg_update_icon_resource
902 fdo-mime_update_desktop_db
903 }
904
905 postinstall_qt4-pixeltool()
906 {
907 xdg_update_icon_resource
908 fdo-mime_update_desktop_db
909 }
910
911 postremove_qt4-gui()
912 {
913 xdg_update_icon_resource
914 fdo-mime_update_desktop_db
915 }
916
917 postremove_qt4-designer()
918 {
919 xdg_update_icon_resource
920 fdo-mime_update_desktop_db
921 }
922
923 postremove_qt4-linguist()
924 {
925 xdg_update_icon_resource
926 fdo-mime_update_desktop_db
927 }
928
929 postremove_qt4-pixeltool()
930 {
931 xdg_update_icon_resource
932 fdo-mime_update_desktop_db
933 }