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 X11/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:= \
24 CONFIG_PACKAGE_qt4-demos \
25 CONFIG_PACKAGE_qt4-examples \
26 CONFIG_PACKAGE_qt4-svg \
27 CONFIG_PACKAGE_qt4-qt3support \
28 CONFIG_PACKAGE_qt4-dbus \
29 CONFIG_PACKAGE_qt4-phonon \
30 CONFIG_PACKAGE_qt4-sqlite \
31 CONFIG_PACKAGE_qt4-mysql
33 include $(INCLUDE_DIR)/package.mk
35 # this should be moved to a more generic place later, as other packages are configured different as well depending on available nptl support
36 ifeq ($(CONFIG_USE_GLIBC),y)
39 ifeq ($(CONFIG_USE_EGLIBC),y)
42 ifeq ($(CONFIG_UCLIBC_VERSION_0_9_32),y)
46 define Package/qt4/Default
47 SECTION:=xorg-framework
52 URL:=http://qt.nokia.com/
56 $(call Package/qt4/Default)
57 DEPENDS:=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb +zlib +libstdcpp +libsqlite3 +tslib # require directfb for now, as other systems (libX11, xcb) are untested
60 define Package/qt4-gui
61 $(call Package/qt4/Default)
62 DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network
66 define Package/qt4-demos
67 $(call Package/qt4/Default)
72 define Package/qt4-examples
73 $(call Package/qt4/Default)
75 DEPENDS+=+qt4-gui +qt4-svg
78 define Package/qt4-network
79 $(call Package/qt4/Default)
83 define Package/qt4-sqlite
84 $(call Package/qt4/Default)
89 define Package/qt4-mysql
90 $(call Package/qt4/Default)
92 DEPENDS+=+libmysqlclient
95 #define Package/qt4-multimedia
96 # $(call Package/qt4/Default)
100 #define Package/qt4-audio-backend
101 # $(call Package/qt4/Default)
102 # TITLE+=(audio-backend)
105 define Package/qt4-phonon
106 $(call Package/qt4/Default)
108 DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
111 #define Package/qt4-phonon-backend
112 # $(call Package/qt4/Default)
113 # TITLE+=(phonon-backend)
116 define Package/qt4-svg
117 $(call Package/qt4/Default)
119 DEPENDS+=+qt4-gui +qt4-network
122 define Package/qt4-webkit
123 $(call Package/qt4/Default)
125 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
128 define Package/qt4-script
129 $(call Package/qt4/Default)
131 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
134 define Package/qt4-scripttools
135 $(call Package/qt4/Default)
137 DEPENDS+=+qt4-script +qt4-gui +qt4-network
140 #define Package/qt4-accessibility
141 # $(call Package/qt4/Default)
142 # TITLE+=(accessibility)
145 #define Package/qt4-javascript-jit
146 # $(call Package/qt4/Default)
147 # TITLE+=(javascript-jit)
150 #define Package/qt4-cups
151 # $(call Package/qt4/Default)
155 define Package/qt4-dbus
156 $(call Package/qt4/Default)
158 DEPENDS+=+libdbus +qt4-xml
161 #define Package/qt4-gtkstyle
162 # $(call Package/qt4/Default)
166 #define Package/qt4-glib
167 # $(call Package/qt4/Default)
171 define Package/qt4-qt3support
172 $(call Package/qt4/Default)
174 DEPENDS+=+qt4-gui +qt4-xml
177 define Package/qt4-declarative
178 $(call Package/qt4/Default)
180 DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
183 define Package/qt4-xml
184 $(call Package/qt4/Default)
189 define Package/qt4-drivers-mouse/Default
190 $(call Package/qt4/Default)
194 define Package/qt4-drivers-mouse-tpmousedriver
195 $(call Package/qt4-drivers-mouse/Default)
199 define Package/qt4-drivers-mouse-pcmousedriver
200 $(call Package/qt4-drivers-mouse/Default)
204 define Package/qt4-drivers-mouse-tslibmousedriver
205 $(call Package/qt4-drivers-mouse/Default)
206 TITLE+=tslibmousedriver
210 define Package/qt4-drivers-gfx/Default
211 $(call Package/qt4/Default)
215 define Package/qt4-drivers-gfx-directfb
216 $(call Package/qt4-drivers-gfx/Default)
220 define Package/qt4-drivers-gfx-linuxfb
221 $(call Package/qt4-drivers-gfx/Default)
226 define Package/qt4-drivers-kbd/Default
227 $(call Package/qt4/Default)
231 define Package/qt4-drivers-kbd-linuxinput
232 $(call Package/qt4-drivers-kbd/Default)
237 TARGET_INCDIRS+=$(STAGING_DIR)/include $(STAGING_DIR)/usr/include $(TOOLCHAIN_DIR)/include $(TOOLCHAIN_DIR)/usr/include
238 TARGET_LIBDIRS+=$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib $(TOOLCHAIN_DIR)/lib $(TOOLCHAIN_DIR)/usr/lib
239 TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib,-rpath-link=$(PKG_BUILD_DIR)/lib
240 TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include
242 define Build/Configure
244 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
245 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
246 # do not use fontconfig as it doesn't work anyway for qte
247 # 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
248 mkdir -p $(PKG_BUILD_DIR)/mkspecs/qws/linux-openwrt-g++
249 $(CP) ./files/qws-qmake.conf $(PKG_BUILD_DIR)/mkspecs/qws/linux-openwrt-g++/qmake.conf
250 $(CP) ./files/qws-qplatformdefs.h $(PKG_BUILD_DIR)/mkspecs/qws/linux-openwrt-g++/qplatformdefs.h
251 ( cd $(PKG_BUILD_DIR) ; \
252 TARGET_CC="$(TARGET_CROSS)gcc" \
253 TARGET_CXX="$(TARGET_CROSS)g++" \
254 TARGET_AR="$(TARGET_CROSS)ar cqs" \
255 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
256 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
257 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
258 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
259 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
260 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
261 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
262 STAGING_DIR="$(STAGING_DIR)" \
263 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
265 -prefix $(CONFIGURE_PREFIX) \
266 -bindir $(CONFIGURE_PREFIX)/bin \
267 -libdir $(CONFIGURE_PREFIX)/lib \
268 -datadir $(CONFIGURE_PREFIX)/share/Qt \
269 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
270 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
271 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
272 -sysconfdir /etc/Qt \
276 $(if $(CONFIG_PACKAGE_qt4-demos),-make,-nomake) demos \
277 $(if $(CONFIG_PACKAGE_qt4-examples),-make,-nomake) examples \
279 -nomake translations \
280 -xplatform qws/linux-openwrt-g++ \
281 -platform linux-g++ \
296 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite) \
297 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql) \
298 -no-decoration-styled \
299 -no-decoration-windows \
300 -no-decoration-default \
304 $(if $(CONFIG_PACKAGE_qt4-phonon),-phonon,-no-phonon) \
306 $(if $(CONFIG_PACKAGE_qt4-svg),-svg,-no-svg) \
307 $(if $(NPTL),-webkit,-no-webkit) \
309 $(if $(NPTL),-script,-no-script) \
310 $(if $(NPTL),-scripttools,-no-scripttools) \
312 $(if $(NPTL),-declarative,-no-declarative) \
317 $(if $(CONFIG_PACKAGE_qt4-dbus),-dbus,-no-dbus) \
335 $(if $(CONFIG_PACKAGE_qt4-qt3support),-qt3support,-no-qt3support) \
336 -no-gfx-transformed \
339 -no-gfx-multiscreen \
341 -plugin-gfx-directfb \
342 -plugin-gfx-linuxfb \
345 -qt-mouse-linuxinput \
346 -plugin-mouse-linuxtp \
348 -plugin-mouse-tslib \
352 -plugin-kbd-linuxinput \
357 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
358 # unfortunately in this particular case, <make> makes further <qmake> calls, therewith
359 # uses the qmake.conf which needs get the cross-compiling vars passed once again
360 TARGET_CC="$(TARGET_CROSS)gcc" \
361 TARGET_CXX="$(TARGET_CROSS)g++" \
362 TARGET_AR="$(TARGET_CROSS)ar cqs" \
363 TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
364 TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
365 TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
366 TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
367 TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
368 TARGET_INCDIRS="$(TARGET_INCDIRS)" \
369 TARGET_LIBDIRS="$(TARGET_LIBDIRS)" \
370 STAGING_DIR="$(STAGING_DIR)" \
371 STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
372 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
373 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
374 $(MAKE) -C $(PKG_BUILD_DIR) install
377 define Build/InstallDev
379 $(STAGING_DIR_HOST)/bin
381 # host tools (qmake, moc, rcc, uic)
383 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
384 $(STAGING_DIR_HOST)/bin/
388 $(1)/usr/share/mkspecs \
389 $(1)/usr/lib/pkgconfig \
392 $(1)/usr/lib/Qt/plugins
399 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
400 $(1)/usr/share/mkspecs/
403 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
404 $(1)/usr/lib/pkgconfig/
407 $(PKG_INSTALL_DIR)/usr/include/* \
411 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
415 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
416 # $(1)/usr/lib/Qt/plugins/
419 define Package/qt4/install
422 $(1)/usr/lib/Qt/plugins
425 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
429 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
430 # $(1)/usr/lib/Qt/plugins/codecs/
433 define Package/qt4-gui/install
436 $(1)/usr/lib/Qt/plugins
439 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
442 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
444 /usr/share/fonts/ttf-dejavu \
447 # we use the dejavue font package instead
449 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
450 # $(1)/usr/lib/fonts/
453 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
454 # $(1)/usr/lib/Qt/plugins/
457 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
458 # $(1)/usr/lib/Qt/plugins/
461 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
462 # $(1)/usr/lib/Qt/plugins/
465 define Package/qt4-demos/install
470 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
481 define Package/qt4-examples/install
486 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
497 define Package/qt4-network/install
502 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
506 define Package/qt4-sqlite/install
508 $(1)/usr/lib/Qt/plugins/sqldrivers
511 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
515 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
516 $(1)/usr/lib/Qt/plugins/sqldrivers/
519 define Package/qt4-mysql/install
521 $(1)/usr/lib/Qt/plugins/sqldrivers
524 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
528 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
529 $(1)/usr/lib/Qt/plugins/sqldrivers/
532 #define Package/qt4-multimedia/install
537 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
541 define Package/qt4-phonon/install
546 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
550 define Package/qt4-svg/install
553 $(1)/usr/lib/Qt/plugins
556 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
560 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
561 # $(1)/usr/lib/Qt/plugins/
564 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
565 # $(1)/usr/lib/Qt/plugins/
568 define Package/qt4-webkit/install
571 $(1)/usr/lib/Qt/plugins
574 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
578 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
579 # $(1)/usr/lib/Qt/plugins/
582 define Package/qt4-script/install
585 $(1)/usr/lib/Qt/plugins
588 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
592 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
593 # $(1)/usr/lib/Qt/plugins/
596 define Package/qt4-scripttools/install
601 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
605 define Package/qt4-dbus/install
610 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
614 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
618 define Package/qt4-qt3-support/install
621 $(1)/usr/lib/Qt/plugins
624 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
628 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
629 # $(1)/usr/lib/Qt/plugins/
632 define Package/qt4-declarative/install
637 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
641 define Package/qt4-xml/install
646 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
652 define Package/qt4-drivers-mouse-tpmousedriver/install
654 $(1)/usr/lib/Qt/plugins/mousedrivers
657 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqlinuxtpmousedriver.so \
658 $(1)/usr/lib/Qt/plugins/mousedrivers/
661 define Package/qt4-drivers-mouse-pcmousedriver/install
663 $(1)/usr/lib/Qt/plugins/mousedrivers
666 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqpcmousedriver.so \
667 $(1)/usr/lib/Qt/plugins/mousedrivers/
670 define Package/qt4-drivers-mouse-tslibmousedriver/install
672 $(1)/usr/lib/Qt/plugins/mousedrivers
675 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/mousedrivers/libqtslibmousedriver.so \
676 $(1)/usr/lib/Qt/plugins/mousedrivers/
680 define Package/qt4-drivers-gfx-directfb/install
682 $(1)/usr/lib/Qt/plugins/gfxdrivers
685 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqdirectfbscreen.so \
686 $(1)/usr/lib/Qt/plugins/gfxdrivers/
689 define Package/qt4-drivers-gfx-linuxfb/install
691 $(1)/usr/lib/Qt/plugins/gfxdrivers
694 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/gfxdrivers/libqscreenlinuxfb.so \
695 $(1)/usr/lib/Qt/plugins/gfxdrivers/
699 define Package/qt4-drivers-kbd-linuxinput/install
701 $(1)/usr/lib/Qt/plugins/kbddrivers
704 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/kbddrivers/libqlinuxinputkbddriver.so \
705 $(1)/usr/lib/Qt/plugins/kbddrivers/
711 $(eval $(call BuildPackage,qt4))
712 $(eval $(call BuildPackage,qt4-gui))
713 $(eval $(call BuildPackage,qt4-demos))
714 $(eval $(call BuildPackage,qt4-examples))
715 $(eval $(call BuildPackage,qt4-network))
716 $(eval $(call BuildPackage,qt4-sqlite))
717 $(eval $(call BuildPackage,qt4-mysql))
718 #$(eval $(call BuildPackage,qt4-multimedia))
719 #$(eval $(call BuildPackage,qt4-audio-backend))
720 $(eval $(call BuildPackage,qt4-phonon))
721 #$(eval $(call BuildPackage,qt4-phonon-backend))
722 $(eval $(call BuildPackage,qt4-svg))
723 $(eval $(call BuildPackage,qt4-webkit))
724 $(eval $(call BuildPackage,qt4-script))
725 $(eval $(call BuildPackage,qt4-scripttools))
726 #$(eval $(call BuildPackage,qt4-accessibility))
727 #$(eval $(call BuildPackage,qt4-javascript-jit))
728 #$(eval $(call BuildPackage,qt4-cups))
729 $(eval $(call BuildPackage,qt4-dbus))
730 #$(eval $(call BuildPackage,qt4-gtkstyle))
731 #$(eval $(call BuildPackage,qt4-glib))
732 $(eval $(call BuildPackage,qt4-qt3support))
733 $(eval $(call BuildPackage,qt4-declarative))
734 $(eval $(call BuildPackage,qt4-xml))
736 $(eval $(call BuildPackage,qt4-drivers-mouse-tpmousedriver))
737 $(eval $(call BuildPackage,qt4-drivers-mouse-pcmousedriver))
738 $(eval $(call BuildPackage,qt4-drivers-mouse-tslibmousedriver))
740 $(eval $(call BuildPackage,qt4-drivers-gfx-directfb))
741 $(eval $(call BuildPackage,qt4-drivers-gfx-linuxfb))
743 $(eval $(call BuildPackage,qt4-drivers-kbd-linuxinput))