e6ee70242c84f410020b775195e4c6d53ddc529c
[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-beta1
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
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
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
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 # 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
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
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 endef
157
158 TARGET_CFLAGS+="-I$(STAGING_DIR)/usr/include/freetype2"
159
160 define Build/Configure
161 # demos/examples: which demos are going to be built depends on which features are going to to be compiled into qt
162 # svg: svg support always compiled in, as once qt is built without, strange include errors occur when we're going to compile qt4-svg afterwards
163 # linuxfb/directfb: since directfb is not much overhead compared to plain framebuffer, force using directfb
164 # do not use fontconfig as it doesn't work anyway for qte
165 ( \
166 cd $(PKG_BUILD_DIR); \
167 QPATH='mkspecs/qws/linux-openwrt-g++' ; \
168 mkdir $$$$QPATH ; \
169 echo '#include "../../linux-g++/qplatformdefs.h"' \
170 >> $$$$QPATH/qplatformdefs.h ; \
171 echo 'include(../../common/g++.conf)' \
172 >> $$$$QPATH/qmake.conf ; \
173 echo 'include(../../common/linux.conf)' \
174 >> $$$$QPATH/qmake.conf ; \
175 echo 'include(../../common/qws.conf)' \
176 >> $$$$QPATH/qmake.conf ; \
177 echo "QMAKE_CC = $(TARGET_CC)" \
178 >> $$$$QPATH/qmake.conf ; \
179 echo "QMAKE_CXX = $(TARGET_CXX)" \
180 >> $$$$QPATH/qmake.conf ; \
181 echo "QMAKE_AR = $(TARGET_CROSS)ar cqs" \
182 >> $$$$QPATH/qmake.conf ; \
183 echo "QMAKE_OBJCOPY = $(TARGET_CROSS)objcopy" \
184 >> $$$$QPATH/qmake.conf ; \
185 echo "QMAKE_RANLIB = $(TARGET_CROSS)ranlib" \
186 >> $$$$QPATH/qmake.conf ; \
187 echo "QMAKE_CFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
188 >> $$$$QPATH/qmake.conf ; \
189 echo "QMAKE_CXXFLAGS = $(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
190 >> $$$$QPATH/qmake.conf ; \
191 echo "QMAKE_LINK = $(TARGET_CXX)" \
192 >> $$$$QPATH/qmake.conf ; \
193 echo "QMAKE_LINK_SHLIB = $(TARGET_CXX)" \
194 >> $$$$QPATH/qmake.conf ; \
195 echo "QMAKE_LINK_C = $(TARGET_CC)" \
196 >> $$$$QPATH/qmake.conf ; \
197 echo "QMAKE_LINK_C_SHLIB = $(TARGET_CC)" \
198 >> $$$$QPATH/qmake.conf ; \
199 echo "QMAKE_LFLAGS = -L$(PKG_BUILD_DIR)/lib $(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib" \
200 >> $$$$QPATH/qmake.conf ; \
201 echo "QMAKE_STRIP = : " \
202 >> $$$$QPATH/qmake.conf ; \
203 echo "QMAKE_STRIPFLAGS_LIB = " \
204 >> $$$$QPATH/qmake.conf ; \
205 echo 'load(qt_config)' \
206 >> $$$$QPATH/qmake.conf ; \
207 echo yes | ./configure \
208 -prefix $(CONFIGURE_PREFIX) \
209 -bindir $(CONFIGURE_PREFIX)/bin \
210 -libdir $(CONFIGURE_PREFIX)/lib \
211 -datadir $(CONFIGURE_PREFIX)/share/Qt \
212 -plugindir $(CONFIGURE_PREFIX)/lib/Qt/plugins \
213 -demosdir $(CONFIGURE_PREFIX)/share/Qt/demos \
214 -examplesdir $(CONFIGURE_PREFIX)/share/Qt/examples \
215 -sysconfdir /etc/Qt \
216 -no-rpath \
217 -force-pkg-config \
218 -nomake tools \
219 -$(if $(CONFIG_PACKAGE_qt4-demos),make demos,nomake demos) \
220 -$(if $(CONFIG_PACKAGE_qt4-examples),make examples,nomake examples) \
221 -nomake docs \
222 -nomake translations \
223 -embedded openwrt \
224 -platform linux-g++ \
225 -release \
226 -opensource \
227 -no-mmx \
228 -no-3dnow \
229 -no-sse \
230 -no-sse2 \
231 -system-zlib \
232 -system-libtiff \
233 -system-libpng \
234 -system-libjpeg \
235 -system-freetype \
236 -system-sqlite \
237 $(if $(CONFIG_PACKAGE_qt4-sqlite),-plugin-sql-sqlite,) \
238 $(if $(CONFIG_PACKAGE_qt4-mysql),-plugin-sql-mysql,) \
239 -no-decoration-styled \
240 -no-decoration-windows \
241 -no-decoration-default \
242 -verbose \
243 -$(if $(CONFIG_PACKAGE_qt4-multimedia),multimedia,no-multimedia) \
244 -$(if $(CONFIG_PACKAGE_qt4-audio-backend),audio-backend,no-audio-backend) \
245 -no-mediaservices \
246 -no-media-backend \
247 -$(if $(CONFIG_PACKAGE_qt4-phonon),phonon,no-phonon) \
248 -$(if $(CONFIG_PACKAGE_qt4-phonon-backend),phonon-backend,no-phonon-backend) \
249 -svg \
250 -$(if $(CONFIG_PACKAGE_qt4-webkit),webkit,no-webkit) \
251 -$(if $(CONFIG_PACKAGE_qt4-javascript-jit),javascript-jit,no-javascript-jit) \
252 -$(if $(CONFIG_PACKAGE_qt4-script),script,no-script) \
253 -$(if $(CONFIG_PACKAGE_qt4-scripttools),scripttools,no-scripttools) \
254 -$(if $(CONFIG_PACKAGE_qt4-accessibility),accessibility,no-accessibility) \
255 -no-declarative \
256 -no-openssl \
257 -no-nis \
258 $(if $(CONFIG_PACKAGE_qt4-gui),,-no-gui) \
259 -$(if $(CONFIG_PACKAGE_qt4-cups),cups,no-cups) \
260 -no-iconv \
261 -$(if $(CONFIG_PACKAGE_qt4-dbus),dbus,no-dbus) \
262 -$(if $(CONFIG_PACKAGE_qt4-gtkstyle),gtkstyle,no-gtkstyle) \
263 -no-nas-sound \
264 -no-opengl \
265 -no-openvg \
266 -no-sm \
267 -no-xshape \
268 -no-xsync \
269 -no-xinerama \
270 -no-xcursor \
271 -no-xfixes \
272 -no-xrandr \
273 -no-xrender \
274 -no-mitshm \
275 -no-fontconfig \
276 -no-xinput \
277 -no-xkb \
278 -$(if $(CONFIG_PACKAGE_qt4-glib),glib,no-glib) \
279 -$(if $(CONFIG_PACKAGE_qt4-qt3support),qt3support,no-qt3support) \
280 -$(if $(CONFIG_FEATURE_drawing-backend_DirectFB),qt-gfx-directfb,) \
281 -qt-gfx-linuxfb \
282 -no-gfx-multiscreen \
283 )
284 endef
285
286 define Build/Compile
287 INSTALL_ROOT=$(PKG_INSTALL_DIR) \
288 $(MAKE) -C $(PKG_BUILD_DIR) install
289 endef
290
291 define Build/InstallDev
292 $(INSTALL_DIR) \
293 $(1)/usr/share/mkspecs \
294 $(1)/usr/lib/pkgconfig \
295 $(1)/usr/lib \
296 $(1)/usr/include \
297 $(1)/usr/lib/Qt/plugins
298
299 $(CP) \
300 $(PKG_INSTALL_DIR)/usr/share/Qt/mkspecs/* \
301 $(1)/usr/share/mkspecs/
302
303 $(INSTALL_DATA) \
304 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
305 $(1)/usr/lib/pkgconfig/
306
307 $(CP) \
308 $(PKG_INSTALL_DIR)/usr/include/* \
309 $(1)/usr/include/
310
311 $(CP) \
312 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
313 $(1)/usr/lib/
314
315 #$(CP) \
316 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/* \
317 # $(1)/usr/lib/Qt/plugins/
318 endef
319
320 define Package/qt4/install
321 $(INSTALL_DIR) \
322 $(1)/usr/lib \
323 $(1)/usr/lib/Qt/plugins
324
325 $(CP) \
326 $(PKG_INSTALL_DIR)/usr/lib/libQtCore.so* \
327 $(1)/usr/lib/
328
329 #$(CP) \
330 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/codecs/*.so \
331 # $(1)/usr/lib/Qt/plugins/codecs/
332 endef
333
334 define Package/qt4-gui/install
335 $(INSTALL_DIR) \
336 $(1)/usr/lib \
337 $(1)/usr/lib/Qt/plugins
338
339 $(CP) \
340 $(PKG_INSTALL_DIR)/usr/lib/libQtGui.so* \
341 $(1)/usr/lib/
342
343 #HACK: Qt4 requires having truetype fonts stored in /usr/lib/fonts - no subdirectories allowed, so use the dejavue set by default
344 ln -s \
345 /usr/share/fonts/ttf-dejavu \
346 $(1)/usr/lib/fonts
347
348 # we use the dejavue font package instead
349 #$(INSTALL_DATA) \
350 # $(PKG_INSTALL_DIR)/usr/lib/fonts/*.ttf \
351 # $(1)/usr/lib/fonts/
352
353 #$(CP) \
354 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
355 # $(1)/usr/lib/Qt/plugins/
356
357 #$(CP) \
358 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
359 # $(1)/usr/lib/Qt/plugins/
360
361 #$(CP) \
362 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/inputmethods \
363 # $(1)/usr/lib/Qt/plugins/
364 endef
365
366 define Package/qt4-demos/install
367 $(INSTALL_DIR) \
368 $(1)/usr/share/Qt
369
370 $(CP) \
371 $(PKG_INSTALL_DIR)/usr/share/Qt/demos \
372 $(1)/usr/share/Qt/
373
374 $(FIND) \
375 $(1) \
376 -name "*.cpp" -o \
377 -name "*.h" -o \
378 -name "*.pro" \
379 | $(XARGS) rm
380 endef
381
382 define Package/qt4-examples/install
383 $(INSTALL_DIR) \
384 $(1)/usr/share/Qt
385
386 $(CP) \
387 $(PKG_INSTALL_DIR)/usr/share/Qt/examples \
388 $(1)/usr/share/Qt/
389
390 $(FIND) \
391 $(1) \
392 -name "*.cpp" -o \
393 -name "*.h" -o \
394 -name "*.pro" \
395 | $(XARGS) rm
396 endef
397
398 define Package/qt4-network/install
399 $(INSTALL_DIR) \
400 $(1)/usr/lib
401
402 $(CP) \
403 $(PKG_INSTALL_DIR)/usr/lib/libQtNetwork.so* \
404 $(1)/usr/lib/
405 endef
406
407 define Package/qt4-sqlite/install
408 $(INSTALL_DIR) \
409 $(1)/usr/lib/Qt/plugins/sqldrivers
410
411 $(CP) \
412 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
413 $(1)/usr/lib/
414
415 $(CP) \
416 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlite.so \
417 $(1)/usr/lib/Qt/plugins/sqldrivers/
418 endef
419
420 define Package/qt4-mysql/install
421 $(INSTALL_DIR) \
422 $(1)/usr/lib/Qt/plugins/sqldrivers
423
424 $(CP) \
425 $(PKG_INSTALL_DIR)/usr/lib/libQtSql.so* \
426 $(1)/usr/lib/
427
428 $(CP) \
429 $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/sqldrivers/libqsqlmysql.so \
430 $(1)/usr/lib/Qt/plugins/sqldrivers/
431 endef
432
433 #define Package/qt4-multimedia/install
434 # $(INSTALL_DIR) \
435 # $(1)/usr/bin
436 #
437 # $(CP) \
438 # $(PKG_INSTALL_DIR)/usr/bin/examples/* \
439 # $(1)/usr/bin/
440 #endef
441
442 define Package/qt4-phonon/install
443 $(INSTALL_DIR) \
444 $(1)/usr/lib
445
446 $(CP) \
447 $(PKG_INSTALL_DIR)/usr/lib/libphonon.so* \
448 $(1)/usr/lib/
449 endef
450
451 define Package/qt4-svg/install
452 $(INSTALL_DIR) \
453 $(1)/usr/lib \
454 $(1)/usr/lib/Qt/plugins
455
456 $(CP) \
457 $(PKG_INSTALL_DIR)/usr/lib/libQtSvg.so* \
458 $(1)/usr/lib/
459
460 #$(CP) \
461 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/iconengines \
462 # $(1)/usr/lib/Qt/plugins/
463
464 #$(CP) \
465 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/imageformats \
466 # $(1)/usr/lib/Qt/plugins/
467 endef
468
469 define Package/qt4-webkit/install
470 $(INSTALL_DIR) \
471 $(1)/usr/lib \
472 $(1)/usr/lib/Qt/plugins
473
474 $(CP) \
475 $(PKG_INSTALL_DIR)/usr/lib/libQtWebKit.so* \
476 $(1)/usr/lib/
477
478 #$(CP) \
479 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/designer \
480 # $(1)/usr/lib/Qt/plugins/
481 endef
482
483 define Package/qt4-script/install
484 $(INSTALL_DIR) \
485 $(1)/usr/lib \
486 $(1)/usr/lib/Qt/plugins
487
488 $(CP) \
489 $(PKG_INSTALL_DIR)/usr/lib/libQtScript.so* \
490 $(1)/usr/lib/
491
492 #$(CP) \
493 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/script \
494 # $(1)/usr/lib/Qt/plugins/
495 endef
496
497 define Package/qt4-scripttools/install
498 $(INSTALL_DIR) \
499 $(1)/usr/lib
500
501 $(CP) \
502 $(PKG_INSTALL_DIR)/usr/lib/libQtScriptTools.so* \
503 $(1)/usr/lib/
504 endef
505
506 define Package/qt4-dbus/install
507 $(INSTALL_DIR) \
508 $(1)/usr/lib
509
510 $(CP) \
511 $(PKG_INSTALL_DIR)/usr/lib/libQtDBus.so* \
512 $(1)/usr/lib/
513
514 #$(CP) \
515 # $(PKG_INSTALL_DIR)/usr/bin/qdbus \
516 # $(1)/usr/bin/
517 endef
518
519 define Package/qt4-qt3-support/install
520 $(INSTALL_DIR) \
521 $(1)/usr/lib \
522 $(1)/usr/lib/Qt/plugins
523
524 $(CP) \
525 $(PKG_INSTALL_DIR)/usr/lib/libQt3Support.so* \
526 $(1)/usr/lib/
527
528 #$(CP) \
529 # $(PKG_INSTALL_DIR)/usr/lib/Qt/plugins/accessible \
530 # $(1)/usr/lib/Qt/plugins/
531 endef
532
533 $(eval $(call BuildPackage,qt4))
534 $(eval $(call BuildPackage,qt4-gui))
535 $(eval $(call BuildPackage,qt4-demos))
536 $(eval $(call BuildPackage,qt4-examples))
537 $(eval $(call BuildPackage,qt4-network))
538 $(eval $(call BuildPackage,qt4-sqlite))
539 $(eval $(call BuildPackage,qt4-mysql))
540 #$(eval $(call BuildPackage,qt4-multimedia))
541 #$(eval $(call BuildPackage,qt4-audio-backend))
542 $(eval $(call BuildPackage,qt4-phonon))
543 #$(eval $(call BuildPackage,qt4-phonon-backend))
544 $(eval $(call BuildPackage,qt4-svg))
545 $(eval $(call BuildPackage,qt4-webkit))
546 $(eval $(call BuildPackage,qt4-script))
547 $(eval $(call BuildPackage,qt4-scripttools))
548 #$(eval $(call BuildPackage,qt4-accessibility))
549 #$(eval $(call BuildPackage,qt4-javascript-jit))
550 #$(eval $(call BuildPackage,qt4-cups))
551 $(eval $(call BuildPackage,qt4-dbus))
552 #$(eval $(call BuildPackage,qt4-gtkstyle))
553 #$(eval $(call BuildPackage,qt4-glib))
554 $(eval $(call BuildPackage,qt4-qt3support))