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
37 include $(INCLUDE_DIR)/package.mk
38 -include $(if $(DUMP),,./files/qmake.mk)
40 # this should be moved to a more generic place later, as other packages are configured different as well depending on available nptl support
41 ifeq ($(CONFIG_USE_GLIBC),y)
44 ifeq ($(CONFIG_USE_EGLIBC),y)
47 ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
51 define Package/qt4/config
52 source "$(SOURCE)/Config.in"
55 define Package/qt4/Default
56 SECTION:=xorg-framework
61 URL:=http://qt.nokia.com/
65 $(call Package/qt4/Default)
66 DEPENDS:=+zlib +libstdcpp +libsqlite3
69 define Package/qt4-gui
70 $(call Package/qt4/Default)
71 DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network \
72 +FEATURE_drawing-backend_DirectFB:directfb \
73 +FEATURE_drawing-backend_libX11:libX11 \
74 +FEATURE_drawing-backend_libX11:libXext
78 define Package/qt4-demos
79 $(call Package/qt4/Default)
84 define Package/qt4-examples
85 $(call Package/qt4/Default)
87 DEPENDS+=+qt4-gui +qt4-svg
90 define Package/qt4-network
91 $(call Package/qt4/Default)
95 define Package/qt4-sqlite
96 $(call Package/qt4/Default)
101 define Package/qt4-mysql
102 $(call Package/qt4/Default)
104 DEPENDS+=+libmysqlclient
107 #define Package/qt4-multimedia
108 # $(call Package/qt4/Default)
109 # TITLE+=(multimedia)
112 #define Package/qt4-audio-backend
113 # $(call Package/qt4/Default)
114 # TITLE+=(audio-backend)
117 define Package/qt4-phonon
118 $(call Package/qt4/Default)
120 DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
123 #define Package/qt4-phonon-backend
124 # $(call Package/qt4/Default)
125 # TITLE+=(phonon-backend)
128 define Package/qt4-svg
129 $(call Package/qt4/Default)
131 DEPENDS+=+qt4-gui +qt4-network
134 define Package/qt4-webkit
135 $(call Package/qt4/Default)
137 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
140 define Package/qt4-script
141 $(call Package/qt4/Default)
143 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
146 define Package/qt4-scripttools
147 $(call Package/qt4/Default)
149 DEPENDS+=+qt4-script +qt4-gui +qt4-network
152 #define Package/qt4-accessibility
153 # $(call Package/qt4/Default)
154 # TITLE+=(accessibility)
157 #define Package/qt4-javascript-jit
158 # $(call Package/qt4/Default)
159 # TITLE+=(javascript-jit)
162 #define Package/qt4-cups
163 # $(call Package/qt4/Default)
167 define Package/qt4-dbus
168 $(call Package/qt4/Default)
170 DEPENDS+=+libdbus +qt4-xml
173 #define Package/qt4-gtkstyle
174 # $(call Package/qt4/Default)
178 #define Package/qt4-glib
179 # $(call Package/qt4/Default)
183 define Package/qt4-qt3support
184 $(call Package/qt4/Default)
186 DEPENDS+=+qt4-gui +qt4-xml
189 define Package/qt4-declarative
190 $(call Package/qt4/Default)
192 DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
195 define Package/qt4-xml
196 $(call Package/qt4/Default)
201 define Package/qt4-drivers-mouse/Default
202 $(call Package/qt4/Default)
207 define Package/qt4-drivers-mouse-tpmousedriver
208 $(call Package/qt4-drivers-mouse/Default)
212 define Package/qt4-drivers-mouse-pcmousedriver
213 $(call Package/qt4-drivers-mouse/Default)
217 define Package/qt4-drivers-mouse-tslibmousedriver
218 $(call Package/qt4-drivers-mouse/Default)
219 TITLE+=tslibmousedriver
224 define Package/qt4-drivers-gfx/Default
225 $(call Package/qt4/Default)
230 define Package/qt4-drivers-gfx-directfb
231 $(call Package/qt4-drivers-gfx/Default)
233 DEPENDS+=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb
236 define Package/qt4-drivers-gfx-linuxfb
237 $(call Package/qt4-drivers-gfx/Default)
242 define Package/qt4-drivers-kbd/Default
243 $(call Package/qt4/Default)
248 define Package/qt4-drivers-kbd-linuxinput
249 $(call Package/qt4-drivers-kbd/Default)
254 TARGET_INCDIRS+=$(STAGING_DIR)/include $(STAGING_DIR)/usr/include $(TOOLCHAIN_DIR)/include $(TOOLCHAIN_DIR)/usr/include
255 TARGET_LIBDIRS+=$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib $(TOOLCHAIN_DIR)/lib $(TOOLCHAIN_DIR)/usr/lib
256 TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib,-rpath-link=$(PKG_BUILD_DIR)/lib
257 TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include
259 ifeq ($(CONFIG_QT4_WS_QWS),y)
262 ifeq ($(CONFIG_QT4_WS_X11),y)
265 ifeq ($(CONFIG_PACKAGE_qt4-gui),)
266 # If GUI is disabled, we use the X11 prefix. That's good enough, for now.
267 # The X11 files also work for non-GUI.
271 define Build/Configure
273 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
274 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
275 # do not use fontconfig as it doesn't work anyway for qte
276 # 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
277 mkdir -p $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++
278 $(CP) ./files/$(FILEPFX)qmake.conf $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++/qmake.conf
279 $(CP) ./files/$(FILEPFX)qplatformdefs.h $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++/qplatformdefs.h
280 ( cd $(PKG_BUILD_DIR) ; \
281 TARGET_CC="$(TARGET_CROSS)gcc" \
282 TARGET_CXX="$(TARGET_CROSS)g++" \
283 TARGET_AR="$(TARGET_CROSS)ar cqs" \
284 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
285 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
286 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
287 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
288 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
289 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
290 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
291 STAGING_DIR="$(STAGING_DIR)" \
292 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
295 -prefix $(CONFIGURE_PREFIX) \
296 -bindir $(CONFIGURE_PREFIX)/bin \
297 -libdir $(CONFIGURE_PREFIX)/lib \
298 -datadir $(CONFIGURE_PREFIX)/share/Qt \
299 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
300 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
301 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
302 -sysconfdir /etc/Qt \
306 $(if $(CONFIG_PACKAGE_qt4-demos),-make,-nomake) demos \
307 $(if $(CONFIG_PACKAGE_qt4-examples),-make,-nomake) examples \
309 -nomake translations \
310 -xplatform $(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++ \
311 -platform linux-g++ \
312 $(if $(CONFIG_QT4_WS_X11),-x11,-embedded) \
326 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite) \
327 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql) \
328 -no-decoration-styled \
329 -no-decoration-windows \
330 -no-decoration-default \
334 $(if $(CONFIG_PACKAGE_qt4-phonon),-phonon,-no-phonon) \
336 $(if $(CONFIG_PACKAGE_qt4-svg),-svg,-no-svg) \
337 $(if $(NPTL),-webkit,-no-webkit) \
339 $(if $(NPTL),-script,-no-script) \
340 $(if $(NPTL),-scripttools,-no-scripttools) \
342 $(if $(NPTL),-declarative,-no-declarative) \
347 $(if $(CONFIG_PACKAGE_qt4-dbus),-dbus,-no-dbus) \
354 $(if $(CONFIG_QT4_WS_X11),-no-xsync,-xsync) \
356 $(if $(CONFIG_QT4_WS_X11),-no-xcursor,-xcursor) \
360 $(if $(CONFIG_QT4_WS_X11),-no-mitshm,-mitshm) \
361 $(if $(CONFIG_QT4_WS_X11),-no-fontconfig,-fontconfig) \
362 $(if $(CONFIG_QT4_WS_X11),-no-xinput,-xinput) \
363 $(if $(CONFIG_QT4_WS_X11),-no-xkb,-xkb) \
365 $(if $(CONFIG_PACKAGE_qt4-qt3support),-qt3support,-no-qt3support) \
366 -no-gfx-transformed \
369 -no-gfx-multiscreen \
371 $(if $(CONFIG_PACKAGE_directfb),-plugin-gfx-directfb) \
372 -plugin-gfx-linuxfb \
375 -qt-mouse-linuxinput \
376 -plugin-mouse-linuxtp \
378 -plugin-mouse-tslib \
382 -plugin-kbd-linuxinput \
387 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
388 # unfortunately in this particular case, <make> makes further <qmake> calls, therewith
389 # uses the qmake.conf which needs get the cross-compiling vars passed once again
390 TARGET_CC="$(TARGET_CROSS)gcc" \
391 TARGET_CXX="$(TARGET_CROSS)g++" \
392 TARGET_AR="$(TARGET_CROSS)ar cqs" \
393 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
394 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
395 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
396 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
397 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
398 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
399 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
400 STAGING_DIR="$(STAGING_DIR)" \
401 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
402 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
403 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
404 $(MAKE) -C $(PKG_BUILD_DIR) install
407 define Build/InstallDev
409 $(STAGING_DIR_HOST)/bin
411 # host tools (qmake, moc, rcc, uic)
413 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
414 $(STAGING_DIR_HOST)/bin/
418 $(1)/usr/share/mkspecs \
419 $(1)/usr/lib/pkgconfig \
422 $(1)/usr/lib/Qt/plugins
429 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
430 $(1)/usr/share/mkspecs/
433 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
434 $(1)/usr/lib/pkgconfig/
437 $(PKG_INSTALL_DIR)/usr/include/* \
441 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
445 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
446 # $(1)/usr/lib/Qt/plugins/
449 define Package/qt4/install
452 $(1)/usr/lib/Qt/plugins
455 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
459 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
460 # $(1)/usr/lib/Qt/plugins/codecs/
463 define Package/qt4-gui/install
466 $(1)/usr/lib/Qt/plugins
469 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
472 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
474 /usr/share/fonts/ttf-dejavu \
477 # we use the dejavue font package instead
479 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
480 # $(1)/usr/lib/fonts/
483 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
484 # $(1)/usr/lib/Qt/plugins/
487 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
488 # $(1)/usr/lib/Qt/plugins/
491 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
492 # $(1)/usr/lib/Qt/plugins/
495 define Package/qt4-demos/install
500 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
511 define Package/qt4-examples/install
516 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
527 define Package/qt4-network/install
532 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
536 define Package/qt4-sqlite/install
538 $(1)/usr/lib/Qt/plugins/sqldrivers
541 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
545 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
546 $(1)/usr/lib/Qt/plugins/sqldrivers/
549 define Package/qt4-mysql/install
551 $(1)/usr/lib/Qt/plugins/sqldrivers
554 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
558 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
559 $(1)/usr/lib/Qt/plugins/sqldrivers/
562 #define Package/qt4-multimedia/install
567 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
571 define Package/qt4-phonon/install
576 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
580 define Package/qt4-svg/install
583 $(1)/usr/lib/Qt/plugins
586 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
590 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
591 # $(1)/usr/lib/Qt/plugins/
594 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
595 # $(1)/usr/lib/Qt/plugins/
598 define Package/qt4-webkit/install
601 $(1)/usr/lib/Qt/plugins
604 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
608 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
609 # $(1)/usr/lib/Qt/plugins/
612 define Package/qt4-script/install
615 $(1)/usr/lib/Qt/plugins
618 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
622 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
623 # $(1)/usr/lib/Qt/plugins/
626 define Package/qt4-scripttools/install
631 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
635 define Package/qt4-dbus/install
640 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
644 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
648 define Package/qt4-qt3-support/install
651 $(1)/usr/lib/Qt/plugins
654 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
658 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
659 # $(1)/usr/lib/Qt/plugins/
662 define Package/qt4-declarative/install
667 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
671 define Package/qt4-xml/install
676 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
682 define Package/qt4-drivers-mouse-tpmousedriver/install
684 $(1)/usr/lib/Qt/plugins/mousedrivers
687 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqlinuxtpmousedriver.so \
688 $(1)/usr/lib/Qt/plugins/mousedrivers/
691 define Package/qt4-drivers-mouse-pcmousedriver/install
693 $(1)/usr/lib/Qt/plugins/mousedrivers
696 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqpcmousedriver.so \
697 $(1)/usr/lib/Qt/plugins/mousedrivers/
700 define Package/qt4-drivers-mouse-tslibmousedriver/install
702 $(1)/usr/lib/Qt/plugins/mousedrivers
705 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqtslibmousedriver.so \
706 $(1)/usr/lib/Qt/plugins/mousedrivers/
710 define Package/qt4-drivers-gfx-directfb/install
712 $(1)/usr/lib/Qt/plugins/gfxdrivers
715 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqdirectfbscreen.so \
716 $(1)/usr/lib/Qt/plugins/gfxdrivers/
719 define Package/qt4-drivers-gfx-linuxfb/install
721 $(1)/usr/lib/Qt/plugins/gfxdrivers
724 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqscreenlinuxfb.so \
725 $(1)/usr/lib/Qt/plugins/gfxdrivers/
729 define Package/qt4-drivers-kbd-linuxinput/install
731 $(1)/usr/lib/Qt/plugins/kbddrivers
734 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/kbddrivers/libqlinuxinputkbddriver.so \
735 $(1)/usr/lib/Qt/plugins/kbddrivers/
741 $(eval $(call BuildPackage,qt4))
742 $(eval $(call BuildPackage,qt4-gui))
743 $(eval $(call BuildPackage,qt4-demos))
744 $(eval $(call BuildPackage,qt4-examples))
745 $(eval $(call BuildPackage,qt4-network))
746 $(eval $(call BuildPackage,qt4-sqlite))
747 $(eval $(call BuildPackage,qt4-mysql))
748 #$(eval $(call BuildPackage,qt4-multimedia))
749 #$(eval $(call BuildPackage,qt4-audio-backend))
750 $(eval $(call BuildPackage,qt4-phonon))
751 #$(eval $(call BuildPackage,qt4-phonon-backend))
752 $(eval $(call BuildPackage,qt4-svg))
753 $(eval $(call BuildPackage,qt4-webkit))
754 $(eval $(call BuildPackage,qt4-script))
755 $(eval $(call BuildPackage,qt4-scripttools))
756 #$(eval $(call BuildPackage,qt4-accessibility))
757 #$(eval $(call BuildPackage,qt4-javascript-jit))
758 #$(eval $(call BuildPackage,qt4-cups))
759 $(eval $(call BuildPackage,qt4-dbus))
760 #$(eval $(call BuildPackage,qt4-gtkstyle))
761 #$(eval $(call BuildPackage,qt4-glib))
762 $(eval $(call BuildPackage,qt4-qt3support))
763 $(eval $(call BuildPackage,qt4-declarative))
764 $(eval $(call BuildPackage,qt4-xml))
766 $(eval $(call BuildPackage,qt4-drivers-mouse-tpmousedriver))
767 $(eval $(call BuildPackage,qt4-drivers-mouse-pcmousedriver))
768 $(eval $(call BuildPackage,qt4-drivers-mouse-tslibmousedriver))
770 $(eval $(call BuildPackage,qt4-drivers-gfx-directfb))
771 $(eval $(call BuildPackage,qt4-drivers-gfx-linuxfb))
773 $(eval $(call BuildPackage,qt4-drivers-kbd-linuxinput))