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)" \
306 STAGING_DIR="$(STAGING_DIR)" \
307 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
310 -prefix $(CONFIGURE_PREFIX) \
311 -bindir $(CONFIGURE_PREFIX)/bin \
312 -libdir $(CONFIGURE_PREFIX)/lib \
313 -datadir $(CONFIGURE_PREFIX)/share/Qt \
314 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
315 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
316 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
317 -sysconfdir /etc/Qt \
322 $(if $(CONFIG_PACKAGE_qt4-demos),-make,-nomake) demos \
323 $(if $(CONFIG_PACKAGE_qt4-examples),-make,-nomake) examples \
325 -nomake translations \
326 -xplatform $(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++ \
327 -platform linux-g++ \
328 $(if $(CONFIG_QT4_WS_X11),-x11,-embedded) \
342 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite) \
343 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql) \
344 -no-decoration-styled \
345 -no-decoration-windows \
346 -no-decoration-default \
350 $(if $(CONFIG_PACKAGE_qt4-phonon),-phonon,-no-phonon) \
352 $(if $(CONFIG_PACKAGE_qt4-svg),-svg,-no-svg) \
353 $(if $(CONFIG_PACKAGE_qt4-webkit),-webkit,-no-webkit) \
355 $(if $(CONFIG_PACKAGE_qt4-script),-script,-no-script) \
356 $(if $(CONFIG_PACKAGE_qt4-scripttools),-scripttools,-no-scripttools) \
358 $(if $(CONFIG_PACKAGE_qt4-declarative),-declarative,-no-declarative) \
359 $(if $(CONFIG_PACKAGE_qt4-openssl),-openssl -I $(STAGING_DIR)/usr/include,-no-openssl) \
363 $(if $(CONFIG_PACKAGE_qt4-dbus),-dbus,-no-dbus) \
370 $(if $(CONFIG_QT4_WS_X11),-no-xsync,-xsync) \
372 $(if $(CONFIG_QT4_WS_X11),-no-xcursor,-xcursor) \
377 $(if $(CONFIG_QT4_WS_X11),-no-fontconfig,-fontconfig) \
378 $(if $(CONFIG_QT4_WS_X11),-no-xinput,-xinput) \
379 $(if $(CONFIG_QT4_WS_X11),-no-xkb,-xkb) \
381 $(if $(CONFIG_PACKAGE_qt4-qt3support),-qt3support,-no-qt3support) \
382 -no-gfx-transformed \
384 $(if $(CONFIG_PACKAGE_qt4-drivers-gfx-vnc),-plugin-gfx-vnc,-no-gfx-vnc) \
385 -no-gfx-multiscreen \
387 $(if $(CONFIG_FEATURE_drawing-backend_DirectFB),$(if $(CONFIG_PACKAGE_directfb),-plugin-gfx-directfb)) \
388 -plugin-gfx-linuxfb \
391 -qt-mouse-linuxinput \
392 -plugin-mouse-linuxtp \
394 -plugin-mouse-tslib \
403 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
404 # unfortunately in this particular case, <make> makes further <qmake> calls, therewith
405 # uses the qmake.conf which needs get the cross-compiling vars passed once again
406 TARGET_CC="$(TARGET_CROSS)gcc" \
407 TARGET_CXX="$(TARGET_CROSS)g++" \
408 TARGET_AR="$(TARGET_CROSS)ar cqs" \
409 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
410 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
411 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
412 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
413 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
414 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
415 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
416 STAGING_DIR="$(STAGING_DIR)" \
417 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
418 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
419 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
420 $(MAKE) -C $(PKG_BUILD_DIR) install
423 define Build/InstallDev
425 $(STAGING_DIR_HOST)/bin
427 # host tools (qmake, moc, rcc, uic)
429 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
430 $(STAGING_DIR_HOST)/bin/
434 $(1)/usr/share/mkspecs \
435 $(1)/usr/lib/pkgconfig \
438 $(1)/usr/lib/Qt/plugins
445 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
446 $(1)/usr/share/mkspecs/
449 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
450 $(1)/usr/lib/pkgconfig/
453 $(PKG_INSTALL_DIR)/usr/include/* \
457 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
461 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
462 # $(1)/usr/lib/Qt/plugins/
465 define Package/qt4/install
468 $(1)/usr/lib/Qt/plugins
471 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
475 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
476 # $(1)/usr/lib/Qt/plugins/codecs/
479 define Package/qt4-gui/install
482 $(1)/usr/lib/Qt/plugins
485 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
488 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
490 /usr/share/fonts/ttf-dejavu \
493 # we use the dejavue font package instead
495 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
496 # $(1)/usr/lib/fonts/
499 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
500 # $(1)/usr/lib/Qt/plugins/
503 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
504 # $(1)/usr/lib/Qt/plugins/
507 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
508 # $(1)/usr/lib/Qt/plugins/
511 define Package/qt4-demos/install
516 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
527 define Package/qt4-examples/install
532 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
543 define Package/qt4-network/install
548 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
552 define Package/qt4-sqlite/install
554 $(1)/usr/lib/Qt/plugins/sqldrivers
557 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
561 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
562 $(1)/usr/lib/Qt/plugins/sqldrivers/
565 define Package/qt4-mysql/install
567 $(1)/usr/lib/Qt/plugins/sqldrivers
570 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
574 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
575 $(1)/usr/lib/Qt/plugins/sqldrivers/
578 #define Package/qt4-multimedia/install
583 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
587 define Package/qt4-phonon/install
592 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
596 define Package/qt4-svg/install
599 $(1)/usr/lib/Qt/plugins
602 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
606 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
607 # $(1)/usr/lib/Qt/plugins/
610 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
611 # $(1)/usr/lib/Qt/plugins/
614 define Package/qt4-webkit/install
617 $(1)/usr/lib/Qt/plugins
620 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
624 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
625 # $(1)/usr/lib/Qt/plugins/
628 define Package/qt4-script/install
631 $(1)/usr/lib/Qt/plugins
634 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
638 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
639 # $(1)/usr/lib/Qt/plugins/
642 define Package/qt4-scripttools/install
647 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
651 define Package/qt4-dbus/install
656 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
660 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
664 define Package/qt4-qt3-support/install
667 $(1)/usr/lib/Qt/plugins
670 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
674 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
675 # $(1)/usr/lib/Qt/plugins/
678 define Package/qt4-declarative/install
683 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
687 define Package/qt4-xml/install
692 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
698 define Package/qt4-drivers-mouse-tpmousedriver/install
700 $(1)/usr/lib/Qt/plugins/mousedrivers
703 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqlinuxtpmousedriver.so \
704 $(1)/usr/lib/Qt/plugins/mousedrivers/
707 define Package/qt4-drivers-mouse-pcmousedriver/install
709 $(1)/usr/lib/Qt/plugins/mousedrivers
712 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqpcmousedriver.so \
713 $(1)/usr/lib/Qt/plugins/mousedrivers/
716 define Package/qt4-drivers-mouse-tslibmousedriver/install
718 $(1)/usr/lib/Qt/plugins/mousedrivers
721 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqtslibmousedriver.so \
722 $(1)/usr/lib/Qt/plugins/mousedrivers/
726 define Package/qt4-drivers-gfx-directfb/install
728 $(1)/usr/lib/Qt/plugins/gfxdrivers
731 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqdirectfbscreen.so \
732 $(1)/usr/lib/Qt/plugins/gfxdrivers/
735 define Package/qt4-drivers-gfx-linuxfb/install
737 $(1)/usr/lib/Qt/plugins/gfxdrivers
740 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqscreenlinuxfb.so \
741 $(1)/usr/lib/Qt/plugins/gfxdrivers/
744 define Package/qt4-drivers-gfx-vnc/install
746 $(1)/usr/lib/Qt/plugins/gfxdrivers
749 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqgfxvnc.so \
750 $(1)/usr/lib/Qt/plugins/gfxdrivers/
757 $(eval $(call BuildPackage,qt4))
758 $(eval $(call BuildPackage,qt4-gui))
759 $(eval $(call BuildPackage,qt4-demos))
760 $(eval $(call BuildPackage,qt4-examples))
761 $(eval $(call BuildPackage,qt4-network))
762 $(eval $(call BuildPackage,qt4-sqlite))
763 $(eval $(call BuildPackage,qt4-mysql))
764 $(eval $(call BuildPackage,qt4-openssl))
765 #$(eval $(call BuildPackage,qt4-multimedia))
766 #$(eval $(call BuildPackage,qt4-audio-backend))
767 $(eval $(call BuildPackage,qt4-phonon))
768 #$(eval $(call BuildPackage,qt4-phonon-backend))
769 $(eval $(call BuildPackage,qt4-svg))
770 $(eval $(call BuildPackage,qt4-webkit))
771 $(eval $(call BuildPackage,qt4-script))
772 $(eval $(call BuildPackage,qt4-scripttools))
773 #$(eval $(call BuildPackage,qt4-accessibility))
774 #$(eval $(call BuildPackage,qt4-javascript-jit))
775 #$(eval $(call BuildPackage,qt4-cups))
776 $(eval $(call BuildPackage,qt4-dbus))
777 #$(eval $(call BuildPackage,qt4-gtkstyle))
778 #$(eval $(call BuildPackage,qt4-glib))
779 $(eval $(call BuildPackage,qt4-qt3support))
780 $(eval $(call BuildPackage,qt4-declarative))
781 $(eval $(call BuildPackage,qt4-xml))
783 $(eval $(call BuildPackage,qt4-drivers-mouse-tpmousedriver))
784 $(eval $(call BuildPackage,qt4-drivers-mouse-pcmousedriver))
785 $(eval $(call BuildPackage,qt4-drivers-mouse-tslibmousedriver))
787 $(eval $(call BuildPackage,qt4-drivers-gfx-directfb))
788 $(eval $(call BuildPackage,qt4-drivers-gfx-linuxfb))
789 $(eval $(call BuildPackage,qt4-drivers-gfx-vnc))