-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
248 lines (222 loc) · 7.78 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#
# Copyright (C) 2013 Riccardo Ferrazzo <[email protected]>
# Copyright (C) 2017 Paweł Knioła <[email protected]>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=qt5
PKG_VERSION:=5.8
PKG_RELEASE:=0
PKG_MD5SUM:=a9f2494f75f966e2f22358ec367d8f41
PKG_SOURCE:=qt-everywhere-opensource-src-$(PKG_VERSION).$(PKG_RELEASE).tar.gz
PKG_SOURCE_URL:=http://download.qt-project.org/archive/qt/$(PKG_VERSION)/$(PKG_VERSION).$(PKG_RELEASE)/single
PKG_BUILD_DIR=$(BUILD_DIR)/qt-everywhere-opensource-src-$(PKG_VERSION).$(PKG_RELEASE)
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_BUILD_DEPENDS:=+libstdcpp
include $(INCLUDE_DIR)/package.mk
-include $(if $(DUMP),,./files/qmake.mk)
# not using sstrip here as this fucks up the .so's somehow
STRIP:=/bin/true
RSTRIP:= \
NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
STRIP="$(STRIP)" \
STRIP_KMOD="$(STRIP)" \
$(SCRIPT_DIR)/rstrip.sh
define Package/qt5/Default
SECTION:=libs
CATEGORY:=Libraries
SUBMENU:=Qt5
TITLE:=qt5
URL:=http://qt-project.org
DEPENDS:=+librt +zlib +libstdcpp +libpthread @!LINUX_2_6
endef
define Package/qt5-core
$(call Package/qt5/Default)
TITLE+=core
endef
define Package/qt5-concurrent
$(call Package/qt5/Default)
TITLE+=concurrent
DEPENDS+=+qt5-core
endef
define Package/qt5-network
$(call Package/qt5/Default)
TITLE+=network
DEPENDS+=+qt5-core
endef
define Package/qt5-widgets
$(call Package/qt5/Default)
TITLE+=widgets
DEPENDS+=+qt5-core +qt5-network
endef
define Package/qt5-sql
$(call Package/qt5/Default)
TITLE+=sql
DEPENDS+=+qt5-core
endef
define Package/qt5-xml
$(call Package/qt5/Default)
TITLE+=xml
DEPENDS+=+qt5-core
endef
define Package/qt5-xmlpatterns
$(call Package/qt5/Default)
TITLE+=xmlpatterns
DEPENDS+=+qt5-core +qt5-network
endef
define Package/qt5-test
$(call Package/qt5/Default)
TITLE+=test
DEPENDS+=+qt5-core
endef
define Build/Configure
$(INSTALL_DIR) $(PKG_BUILD_DIR)/qtbase/lib/fonts
$(INSTALL_DIR) $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++
$(CP) ./files/fonts/* $(PKG_BUILD_DIR)/qtbase/lib/fonts/
$(CP) ./files/qplatformdefs.h $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qplatformdefs.h
$(CP) ./files/qmake.conf $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qmake.conf
$(SED) 's@$$$$(TARGET_CROSS)@$(TARGET_CROSS)@g' $(PKG_BUILD_DIR)/qtbase/mkspecs/linux-openwrt-g++/qmake.conf
( cd $(PKG_BUILD_DIR) ; \
TARGET_CC="$(TARGET_CROSS)gcc" \
TARGET_CXX="$(TARGET_CROSS)g++" \
TARGET_AR="$(TARGET_CROSS)ar cqs" \
TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) -lpthread -lrt" \
TARGET_INCDIRS="$(TARGET_INCDIRS)" \
TARGET_LIBDIRS="$(TARGET_LIBDIRS) $(STAGING_DIR)/usr/lib/" \
CFLAGS= \
CXXFLAGS= \
LDFLAGS= \
./configure \
-prefix /usr \
-extprefix $(TOOLCHAIN_DIR) \
-sysroot $(TOOLCHAIN_DIR) \
-plugindir /usr/lib/Qt/plugins \
-xplatform linux-openwrt-g++ \
-opensource \
-confirm-license \
-no-iconv \
-no-pch \
-no-rpath \
-no-qml-debug \
-no-strip \
-no-cups \
-no-dbus \
-no-eglfs \
-no-kms \
-no-opengl \
-no-directfb \
-no-xcb \
-qt-zlib \
-qt-freetype \
-make libs \
-nomake examples \
-nomake tests \
-skip qtdeclarative \
-skip qtmultimedia \
-skip activeqt \
-skip qtdoc \
-skip qtconnectivity \
-skip wayland \
-skip qtscript \
-v \
)
endef
define Build/Compile
TARGET_CC="$(TARGET_CROSS)gcc" \
TARGET_CXX="$(TARGET_CROSS)g++" \
TARGET_AR="$(TARGET_CROSS)ar cqs" \
TARGET_OBJCOPY="$(TARGET_CROSS)objcopy" \
TARGET_RANLIB="$(TARGET_CROSS)ranlib" \
TARGET_CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
TARGET_CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS) -ldl -lpthread -lrt" \
TARGET_INCDIRS="$(TARGET_INCDIRS)" \
TARGET_LIBDIRS="$(TARGET_LIBDIRS) $(STAGING_DIR)/usr/lib/" \
STAGING_DIR="$(STAGING_DIR)" \
STAGING_DIR_HOST="$(STAGING_DIR)/../host" \
PKG_CONFIG_SYSROOT="$(STAGING_DIR)" \
$(MAKE) -C $(PKG_BUILD_DIR)
endef
define Build/InstallDev
$(MAKE) -C $(PKG_BUILD_DIR) install
$(CP) $(PKG_BUILD_DIR)/qtbase/bin/qmake $(TOOLCHAIN_DIR)/bin/
endef
define Package/qt5-core/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Core.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Core.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Core.la $(1)/usr/lib/
endef
define Package/qt5-concurrent/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Concurrent.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Concurrent.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Concurrent.la $(1)/usr/lib/
endef
define Package/qt5-network/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Network.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Network.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Network.la $(1)/usr/lib/
endef
define Package/qt5-widgets/install
$(INSTALL_DIR) $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/Qt/plugins/generic/
$(INSTALL_DIR) $(1)/usr/lib/Qt/plugins/platforms/
$(INSTALL_DIR) $(1)/usr/lib/Qt/plugins/imageformats/
$(INSTALL_DIR) $(1)/usr/lib/fonts/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Gui.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Gui.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Gui.la $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtsvg/lib/libQt5Svg.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtsvg/lib/libQt5Svg.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtsvg/lib/libQt5Svg.la $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Widgets.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Widgets.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Widgets.la $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/plugins/generic/*.so $(1)/usr/lib/Qt/plugins/generic/
$(CP) $(PKG_BUILD_DIR)/qtbase/plugins/platforms/*.so $(1)/usr/lib/Qt/plugins/platforms/
$(CP) $(PKG_BUILD_DIR)/qtbase/plugins/imageformats/*.so $(1)/usr/lib/Qt/plugins/imageformats/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/fonts/* $(1)/usr/lib/fonts/
endef
define Package/qt5-sql/install
$(INSTALL_DIR) $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/Qt/plugins/sqldrivers/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Sql.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Sql.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Sql.la $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/plugins/sqldrivers/*.so $(1)/usr/lib/Qt/plugins/sqldrivers/
endef
define Package/qt5-xml/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Xml.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Xml.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Xml.la $(1)/usr/lib/
endef
define Package/qt5-xmlpatterns/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtxmlpatterns/lib/libQt5XmlPatterns.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtxmlpatterns/lib/libQt5XmlPatterns.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtxmlpatterns/lib/libQt5XmlPatterns.la $(1)/usr/lib/
endef
define Package/qt5-test/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Test.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Test.prl $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/qtbase/lib/libQt5Test.la $(1)/usr/lib/
endef
$(eval $(call BuildPackage,qt5-core))
$(eval $(call BuildPackage,qt5-concurrent))
$(eval $(call BuildPackage,qt5-network))
$(eval $(call BuildPackage,qt5-widgets))
$(eval $(call BuildPackage,qt5-sql))
$(eval $(call BuildPackage,qt5-xml))
$(eval $(call BuildPackage,qt5-xmlpatterns))
$(eval $(call BuildPackage,qt5-test))