package libQtXml, add and fix dependencies
[openwrt/svn-archive/archive.git] / Xorg / lib / qt4 / Makefile
1 #
2 # Copyright (C) 2008-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # TODO:
9 # - handle software which uses qmake in a more generic way (move functionality / generic qmake-config into buildroot)
10 # - use generic qmake, moc, etc. executables since building them within the qt stack will get redundant and annyoing when other sw will need them as well
11 # - test/add X11/xcb support
12 # - handle plugins in a granular way (find out which packages should provide which plugins)
13
14 include $(TOPDIR)/rules.mk
15
16 PKG_NAME:=qt4
17 PKG_VERSION:=4.7.0-beta2
18 PKG_RELEASE:=1
19
20 PKG_SOURCE:=qt-everywhere-opensource-src-$(PKG_VERSION).tar.gz
21 PKG_SOURCE_URL:=ftp://ftp.qt.nokia.com/qt/source
22 PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-opensource-src-$(PKG_VERSION)
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/qt4/Default
27 SECTION:=xorg-framework
28 CATEGORY:=Xorg
29 SUBMENU:=framework
30 TITLE:=qt4
31 DEPENDS:=qt4
32 URL:=http://qt.nokia.com/
33 endef
34
35 define Package/qt4
36 $(call Package/qt4/Default)
37 DEPENDS:=@FEATURE_drawing-backend_DirectFB +FEATURE_drawing-backend_DirectFB:directfb +zlib +libstdcpp +libsqlite3 # require directfb for now, as other systems (libX11, xcb) are untested
38 endef
39
40 define Package/qt4-gui
41 $(call Package/qt4/Default)
42 #DEPENDS+=+FEATURE_drawing-backend_DirectFB:directfb +libpng +libtiff +libjpeg +libfreetype
43 DEPENDS+=+libpng +libtiff +libjpeg +libfreetype +qt4-network
44 TITLE+=(gui)
45 endef
46
47 define Package/qt4-demos
48 $(call Package/qt4/Default)
49 TITLE+=(demos)
50 DEPENDS+=+qt4-gui
51 endef
52
53 define Package/qt4-examples
54 $(call Package/qt4/Default)
55 TITLE+=(examples)
56 DEPENDS+=+qt4-gui
57 endef
58
59 define Package/qt4-network
60 $(call Package/qt4/Default)
61 TITLE+=(network)
62 endef
63
64 define Package/qt4-sqlite
65 $(call Package/qt4/Default)
66 TITLE+=(sqlite)
67 DEPENDS+=+libsqlite3
68 endef
69
70 define Package/qt4-mysql
71 $(call Package/qt4/Default)
72 TITLE+=(mysql)
73 DEPENDS+=+libmysqlclient
74 endef
75
76 #define Package/qt4-multimedia
77 # $(call Package/qt4/Default)
78 # TITLE+=(multimedia)
79 #endef
80
81 #define Package/qt4-audio-backend
82 # $(call Package/qt4/Default)
83 # TITLE+=(audio-backend)
84 #endef
85
86 define Package/qt4-phonon
87 $(call Package/qt4/Default)
88 TITLE+=(phonon)
89 DEPENDS+=+qt4-gui +qt4-xml +qt4-dbus +qt4-network
90 endef
91
92 #define Package/qt4-phonon-backend
93 # $(call Package/qt4/Default)
94 # TITLE+=(phonon-backend)
95 #endef
96
97 define Package/qt4-svg
98 $(call Package/qt4/Default)
99 TITLE+=(svg)
100 #DEPENDS+=+qt4-gui @BROKEN
101 DEPENDS+=+qt4-gui +qt4-network
102 endef
103
104 define Package/qt4-webkit
105 $(call Package/qt4/Default)
106 TITLE+=(webkit)
107 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
108 endef
109
110 define Package/qt4-script
111 $(call Package/qt4/Default)
112 TITLE+=(script)
113 DEPENDS+=@USE_GLIBC||@USE_EGLIBC||@UCLIBC_VERSION_0_9_32 # versions of uclibc prior 0.9.32 do not have nptl support
114 endef
115
116 define Package/qt4-scripttools
117 $(call Package/qt4/Default)
118 TITLE+=(scripttools)
119 DEPENDS+=+qt4-script +qt4-gui +qt4-network
120 endef
121
122 #define Package/qt4-accessibility
123 # $(call Package/qt4/Default)
124 # TITLE+=(accessibility)
125 #endef
126
127 #define Package/qt4-javascript-jit
128 # $(call Package/qt4/Default)
129 # TITLE+=(javascript-jit)
130 #endef
131
132 #define Package/qt4-cups
133 # $(call Package/qt4/Default)
134 # TITLE+=(cups)
135 #endef
136
137 define Package/qt4-dbus
138 $(call Package/qt4/Default)
139 TITLE+=(dbus)
140 DEPENDS+=+libdbus +qt4-xml
141 endef
142
143 #define Package/qt4-gtkstyle
144 # $(call Package/qt4/Default)
145 # TITLE+=(gtkstyle)
146 #endef
147
148 #define Package/qt4-glib
149 # $(call Package/qt4/Default)
150 # TITLE+=(glib)
151 #endef
152
153 define Package/qt4-qt3support
154 $(call Package/qt4/Default)
155 TITLE+=(qt3support)
156 DEPENDS+=+qt4-gui +qt4-xml
157 endef
158
159 define Package/qt4-declarative
160 $(call Package/qt4/Default)
161 TITLE+=(declarative)
162 DEPENDS+=+qt4-script +qt4-xml +qt4-gui +qt4-network
163 endef
164
165 define Package/qt4-xml
166 $(call Package/qt4/Default)
167 TITLE+=(xml)
168 endef
169
170 TARGET_CFLAGS+="-I$(STAGING_DIR)/usr/include/freetype2 -I$(PKG_BUILD_DIR)/include"
171
172 define Build/Configure
173 # NOTES:
174 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
175 # svg: always compile in svg-support, as once qt is built without, strange include errors occur when we're going to compile qt4-svg afterwards
176 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
177 # do not use fontconfig as it doesn't work anyway for qte
178 # 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
179 ( \
180 cd $(PKG_BUILD_DIR); \
181 QPATH='mkspecs/qws/linux-openwrt-g++' ; \
182 mkdir $$$$QPATH ; \
183 echo '#include "../../linux-g++/qplatformdefs.h"' \
184 >> $$$$QPATH/qplatformdefs.h ; \
185 echo 'include(../../common/g++.conf)' \
186 >> $$$$QPATH/qmake.conf ; \
187 echo 'include(../../common/linux.conf)' \
188 >> $$$$QPATH/qmake.conf ; \
189 echo 'include(../../common/qws.conf)' \
190 >> $$$$QPATH/qmake.conf ; \
191 echo "QMAKE_CC = $(TARGET_CC)" \
192 >> $$$$QPATH/qmake.conf ; \
193 echo "QMAKE_CXX = $(TARGET_CXX)" \
194 >> $$$$QPATH/qmake.conf ; \
195 echo "QMAKE_AR = $(TARGET_CROSS)ar cqs" \
196 >> $$$$QPATH/qmake.conf ; \
197 echo "QMAKE_OBJCOPY = $(TARGET_CROSS)objcopy" \
198 >> $$$$QPATH/qmake.conf ; \
199 echo "QMAKE_RANLIB = $(TARGET_CROSS)ranlib" \
200 >> $$$$QPATH/qmake.conf ; \
201 echo "QMAKE_CFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
202 >> $$$$QPATH/qmake.conf ; \
203 echo "QMAKE_CXXFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
204 >> $$$$QPATH/qmake.conf ; \
205 echo "QMAKE_LINK = $(TARGET_CXX)" \
206 >> $$$$QPATH/qmake.conf ; \
207 echo "QMAKE_LINK_SHLIB = $(TARGET_CXX)" \
208 >> $$$$QPATH/qmake.conf ; \
209 echo "QMAKE_LINK_C = $(TARGET_CC)" \
210 >> $$$$QPATH/qmake.conf ; \
211 echo "QMAKE_LINK_C_SHLIB = $(TARGET_CC)" \
212 >> $$$$QPATH/qmake.conf ; \
213 echo "QMAKE_LFLAGS = -L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \
214 >> $$$$QPATH/qmake.conf ; \
215 echo "QMAKE_STRIP = : " \
216 >> $$$$QPATH/qmake.conf ; \
217 echo "QMAKE_STRIPFLAGS_LIB = " \
218 >> $$$$QPATH/qmake.conf ; \
219 echo 'load(qt_config)' \
220 >> $$$$QPATH/qmake.conf ; \
221 echo yes | ./configure \
222 -prefix $(CONFIGURE_PREFIX) \
223 -bindir $(CONFIGURE_PREFIX)/bin \
224 -libdir $(CONFIGURE_PREFIX)/lib \
225 -datadir $(CONFIGURE_PREFIX)/share/Qt \
226 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
227 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
228 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
229 -sysconfdir /etc/Qt \
230 -no-rpath \
231 -force-pkg-config \
232 -nomake tools \
233 -$(if $(CONFIG_PACKAGE_qt4-demos),make demos,nomake demos) \
234 -$(if $(CONFIG_PACKAGE_qt4-examples),make examples,nomake examples) \
235 -nomake docs \
236 -nomake translations \
237 -embedded openwrt \
238 -platform linux-g++ \
239 -release \
240 -opensource \
241 -no-mmx \
242 -no-3dnow \
243 -no-sse \
244 -no-sse2 \
245 -system-zlib \
246 -system-libtiff \
247 -system-libpng \
248 -system-libjpeg \
249 -system-freetype \
250 -system-sqlite \
251 -plugin-sql-sqlite \
252 -plugin-sql-mysql \
253 -no-decoration-styled \
254 -no-decoration-windows \
255 -no-decoration-default \
256 -verbose \
257 -no-multimedia \
258 -no-audio-backend \
259 -phonon \
260 -no-phonon-backend \
261 -svg \
262 -webkit \
263 -no-javascript-jit \
264 -script \
265 -scripttools \
266 -no-accessibility \
267 -declarative \
268 -no-openssl \
269 -no-nis \
270 -no-cups \
271 -no-iconv \
272 -dbus \
273 -no-gtkstyle \
274 -no-nas-sound \
275 -no-opengl \
276 -no-openvg \
277 -no-sm \
278 -no-xshape \
279 -no-xsync \
280 -no-xinerama \
281 -no-xcursor \
282 -no-xfixes \
283 -no-xrandr \
284 -no-xrender \
285 -no-mitshm \
286 -no-fontconfig \
287 -no-xinput \
288 -no-xkb \
289 -no-glib \
290 -qt3support \
291 -qt-gfx-directfb \
292 -qt-gfx-linuxfb \
293 -no-gfx-multiscreen \
294 )
295 endef
296
297 define Build/Compile
298 # just passing <make install> results in not building 3rdparty/webkit/JavaScriptCore
299 $(MAKE) -C $(PKG_BUILD_DIR)
300 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
301 $(MAKE) -j5 -C $(PKG_BUILD_DIR) install
302 endef
303
304 define Build/InstallDev
305 $(INSTALL_DIR) \
306 $(STAGING_DIR_HOST)/bin
307
308 # host tools (qmake, moc, rcc, uic)
309 $(CP) \
310 $(PKG_INSTALL_DIR)/usr/bin/{qmake,moc,rcc,uic} \
311 $(STAGING_DIR_HOST)/bin/
312
313 $(INSTALL_DIR) \
314 $(1)/usr/share/mkspecs \
315 $(1)/usr/lib/pkgconfig \
316 $(1)/usr/lib \
317 $(1)/usr/include \
318 $(1)/usr/lib/Qt/plugins
319
320 $(CP) \
321 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
322 $(1)/usr/share/mkspecs/
323
324 $(INSTALL_DATA) \
325 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
326 $(1)/usr/lib/pkgconfig/
327
328 $(CP) \
329 $(PKG_INSTALL_DIR)/usr/include/* \
330 $(1)/usr/include/
331
332 $(CP) \
333 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
334 $(1)/usr/lib/
335
336 #$(CP) \
337 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
338 # $(1)/usr/lib/Qt/plugins/
339 endef
340
341 define Package/qt4/install
342 $(INSTALL_DIR) \
343 $(1)/usr/lib \
344 $(1)/usr/lib/Qt/plugins
345
346 $(CP) \
347 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
348 $(1)/usr/lib/
349
350 #$(CP) \
351 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
352 # $(1)/usr/lib/Qt/plugins/codecs/
353 endef
354
355 define Package/qt4-gui/install
356 $(INSTALL_DIR) \
357 $(1)/usr/lib \
358 $(1)/usr/lib/Qt/plugins
359
360 $(CP) \
361 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
362 $(1)/usr/lib/
363
364 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
365 ln -s \
366 /usr/share/fonts/ttf-dejavu \
367 $(1)/usr/lib/fonts
368
369 # we use the dejavue font package instead
370 #$(INSTALL_DATA) \
371 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
372 # $(1)/usr/lib/fonts/
373
374 #$(CP) \
375 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
376 # $(1)/usr/lib/Qt/plugins/
377
378 #$(CP) \
379 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
380 # $(1)/usr/lib/Qt/plugins/
381
382 #$(CP) \
383 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
384 # $(1)/usr/lib/Qt/plugins/
385 endef
386
387 define Package/qt4-demos/install
388 $(INSTALL_DIR) \
389 $(1)/usr/share/Qt
390
391 $(CP) \
392 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
393 $(1)/usr/share/Qt/
394
395 $(FIND) \
396 $(1) \
397 -name "*.cpp" -o \
398 -name "*.h" -o \
399 -name "*.pro" \
400 | $(XARGS) rm
401 endef
402
403 define Package/qt4-examples/install
404 $(INSTALL_DIR) \
405 $(1)/usr/share/Qt
406
407 $(CP) \
408 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
409 $(1)/usr/share/Qt/
410
411 $(FIND) \
412 $(1) \
413 -name "*.cpp" -o \
414 -name "*.h" -o \
415 -name "*.pro" \
416 | $(XARGS) rm
417 endef
418
419 define Package/qt4-network/install
420 $(INSTALL_DIR) \
421 $(1)/usr/lib
422
423 $(CP) \
424 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
425 $(1)/usr/lib/
426 endef
427
428 define Package/qt4-sqlite/install
429 $(INSTALL_DIR) \
430 $(1)/usr/lib/Qt/plugins/sqldrivers
431
432 $(CP) \
433 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
434 $(1)/usr/lib/
435
436 $(CP) \
437 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
438 $(1)/usr/lib/Qt/plugins/sqldrivers/
439 endef
440
441 define Package/qt4-mysql/install
442 $(INSTALL_DIR) \
443 $(1)/usr/lib/Qt/plugins/sqldrivers
444
445 $(CP) \
446 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
447 $(1)/usr/lib/
448
449 $(CP) \
450 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
451 $(1)/usr/lib/Qt/plugins/sqldrivers/
452 endef
453
454 #define Package/qt4-multimedia/install
455 # $(INSTALL_DIR) \
456 # $(1)/usr/bin
457 #
458 # $(CP) \
459 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
460 # $(1)/usr/bin/
461 #endef
462
463 define Package/qt4-phonon/install
464 $(INSTALL_DIR) \
465 $(1)/usr/lib
466
467 $(CP) \
468 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
469 $(1)/usr/lib/
470 endef
471
472 define Package/qt4-svg/install
473 $(INSTALL_DIR) \
474 $(1)/usr/lib \
475 $(1)/usr/lib/Qt/plugins
476
477 $(CP) \
478 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
479 $(1)/usr/lib/
480
481 #$(CP) \
482 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
483 # $(1)/usr/lib/Qt/plugins/
484
485 #$(CP) \
486 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
487 # $(1)/usr/lib/Qt/plugins/
488 endef
489
490 define Package/qt4-webkit/install
491 $(INSTALL_DIR) \
492 $(1)/usr/lib \
493 $(1)/usr/lib/Qt/plugins
494
495 $(CP) \
496 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
497 $(1)/usr/lib/
498
499 #$(CP) \
500 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
501 # $(1)/usr/lib/Qt/plugins/
502 endef
503
504 define Package/qt4-script/install
505 $(INSTALL_DIR) \
506 $(1)/usr/lib \
507 $(1)/usr/lib/Qt/plugins
508
509 $(CP) \
510 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
511 $(1)/usr/lib/
512
513 #$(CP) \
514 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
515 # $(1)/usr/lib/Qt/plugins/
516 endef
517
518 define Package/qt4-scripttools/install
519 $(INSTALL_DIR) \
520 $(1)/usr/lib
521
522 $(CP) \
523 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
524 $(1)/usr/lib/
525 endef
526
527 define Package/qt4-dbus/install
528 $(INSTALL_DIR) \
529 $(1)/usr/lib
530
531 $(CP) \
532 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
533 $(1)/usr/lib/
534
535 #$(CP) \
536 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
537 # $(1)/usr/bin/
538 endef
539
540 define Package/qt4-qt3-support/install
541 $(INSTALL_DIR) \
542 $(1)/usr/lib \
543 $(1)/usr/lib/Qt/plugins
544
545 $(CP) \
546 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
547 $(1)/usr/lib/
548
549 #$(CP) \
550 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
551 # $(1)/usr/lib/Qt/plugins/
552 endef
553
554 define Package/qt4-declarative/install
555 $(INSTALL_DIR) \
556 $(1)/usr/lib
557
558 $(CP) \
559 $(PKG_INSTALL_DIR)/usr/lib/libQtDeclarative.so* \
560 $(1)/usr/lib/
561 endef
562
563 define Package/qt4-xml/install
564 $(INSTALL_DIR) \
565 $(1)/usr/lib
566
567 $(CP) \
568 $(PKG_INSTALL_DIR)/usr/lib/libQtXml.so* \
569 $(1)/usr/lib/
570 endef
571
572
573 $(eval $(call BuildPackage,qt4))
574 $(eval $(call BuildPackage,qt4-gui))
575 $(eval $(call BuildPackage,qt4-demos))
576 $(eval $(call BuildPackage,qt4-examples))
577 $(eval $(call BuildPackage,qt4-network))
578 $(eval $(call BuildPackage,qt4-sqlite))
579 $(eval $(call BuildPackage,qt4-mysql))
580 #$(eval $(call BuildPackage,qt4-multimedia))
581 #$(eval $(call BuildPackage,qt4-audio-backend))
582 $(eval $(call BuildPackage,qt4-phonon))
583 #$(eval $(call BuildPackage,qt4-phonon-backend))
584 $(eval $(call BuildPackage,qt4-svg))
585 $(eval $(call BuildPackage,qt4-webkit))
586 $(eval $(call BuildPackage,qt4-script))
587 $(eval $(call BuildPackage,qt4-scripttools))
588 #$(eval $(call BuildPackage,qt4-accessibility))
589 #$(eval $(call BuildPackage,qt4-javascript-jit))
590 #$(eval $(call BuildPackage,qt4-cups))
591 $(eval $(call BuildPackage,qt4-dbus))
592 #$(eval $(call BuildPackage,qt4-gtkstyle))
593 #$(eval $(call BuildPackage,qt4-glib))
594 $(eval $(call BuildPackage,qt4-qt3support))
595 $(eval $(call BuildPackage,qt4-declarative))
596 $(eval $(call BuildPackage,qt4-xml))