comparison src/qt.mk @ 452:ade2c475c772

new package: qt (by Mark Brand)
author Volker Grabsch <vog@notjusthosting.com>
date Sat, 03 Oct 2009 21:11:16 +0200
parents
children 5ba19c633370
comparison
equal deleted inserted replaced
451:5b76f1312e7e 452:ade2c475c772
1 # Copyright (C) 2009 Mark Brand
2 # Volker Grabsch
3 #
4 # Permission is hereby granted, free of charge, to any person obtaining
5 # a copy of this software and associated documentation files (the
6 # "Software"), to deal in the Software without restriction, including
7 # without limitation the rights to use, copy, modify, merge, publish,
8 # distribute, sublicense, and/or sell copies of the Software, and to
9 # permit persons to whom the Software is furnished to do so, subject
10 # to the following conditions:
11 #
12 # The above copyright notice and this permission notice shall be
13 # included in all copies or substantial portions of the Software.
14 #
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 # Qt
24 PKG := qt
25 $(PKG)_IGNORE :=
26 $(PKG)_VERSION := 4.6.0-tp1
27 $(PKG)_CHECKSUM := 4394bea076279ea090549d3caa00cc1f5e33a22b
28 $(PKG)_SUBDIR := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION)
29 $(PKG)_FILE := $(PKG)-everywhere-opensource-src-$($(PKG)_VERSION).tar.gz
30 $(PKG)_WEBSITE := http://qt.nokia.com/
31 $(PKG)_URL := http://get.qt.nokia.com/qt/source/$($(PKG)_FILE)
32 $(PKG)_DEPS := gcc
33
34 define $(PKG)_UPDATE
35 wget -q -O- 'http://qt.gitorious.org/qt/qt/commits' | \
36 grep '<li><a href="/qt/qt/commit/' | \
37 $(SED) -n 's,.*<a[^>]*>v\([0-9][^>]*\)<.*,\1,p' | \
38 tail -1
39 endef
40
41 define $(PKG)_BUILD
42
43 # Note on patchfile qt-win32.patch
44 # A patchfile should have been applied already. Since we make a copy
45 # of the patched directory here, it is important that the changes
46 # in the patches do not break the native build.
47
48 # Bogus install bin directory for the DLLs
49 # Should stay empty because of -prefix-install
50 mkdir '$(1)'/bindirsink
51
52 # First configure a minimal native version of Qt
53 # for moc, rcc, uic and qmake
54 cp -a '$(1)' '$(1)'.native
55 cd '$(1)'.native && ./configure \
56 -opensource \
57 -confirm-license \
58 -prefix '$(PREFIX)/$(TARGET)' \
59 -prefix-install \
60 -bindir '$(1)'/bindirsink \
61 -fast \
62 -nomake demos \
63 -nomake examples \
64 -nomake libs \
65 -nomake tools \
66 -nomake docs \
67 -nomake translations
68
69 $(MAKE) -C '$(1)'.native -j $(JOBS) sub-tools-bootstrap
70 $(MAKE) -C '$(1)'.native -j $(JOBS) sub-moc
71 $(MAKE) -C '$(1)'.native -j $(JOBS) sub-rcc
72 $(MAKE) -C '$(1)'.native -j $(JOBS) sub-uic
73 $(MAKE) -C '$(1)'.native clean
74
75 # Trick the build system into using native tools
76 ln -s '$(1)'.native/bin/{moc,rcc,uic,qmake} '$(1)'/bin/
77
78 # Make sure we don't build the tools again
79 echo 'qmake:' >'$(1)'/qmake/Makefile.unix
80 for f in `ls -1 '$(1)'/src/tools`; \
81 do echo TEMPLATE = subdirs >'$(1)'/src/tools/"$$f"/"$$f".pro; \
82 done
83
84 # Trick the buildsystem into using win32 feature files:
85 mv '$(1)'/mkspecs/features/unix '$(1)'/mkspecs/features/unix.orig
86 ln -s win32 '$(1)'/mkspecs/features/unix
87
88 # Adjust the mkspec values that contain the TARGET platform prefix
89 $(SED) 's/HOSTPLATFORMPREFIX-/$(TARGET)-/g;' -i '$(1)'/mkspecs/win32-g++/qmake.conf
90 $(SED) 's^HOSTPLATFORMINCLUDE^$(PREFIX)/$(TARGET)/include^g;' -i '$(1)'/mkspecs/win32-g++/qmake.conf
91
92 # Make sure qmake doesn't use compilation paths meant for unix
93 find '$(1)'/src -name '*.pr[oi]' -exec \
94 $(SED) 's/\(^\|[^_/]\)unix/\1linux/g;' -i {} \;
95
96 # Make qmake use compilation paths meant for Windows
97 find '$(1)'/src -name '*.pr[oi]' -exec \
98 $(SED) 's/\(^\|[^_/]\)win32\([^-]\|$$\)/\1unix\2/g;' -i {} \;
99
100 # Fix-ups for files not found during configure
101 # Probably errors in QT 4.6 Technology Preview 1
102 ln -s ../WebKit.pri '$(1)'/src/3rdparty/webkit/WebKit
103
104 # Fix-ups for files not found during make
105 # Probably errors in QT 4.6 Technology Preview 1
106 mkdir '$(1)'/src/3rdparty/webkit/JavaScriptCore/generated/release
107 ln -s ../chartables.c '$(1)'/src/3rdparty/webkit/JavaScriptCore/generated/release/
108 ln -s ../Grammar.cpp '$(1)'/src/3rdparty/webkit/JavaScriptCore/generated/release/
109 mkdir '$(1)'/src/3rdparty/webkit/JavaScriptCore/generated/debug
110 ln -s ../chartables.c '$(1)'/src/3rdparty/webkit/JavaScriptCore/generated/debug/
111 ln -s ../Grammar.cpp '$(1)'/src/3rdparty/webkit/JavaScriptCore/generated/debug/
112
113 # Fix case of filename
114 $(SED) 's/QWidget\.h/qwidget.h/g;' -i '$(1)'/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp
115
116 # Configure Qt for MinGW target
117 cd '$(1)' && ./configure \
118 -opensource \
119 -confirm-license \
120 -xplatform win32-g++ \
121 -host-arch i386 \
122 -little-endian \
123 -exceptions \
124 -static \
125 -prefix '$(PREFIX)/$(TARGET)' \
126 -prefix-install \
127 -bindir '$(1)'/bindirsink \
128 -plugin-sql-odbc \
129 -plugin-sql-psql \
130 -plugin-sql-sqlite \
131 -plugin-sql-mysql \
132 -script \
133 -webkit \
134 -phonon \
135 -no-phonon-backend \
136 -accessibility \
137 -no-reduce-exports \
138 -no-rpath \
139 -make libs \
140 -nomake demos \
141 -nomake docs \
142 -nomake examples \
143 -continue
144
145 $(MAKE) -C '$(1)' -j '$(JOBS)'
146 $(TARGET)-ranlib '$(1)'/lib/*.a
147 $(MAKE) -C '$(1)' install
148
149 # install native tools manually
150 $(INSTALL) -m755 '$(1)'.native/bin/{moc,rcc,uic} '$(PREFIX)/$(TARGET)/bin/'
151 $(INSTALL) -m755 '$(1)'.native/bin/qmake '$(PREFIX)/bin/$(TARGET)-qmake'
152 endef