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
15 PKG_VERSION:=4.7.0-beta2
18 PKG_SOURCE:=qt-everywhere-opensource-src-$(PKG_VERSION).tar.gz
19 PKG_SOURCE_URL:=ftp://ftp.qt.nokia.com/qt/source
20 PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-opensource-src-$(PKG_VERSION)
23 PKG_CONFIG_DEPENDS:= \
26 CONFIG_PACKAGE_directfb \
27 CONFIG_PACKAGE_qt4-demos \
28 CONFIG_PACKAGE_qt4-examples \
29 CONFIG_PACKAGE_qt4-svg \
30 CONFIG_PACKAGE_qt4-qt3support \
31 CONFIG_PACKAGE_qt4-dbus \
32 CONFIG_PACKAGE_qt4-phonon \
33 CONFIG_PACKAGE_qt4-sqlite \
34 CONFIG_PACKAGE_qt4-mysql
36 include $(INCLUDE_DIR)/package.mk
37 -include $(if $(DUMP),,./files/qmake.mk)
39 # this should be moved to a more generic place later, as other packages are configured different as well depending on available nptl support
40 ifeq ($(CONFIG_USE_GLIBC),y)
43 ifeq ($(CONFIG_USE_EGLIBC),y)
46 ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
50 define Package/qt4/config
51 source "$(SOURCE)/Config.in"
54 define Package/qt4/Default
55 SECTION:=xorg-framework
60 URL:=http://qt.nokia.com/
64 $(call Package/qt4/Default)
65 DEPENDS:=@FEATURE_drawing-backend_DirectFB||@FEATURE_drawing-backend_libX11 +zlib +libstdcpp +libsqlite3
68 define Package/qt4-gui
69 $(call Package/qt4/Default)
70 DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network
74 define Package/qt4-demos
75 $(call Package/qt4/Default)
80 define Package/qt4-examples
81 $(call Package/qt4/Default)
83 DEPENDS+=+qt4-gui +qt4-svg
86 define Package/qt4-network
87 $(call Package/qt4/Default)
91 define Package/qt4-sqlite
92 $(call Package/qt4/Default)
97 define Package/qt4-mysql
98 $(call Package/qt4/Default)
100 DEPENDS+=+libmysqlclient
103 #define Package/qt4-multimedia
104 # $(call Package/qt4/Default)
105 # TITLE+=(multimedia)
108 #define Package/qt4-audio-backend
109 # $(call Package/qt4/Default)
110 # TITLE+=(audio-backend)
113 define Package/qt4-phonon
114 $(call Package/qt4/Default)
116 DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
119 #define Package/qt4-phonon-backend
120 # $(call Package/qt4/Default)
121 # TITLE+=(phonon-backend)
124 define Package/qt4-svg
125 $(call Package/qt4/Default)
127 DEPENDS+=+qt4-gui +qt4-network
130 define Package/qt4-webkit
131 $(call Package/qt4/Default)
133 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
136 define Package/qt4-script
137 $(call Package/qt4/Default)
139 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
142 define Package/qt4-scripttools
143 $(call Package/qt4/Default)
145 DEPENDS+=+qt4-script +qt4-gui +qt4-network
148 #define Package/qt4-accessibility
149 # $(call Package/qt4/Default)
150 # TITLE+=(accessibility)
153 #define Package/qt4-javascript-jit
154 # $(call Package/qt4/Default)
155 # TITLE+=(javascript-jit)
158 #define Package/qt4-cups
159 # $(call Package/qt4/Default)
163 define Package/qt4-dbus
164 $(call Package/qt4/Default)
166 DEPENDS+=+libdbus +qt4-xml
169 #define Package/qt4-gtkstyle
170 # $(call Package/qt4/Default)
174 #define Package/qt4-glib
175 # $(call Package/qt4/Default)
179 define Package/qt4-qt3support
180 $(call Package/qt4/Default)
182 DEPENDS+=+qt4-gui +qt4-xml
185 define Package/qt4-declarative
186 $(call Package/qt4/Default)
188 DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
191 define Package/qt4-xml
192 $(call Package/qt4/Default)
197 define Package/qt4-drivers-mouse/Default
198 $(call Package/qt4/Default)
203 define Package/qt4-drivers-mouse-tpmousedriver
204 $(call Package/qt4-drivers-mouse/Default)
208 define Package/qt4-drivers-mouse-pcmousedriver
209 $(call Package/qt4-drivers-mouse/Default)
213 define Package/qt4-drivers-mouse-tslibmousedriver
214 $(call Package/qt4-drivers-mouse/Default)
215 TITLE+=tslibmousedriver
219 define Package/qt4-drivers-gfx/Default
220 $(call Package/qt4/Default)
225 define Package/qt4-drivers-gfx-directfb
226 $(call Package/qt4-drivers-gfx/Default)
228 DEPENDS+=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb
231 define Package/qt4-drivers-gfx-linuxfb
232 $(call Package/qt4-drivers-gfx/Default)
237 define Package/qt4-drivers-kbd/Default
238 $(call Package/qt4/Default)
243 define Package/qt4-drivers-kbd-linuxinput
244 $(call Package/qt4-drivers-kbd/Default)
249 TARGET_INCDIRS+=$(STAGING_DIR)/include $(STAGING_DIR)/usr/include $(TOOLCHAIN_DIR)/include $(TOOLCHAIN_DIR)/usr/include
250 TARGET_LIBDIRS+=$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib $(TOOLCHAIN_DIR)/lib $(TOOLCHAIN_DIR)/usr/lib
251 TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib,-rpath-link=$(PKG_BUILD_DIR)/lib
252 TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include
254 ifeq ($(CONFIG_QT4_WS_QWS),y)
257 ifeq ($(CONFIG_QT4_WS_X11),y)
261 define Build/Configure
263 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
264 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
265 # do not use fontconfig as it doesn't work anyway for qte
266 # 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
267 mkdir -p $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++
268 $(CP) ./files/$(FILEPFX)qmake.conf $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++/qmake.conf
269 $(CP) ./files/$(FILEPFX)qplatformdefs.h $(PKG_BUILD_DIR)/mkspecs/$(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++/qplatformdefs.h
270 ( cd $(PKG_BUILD_DIR) ; \
271 TARGET_CC="$(TARGET_CROSS)gcc" \
272 TARGET_CXX="$(TARGET_CROSS)g++" \
273 TARGET_AR="$(TARGET_CROSS)ar cqs" \
274 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
275 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
276 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
277 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
278 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
279 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
280 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
281 STAGING_DIR="$(STAGING_DIR)" \
282 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
285 -prefix $(CONFIGURE_PREFIX) \
286 -bindir $(CONFIGURE_PREFIX)/bin \
287 -libdir $(CONFIGURE_PREFIX)/lib \
288 -datadir $(CONFIGURE_PREFIX)/share/Qt \
289 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
290 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
291 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
292 -sysconfdir /etc/Qt \
296 $(if $(CONFIG_PACKAGE_qt4-demos),-make,-nomake) demos \
297 $(if $(CONFIG_PACKAGE_qt4-examples),-make,-nomake) examples \
299 -nomake translations \
300 -xplatform $(QMAKE_PLATFORM_PREFIX)linux-openwrt-g++ \
301 -platform linux-g++ \
302 $(if $(CONFIG_QT4_WS_QWS),-embedded) \
303 $(if $(CONFIG_QT4_WS_X11),-x11) \
317 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite) \
318 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql) \
319 -no-decoration-styled \
320 -no-decoration-windows \
321 -no-decoration-default \
325 $(if $(CONFIG_PACKAGE_qt4-phonon),-phonon,-no-phonon) \
327 $(if $(CONFIG_PACKAGE_qt4-svg),-svg,-no-svg) \
328 $(if $(NPTL),-webkit,-no-webkit) \
330 $(if $(NPTL),-script,-no-script) \
331 $(if $(NPTL),-scripttools,-no-scripttools) \
333 $(if $(NPTL),-declarative,-no-declarative) \
338 $(if $(CONFIG_PACKAGE_qt4-dbus),-dbus,-no-dbus) \
345 $(if $(CONFIG_QT4_WS_X11),-no-xsync,-xsync) \
347 $(if $(CONFIG_QT4_WS_X11),-no-xcursor,-xcursor) \
351 $(if $(CONFIG_QT4_WS_X11),-no-mitshm,-mitshm) \
352 $(if $(CONFIG_QT4_WS_X11),-no-fontconfig,-fontconfig) \
353 $(if $(CONFIG_QT4_WS_X11),-no-xinput,-xinput) \
354 $(if $(CONFIG_QT4_WS_X11),-no-xkb,-xkb) \
356 $(if $(CONFIG_PACKAGE_qt4-qt3support),-qt3support,-no-qt3support) \
357 -no-gfx-transformed \
360 -no-gfx-multiscreen \
362 $(if $(CONFIG_PACKAGE_directfb),-plugin-gfx-directfb) \
363 -plugin-gfx-linuxfb \
366 -qt-mouse-linuxinput \
367 -plugin-mouse-linuxtp \
369 -plugin-mouse-tslib \
373 -plugin-kbd-linuxinput \
378 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
379 # unfortunately in this particular case, <make> makes further <qmake> calls, therewith
380 # uses the qmake.conf which needs get the cross-compiling vars passed once again
381 TARGET_CC="$(TARGET_CROSS)gcc" \
382 TARGET_CXX="$(TARGET_CROSS)g++" \
383 TARGET_AR="$(TARGET_CROSS)ar cqs" \
384 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
385 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
386 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
387 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
388 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
389 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
390 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
391 STAGING_DIR="$(STAGING_DIR)" \
392 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
393 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
394 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
395 $(MAKE) -C $(PKG_BUILD_DIR) install
398 define Build/InstallDev
400 $(STAGING_DIR_HOST)/bin
402 # host tools (qmake, moc, rcc, uic)
404 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
405 $(STAGING_DIR_HOST)/bin/
409 $(1)/usr/share/mkspecs \
410 $(1)/usr/lib/pkgconfig \
413 $(1)/usr/lib/Qt/plugins
420 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
421 $(1)/usr/share/mkspecs/
424 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
425 $(1)/usr/lib/pkgconfig/
428 $(PKG_INSTALL_DIR)/usr/include/* \
432 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
436 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
437 # $(1)/usr/lib/Qt/plugins/
440 define Package/qt4/install
443 $(1)/usr/lib/Qt/plugins
446 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
450 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
451 # $(1)/usr/lib/Qt/plugins/codecs/
454 define Package/qt4-gui/install
457 $(1)/usr/lib/Qt/plugins
460 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
463 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
465 /usr/share/fonts/ttf-dejavu \
468 # we use the dejavue font package instead
470 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
471 # $(1)/usr/lib/fonts/
474 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
475 # $(1)/usr/lib/Qt/plugins/
478 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
479 # $(1)/usr/lib/Qt/plugins/
482 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
483 # $(1)/usr/lib/Qt/plugins/
486 define Package/qt4-demos/install
491 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
502 define Package/qt4-examples/install
507 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
518 define Package/qt4-network/install
523 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
527 define Package/qt4-sqlite/install
529 $(1)/usr/lib/Qt/plugins/sqldrivers
532 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
536 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
537 $(1)/usr/lib/Qt/plugins/sqldrivers/
540 define Package/qt4-mysql/install
542 $(1)/usr/lib/Qt/plugins/sqldrivers
545 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
549 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
550 $(1)/usr/lib/Qt/plugins/sqldrivers/
553 #define Package/qt4-multimedia/install
558 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
562 define Package/qt4-phonon/install
567 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
571 define Package/qt4-svg/install
574 $(1)/usr/lib/Qt/plugins
577 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
581 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
582 # $(1)/usr/lib/Qt/plugins/
585 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
586 # $(1)/usr/lib/Qt/plugins/
589 define Package/qt4-webkit/install
592 $(1)/usr/lib/Qt/plugins
595 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
599 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
600 # $(1)/usr/lib/Qt/plugins/
603 define Package/qt4-script/install
606 $(1)/usr/lib/Qt/plugins
609 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
613 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
614 # $(1)/usr/lib/Qt/plugins/
617 define Package/qt4-scripttools/install
622 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
626 define Package/qt4-dbus/install
631 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
635 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
639 define Package/qt4-qt3-support/install
642 $(1)/usr/lib/Qt/plugins
645 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
649 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
650 # $(1)/usr/lib/Qt/plugins/
653 define Package/qt4-declarative/install
658 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
662 define Package/qt4-xml/install
667 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
673 define Package/qt4-drivers-mouse-tpmousedriver/install
675 $(1)/usr/lib/Qt/plugins/mousedrivers
678 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqlinuxtpmousedriver.so \
679 $(1)/usr/lib/Qt/plugins/mousedrivers/
682 define Package/qt4-drivers-mouse-pcmousedriver/install
684 $(1)/usr/lib/Qt/plugins/mousedrivers
687 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqpcmousedriver.so \
688 $(1)/usr/lib/Qt/plugins/mousedrivers/
691 define Package/qt4-drivers-mouse-tslibmousedriver/install
693 $(1)/usr/lib/Qt/plugins/mousedrivers
696 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqtslibmousedriver.so \
697 $(1)/usr/lib/Qt/plugins/mousedrivers/
701 define Package/qt4-drivers-gfx-directfb/install
703 $(1)/usr/lib/Qt/plugins/gfxdrivers
706 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqdirectfbscreen.so \
707 $(1)/usr/lib/Qt/plugins/gfxdrivers/
710 define Package/qt4-drivers-gfx-linuxfb/install
712 $(1)/usr/lib/Qt/plugins/gfxdrivers
715 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqscreenlinuxfb.so \
716 $(1)/usr/lib/Qt/plugins/gfxdrivers/
720 define Package/qt4-drivers-kbd-linuxinput/install
722 $(1)/usr/lib/Qt/plugins/kbddrivers
725 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/kbddrivers/libqlinuxinputkbddriver.so \
726 $(1)/usr/lib/Qt/plugins/kbddrivers/
732 $(eval $(call BuildPackage,qt4))
733 $(eval $(call BuildPackage,qt4-gui))
734 $(eval $(call BuildPackage,qt4-demos))
735 $(eval $(call BuildPackage,qt4-examples))
736 $(eval $(call BuildPackage,qt4-network))
737 $(eval $(call BuildPackage,qt4-sqlite))
738 $(eval $(call BuildPackage,qt4-mysql))
739 #$(eval $(call BuildPackage,qt4-multimedia))
740 #$(eval $(call BuildPackage,qt4-audio-backend))
741 $(eval $(call BuildPackage,qt4-phonon))
742 #$(eval $(call BuildPackage,qt4-phonon-backend))
743 $(eval $(call BuildPackage,qt4-svg))
744 $(eval $(call BuildPackage,qt4-webkit))
745 $(eval $(call BuildPackage,qt4-script))
746 $(eval $(call BuildPackage,qt4-scripttools))
747 #$(eval $(call BuildPackage,qt4-accessibility))
748 #$(eval $(call BuildPackage,qt4-javascript-jit))
749 #$(eval $(call BuildPackage,qt4-cups))
750 $(eval $(call BuildPackage,qt4-dbus))
751 #$(eval $(call BuildPackage,qt4-gtkstyle))
752 #$(eval $(call BuildPackage,qt4-glib))
753 $(eval $(call BuildPackage,qt4-qt3support))
754 $(eval $(call BuildPackage,qt4-declarative))
755 $(eval $(call BuildPackage,qt4-xml))
757 $(eval $(call BuildPackage,qt4-drivers-mouse-tpmousedriver))
758 $(eval $(call BuildPackage,qt4-drivers-mouse-pcmousedriver))
759 $(eval $(call BuildPackage,qt4-drivers-mouse-tslibmousedriver))
761 $(eval $(call BuildPackage,qt4-drivers-gfx-directfb))
762 $(eval $(call BuildPackage,qt4-drivers-gfx-linuxfb))
764 $(eval $(call BuildPackage,qt4-drivers-kbd-linuxinput))