2 # Copyright (C) 2008-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 # - test/add xcb support
10 # - handle plugins in a granular way (find out which packages should provide which plugins)
12 include $(TOPDIR)/rules.mk
17 PKG_MD5SUM:=3a2f25b9b115037277f4fb759194a7a5
19 PKG_SOURCE:=qt-everywhere-opensource-src-$(PKG_VERSION).tar.gz
20 PKG_SOURCE_URL:=ftp://ftp.qt.nokia.com/qt/source
21 PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-opensource-src-$(PKG_VERSION)
24 PKG_CONFIG_DEPENDS:= \
27 CONFIG_PACKAGE_directfb \
28 CONFIG_PACKAGE_qt4-demos \
29 CONFIG_PACKAGE_qt4-examples \
30 CONFIG_PACKAGE_qt4-svg \
31 CONFIG_PACKAGE_qt4-qt3support \
32 CONFIG_PACKAGE_qt4-dbus \
33 CONFIG_PACKAGE_qt4-phonon \
34 CONFIG_PACKAGE_qt4-sqlite \
35 CONFIG_PACKAGE_qt4-mysql \
36 CONFIG_PACKAGE_qt4-webkit \
37 CONFIG_PACKAGE_qt4-script \
38 CONFIG_PACKAGE_qt4-scriptools \
39 CONFIG_PACKAGE_qt4-openssl
41 include $(INCLUDE_DIR)/package.mk
42 include $(INCLUDE_DIR)/nls.mk
43 -include $(if $(DUMP),,./files/qmake.mk)
45 # this should be moved to a more generic place later, as other packages are configured different as well depending on available nptl support
46 ifeq ($(CONFIG_USE_GLIBC),y)
49 ifeq ($(CONFIG_USE_EGLIBC),y)
52 ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
56 define Package/qt4/config
57 source "$(SOURCE)/Config.in"
60 define Package/qt4/Default
61 SECTION:=xorg-framework
66 DEFAULT:=m if PACKAGE_qt4-gui && ALL
67 URL:=http://qt.nokia.com/
71 $(call Package/qt4/Default)
72 DEPENDS:=+zlib +libstdcpp @!LINUX_2_4
75 define Package/qt4-gui
76 $(call Package/qt4/Default)
78 DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network \
79 +FEATURE_drawing-backend_libX11:libX11 \
80 +FEATURE_drawing-backend_libX11:libXext @DISPLAY_SUPPORT
84 define Package/qt4-demos
85 $(call Package/qt4/Default)
90 define Package/qt4-examples
91 $(call Package/qt4/Default)
93 DEPENDS+=+qt4-gui +qt4-svg
96 define Package/qt4-network
97 $(call Package/qt4/Default)
101 define Package/qt4-sqlite
102 $(call Package/qt4/Default)
107 define Package/qt4-mysql
108 $(call Package/qt4/Default)
110 DEPENDS+=+libmysqlclient
113 define Package/qt4-openssl
114 $(call Package/qt4/Default)
119 #define Package/qt4-multimedia
120 # $(call Package/qt4/Default)
121 # TITLE+=(multimedia)
124 #define Package/qt4-audio-backend
125 # $(call Package/qt4/Default)
126 # TITLE+=(audio-backend)
129 define Package/qt4-phonon
130 $(call Package/qt4/Default)
132 DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
135 #define Package/qt4-phonon-backend
136 # $(call Package/qt4/Default)
137 # TITLE+=(phonon-backend)
140 define Package/qt4-svg
141 $(call Package/qt4/Default)
143 DEPENDS+=+qt4-gui +qt4-network
146 define Package/qt4-webkit
147 $(call Package/qt4/Default)
149 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 +libsqlite3 +qt4-phonon +qt4-dbus +qt4-xml +qt4-gui +qt4-network # versions of uclibc prior 0.9.32 do not have nptl support
152 define Package/qt4-script
153 $(call Package/qt4/Default)
155 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
158 define Package/qt4-scripttools
159 $(call Package/qt4/Default)
161 DEPENDS+=+qt4-script +qt4-gui +qt4-network
164 #define Package/qt4-accessibility
165 # $(call Package/qt4/Default)
166 # TITLE+=(accessibility)
169 #define Package/qt4-javascript-jit
170 # $(call Package/qt4/Default)
171 # TITLE+=(javascript-jit)
174 #define Package/qt4-cups
175 # $(call Package/qt4/Default)
179 define Package/qt4-dbus
180 $(call Package/qt4/Default)
182 DEPENDS+=+libdbus +qt4-xml
185 #define Package/qt4-gtkstyle
186 # $(call Package/qt4/Default)
190 #define Package/qt4-glib
191 # $(call Package/qt4/Default)
195 define Package/qt4-qt3support
196 $(call Package/qt4/Default)
198 DEPENDS+=+qt4-gui +qt4-xml
201 define Package/qt4-declarative
202 $(call Package/qt4/Default)
204 DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
207 define Package/qt4-xml
208 $(call Package/qt4/Default)
213 define Package/qt4-drivers-mouse/Default
214 $(call Package/qt4/Default)
219 define Package/qt4-drivers-mouse-tpmousedriver
220 $(call Package/qt4-drivers-mouse/Default)
224 define Package/qt4-drivers-mouse-pcmousedriver
225 $(call Package/qt4-drivers-mouse/Default)
229 define Package/qt4-drivers-mouse-tslibmousedriver
230 $(call Package/qt4-drivers-mouse/Default)
231 TITLE+=tslibmousedriver
236 define Package/qt4-drivers-gfx/Default
237 $(call Package/qt4/Default)
242 define Package/qt4-drivers-gfx-directfb
243 $(call Package/qt4-drivers-gfx/Default)
245 DEPENDS+=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb
248 define Package/qt4-drivers-gfx-linuxfb
249 $(call Package/qt4-drivers-gfx/Default)
253 define Package/qt4-drivers-gfx-vnc
254 $(call Package/qt4-drivers-gfx/Default)
259 define Package/qt4-drivers-kbd/Default
260 $(call Package/qt4/Default)
266 TARGET_INCDIRS+=$(STAGING_DIR)/include $(STAGING_DIR)/usr/include $(TOOLCHAIN_DIR)/include $(TOOLCHAIN_DIR)/usr/include
267 TARGET_LIBDIRS+=$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib $(TOOLCHAIN_DIR)/lib $(TOOLCHAIN_DIR)/usr/lib
268 TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib,-rpath-link=$(PKG_BUILD_DIR)/lib
269 TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include
271 ifeq ($(CONFIG_QT4_WS_QWS),y)
274 ifeq ($(CONFIG_QT4_WS_X11),y)
277 ifeq ($(CONFIG_PACKAGE_qt4-gui),)
278 # If GUI is disabled, we use the X11 prefix. That's good enough, for now.
279 # The X11 files also work for non-GUI.
283 define Build/Configure
285 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
286 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
287 # do not use fontconfig as it doesn't work anyway for qte
288 # bindir: bindir is where the host tools (qmake, moc, rcc, uic) will get installed into - they are just used on the host and not goig to be packaged
289 mkdir -p $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++
290 $(CP) ./files/$(FILEPFX)qmake.conf $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++/qmake.conf
291 $(CP) ./files/$(FILEPFX)qplatformdefs.h $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++/qplatformdefs.h
292 ( cd $(PKG_BUILD_DIR) ; \
293 TARGET_CC="$(TARGET_CROSS)gcc" \
294 TARGET_CXX="$(TARGET_CROSS)g++" \
295 TARGET_AR="$(TARGET_CROSS)ar cqs" \
296 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
297 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
298 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
299 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
300 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
301 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
302 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
303 STAGING_DIR="$(STAGING_DIR)" \
304 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
307 -prefix $(CONFIGURE_PREFIX) \
308 -bindir $(CONFIGURE_PREFIX)/bin \
309 -libdir $(CONFIGURE_PREFIX)/lib \
310 -datadir $(CONFIGURE_PREFIX)/share/Qt \
311 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
312 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
313 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
314 -sysconfdir /etc/Qt \
318 $(if $(CONFIG_PACKAGE_qt4-demos),-make,-nomake) demos \
319 $(if $(CONFIG_PACKAGE_qt4-examples),-make,-nomake) examples \
321 -nomake translations \
322 -xplatform $(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++ \
323 -platform linux-g++ \
324 $(if $(CONFIG_QT4_WS_X11),-x11,-embedded) \
338 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite) \
339 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql) \
340 -no-decoration-styled \
341 -no-decoration-windows \
342 -no-decoration-default \
346 $(if $(CONFIG_PACKAGE_qt4-phonon),-phonon,-no-phonon) \
348 $(if $(CONFIG_PACKAGE_qt4-svg),-svg,-no-svg) \
349 $(if $(CONFIG_PACKAGE_qt4-webkit),-webkit,-no-webkit) \
351 $(if $(CONFIG_PACKAGE_qt4-script),-script,-no-script) \
352 $(if $(CONFIG_PACKAGE_qt4-scripttools),-scripttools,-no-scripttools) \
354 $(if $(CONFIG_PACKAGE_qt4-declarative),-declarative,-no-declarative) \
355 $(if $(CONFIG_PACKAGE_qt4-openssl),-openssl -I $(STAGING_DIR)/usr/include,-no-openssl) \
359 $(if $(CONFIG_PACKAGE_qt4-dbus),-dbus,-no-dbus) \
366 $(if $(CONFIG_QT4_WS_X11),-no-xsync,-xsync) \
368 $(if $(CONFIG_QT4_WS_X11),-no-xcursor,-xcursor) \
373 $(if $(CONFIG_QT4_WS_X11),-no-fontconfig,-fontconfig) \
374 $(if $(CONFIG_QT4_WS_X11),-no-xinput,-xinput) \
375 $(if $(CONFIG_QT4_WS_X11),-no-xkb,-xkb) \
377 $(if $(CONFIG_PACKAGE_qt4-qt3support),-qt3support,-no-qt3support) \
378 -no-gfx-transformed \
380 $(if $(CONFIG_PACKAGE_qt4-drivers-gfx-vnc),-plugin-gfx-vnc,-no-gfx-vnc) \
381 -no-gfx-multiscreen \
383 $(if $(CONFIG_PACKAGE_directfb),-plugin-gfx-directfb) \
384 -plugin-gfx-linuxfb \
387 -qt-mouse-linuxinput \
388 -plugin-mouse-linuxtp \
390 -plugin-mouse-tslib \
399 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
400 # unfortunately in this particular case, <make> makes further <qmake> calls, therewith
401 # uses the qmake.conf which needs get the cross-compiling vars passed once again
402 TARGET_CC="$(TARGET_CROSS)gcc" \
403 TARGET_CXX="$(TARGET_CROSS)g++" \
404 TARGET_AR="$(TARGET_CROSS)ar cqs" \
405 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
406 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
407 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
408 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
409 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
410 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
411 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
412 STAGING_DIR="$(STAGING_DIR)" \
413 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
414 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
415 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
416 $(MAKE) -C $(PKG_BUILD_DIR) install
419 define Build/InstallDev
421 $(STAGING_DIR_HOST)/bin
423 # host tools (qmake, moc, rcc, uic)
425 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
426 $(STAGING_DIR_HOST)/bin/
430 $(1)/usr/share/mkspecs \
431 $(1)/usr/lib/pkgconfig \
434 $(1)/usr/lib/Qt/plugins
441 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
442 $(1)/usr/share/mkspecs/
445 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
446 $(1)/usr/lib/pkgconfig/
449 $(PKG_INSTALL_DIR)/usr/include/* \
453 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
457 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
458 # $(1)/usr/lib/Qt/plugins/
461 define Package/qt4/install
464 $(1)/usr/lib/Qt/plugins
467 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
471 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
472 # $(1)/usr/lib/Qt/plugins/codecs/
475 define Package/qt4-gui/install
478 $(1)/usr/lib/Qt/plugins
481 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
484 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
486 /usr/share/fonts/ttf-dejavu \
489 # we use the dejavue font package instead
491 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
492 # $(1)/usr/lib/fonts/
495 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
496 # $(1)/usr/lib/Qt/plugins/
499 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
500 # $(1)/usr/lib/Qt/plugins/
503 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
504 # $(1)/usr/lib/Qt/plugins/
507 define Package/qt4-demos/install
512 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
523 define Package/qt4-examples/install
528 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
539 define Package/qt4-network/install
544 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
548 define Package/qt4-sqlite/install
550 $(1)/usr/lib/Qt/plugins/sqldrivers
553 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
557 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
558 $(1)/usr/lib/Qt/plugins/sqldrivers/
561 define Package/qt4-mysql/install
563 $(1)/usr/lib/Qt/plugins/sqldrivers
566 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
570 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
571 $(1)/usr/lib/Qt/plugins/sqldrivers/
574 #define Package/qt4-multimedia/install
579 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
583 define Package/qt4-phonon/install
588 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
592 define Package/qt4-svg/install
595 $(1)/usr/lib/Qt/plugins
598 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
602 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
603 # $(1)/usr/lib/Qt/plugins/
606 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
607 # $(1)/usr/lib/Qt/plugins/
610 define Package/qt4-webkit/install
613 $(1)/usr/lib/Qt/plugins
616 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
620 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
621 # $(1)/usr/lib/Qt/plugins/
624 define Package/qt4-script/install
627 $(1)/usr/lib/Qt/plugins
630 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
634 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
635 # $(1)/usr/lib/Qt/plugins/
638 define Package/qt4-scripttools/install
643 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
647 define Package/qt4-dbus/install
652 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
656 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
660 define Package/qt4-qt3-support/install
663 $(1)/usr/lib/Qt/plugins
666 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
670 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
671 # $(1)/usr/lib/Qt/plugins/
674 define Package/qt4-declarative/install
679 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
683 define Package/qt4-xml/install
688 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
694 define Package/qt4-drivers-mouse-tpmousedriver/install
696 $(1)/usr/lib/Qt/plugins/mousedrivers
699 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqlinuxtpmousedriver.so \
700 $(1)/usr/lib/Qt/plugins/mousedrivers/
703 define Package/qt4-drivers-mouse-pcmousedriver/install
705 $(1)/usr/lib/Qt/plugins/mousedrivers
708 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqpcmousedriver.so \
709 $(1)/usr/lib/Qt/plugins/mousedrivers/
712 define Package/qt4-drivers-mouse-tslibmousedriver/install
714 $(1)/usr/lib/Qt/plugins/mousedrivers
717 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqtslibmousedriver.so \
718 $(1)/usr/lib/Qt/plugins/mousedrivers/
722 define Package/qt4-drivers-gfx-directfb/install
724 $(1)/usr/lib/Qt/plugins/gfxdrivers
727 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqdirectfbscreen.so \
728 $(1)/usr/lib/Qt/plugins/gfxdrivers/
731 define Package/qt4-drivers-gfx-linuxfb/install
733 $(1)/usr/lib/Qt/plugins/gfxdrivers
736 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqscreenlinuxfb.so \
737 $(1)/usr/lib/Qt/plugins/gfxdrivers/
740 define Package/qt4-drivers-gfx-vnc/install
742 $(1)/usr/lib/Qt/plugins/gfxdrivers
745 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqgfxvnc.so \
746 $(1)/usr/lib/Qt/plugins/gfxdrivers/
753 $(eval $(call BuildPackage,qt4))
754 $(eval $(call BuildPackage,qt4-gui))
755 $(eval $(call BuildPackage,qt4-demos))
756 $(eval $(call BuildPackage,qt4-examples))
757 $(eval $(call BuildPackage,qt4-network))
758 $(eval $(call BuildPackage,qt4-sqlite))
759 $(eval $(call BuildPackage,qt4-mysql))
760 $(eval $(call BuildPackage,qt4-openssl))
761 #$(eval $(call BuildPackage,qt4-multimedia))
762 #$(eval $(call BuildPackage,qt4-audio-backend))
763 $(eval $(call BuildPackage,qt4-phonon))
764 #$(eval $(call BuildPackage,qt4-phonon-backend))
765 $(eval $(call BuildPackage,qt4-svg))
766 $(eval $(call BuildPackage,qt4-webkit))
767 $(eval $(call BuildPackage,qt4-script))
768 $(eval $(call BuildPackage,qt4-scripttools))
769 #$(eval $(call BuildPackage,qt4-accessibility))
770 #$(eval $(call BuildPackage,qt4-javascript-jit))
771 #$(eval $(call BuildPackage,qt4-cups))
772 $(eval $(call BuildPackage,qt4-dbus))
773 #$(eval $(call BuildPackage,qt4-gtkstyle))
774 #$(eval $(call BuildPackage,qt4-glib))
775 $(eval $(call BuildPackage,qt4-qt3support))
776 $(eval $(call BuildPackage,qt4-declarative))
777 $(eval $(call BuildPackage,qt4-xml))
779 $(eval $(call BuildPackage,qt4-drivers-mouse-tpmousedriver))
780 $(eval $(call BuildPackage,qt4-drivers-mouse-pcmousedriver))
781 $(eval $(call BuildPackage,qt4-drivers-mouse-tslibmousedriver))
783 $(eval $(call BuildPackage,qt4-drivers-gfx-directfb))
784 $(eval $(call BuildPackage,qt4-drivers-gfx-linuxfb))
785 $(eval $(call BuildPackage,qt4-drivers-gfx-vnc))