make qt5base a build dependency for qt5base/host
[feed/video.git] / frameworks / qt5base / Makefile
index 7b6abdf53cc617bb38ef0abd8fe0d735050f375e..3fe52ca939695f7ef3ca2ad699e5a391ce2ab8a6 100644 (file)
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=qt5base
-PKG_VERSION:=5.7.0
+PKG_VERSION:=5.8.0
 PKG_RELEASE:=1
-PKG_MD5SUM:=184f9460b40752d71b15b827260580c2
+PKG_HASH:=c17111ae02a44dc7be1ec2cf979a47ee9e58edf4904041a525c21f4fa53fc005
 
 PKG_SYS_NAME:=qtbase-opensource-src-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_SYS_NAME).tar.xz
 PKG_SOURCE_URL:=http://download.qt-project.org/official_releases/qt/$(basename $(PKG_VERSION))/$(PKG_VERSION)/submodules
 
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_SYS_NAME)
+HOST_BUILD_DIR=$(BUILD_DIR)/host/$(PKG_SYS_NAME)
 PKG_BUILD_PARALLEL:=1
+HOST_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=librpc
 PKG_INSTALL:=1
 PKG_USE_MIPS16:=0
+# Yes, the host build depends on the target build. This is not a mistake!
+# The target build provides the (target specific) qmake.mk file which
+# is also used for host builds.
+# Host projects depend on qt5base/host which however don't build
+# if qt5base didn't install the qmake.mk file before.
+# Benefit of the target build providing qmake.mk instead of the host build
+# is that the host build really only needs to be built, if there're targets
+# which actually depend on it. At the time of this writing, only qt5tools
+# makes use of the host build.
+HOST_BUILD_DEPENDS:=qt5base
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/nls.mk
 include ./files/qmake.mk
 
@@ -64,16 +77,15 @@ define Package/qt5base/Default
   CATEGORY:=Video
   SUBMENU:=Frameworks and Toolkits
   TITLE:=Qt5base
-  DEPENDS+=qt5base
   URL:=http://qt.io
   MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
 endef
 
-define Package/qt5base
-  $(call Package/qt5base/Default)
-  DEPENDS:=
-  MENU:=1
-endef
+define Package/qt5base
+  $(call Package/qt5base/Default)
+  DEPENDS:=
+  MENU:=1
+endef
 
 define Package/qt5base-concurrent
   $(call Package/qt5base/Default)
@@ -229,6 +241,14 @@ define Package/qt5base-plugin-platforms-offscreen
   DEPENDS+=+qt5base-core +qt5base-gui +libfreetype +fontconfig
 endef
 
+define Package/qt5base-plugin-platforms-vnc
+  $(call Package/qt5base/Default)
+  TITLE+=platform vnc (plugin)
+  DEPENDS+=+qt5base-core +qt5base-gui +qt5base-network +libfreetype +fontconfig
+endef
+
+
+
 ###### sql
 
 #define Package/qt5base-plugin-sqldrivers-sqlite
@@ -259,9 +279,9 @@ define Build/Prepare
                $(PKG_BUILD_DIR)/mkspecs/
 endef
 
-TARGET_CFLAGS += \
-         -I$(STAGING_DIR)/usr/include/freetype2 \
-         -I$(STAGING_DIR)/usr/include/libdrm
+TARGET_CFLAGS += \
+#        -I$(STAGING_DIR)/usr/include/freetype2 \
+#        -I$(STAGING_DIR)/usr/include/libdrm
 
 define Build/Configure
        # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
@@ -276,6 +296,7 @@ define Build/Configure
                        -prefix $(QT_INSTALL_PREFIX) \
                        -extprefix $(QT_EXTPREFIX) \
                        -hostprefix $(QT_HOST_PREFIX) \
+                       -hostdatadir $(QT_HOST_PREFIX)/share \
                        -no-gcc-sysroot \
                        -bindir $(QT_INSTALL_BINS) \
                        -headerdir $(QT_INSTALL_HEADERS) \
@@ -294,25 +315,15 @@ define Build/Configure
                        -hostbindir $(QT_HOST_BINS) \
                        -hostlibdir $(QT_HOST_LIBS) \
                        -hostdatadir $(QT_HOST_DATA) \
-                       -v \
-                       -release \
-                       -no-optimized-tools \
+                       -verbose \
                        -opensource \
                        -confirm-license \
+                       -release \
+                       -no-optimized-tools \
+                       -no-strip \
                        -shared \
-                       -largefile \
-                       -accessibility \
-                       -no-sql-db2 \
-                       -no-sql-ibase \
-                       -no-sql-mysql \
-                       -no-sql-oci \
-                       -no-sql-odbc \
-                       -no-sql-psql \
-                       -no-sql-sqlite \
-                       -no-sql-sqlite2 \
-                       -no-sql-tds \
-                       -system-sqlite \
-                       -no-qml-debug \
+                       -no-framework \
+                       -xplatform linux-openwrt-g++ \
                        -no-sse3 \
                        -no-ssse3 \
                        -no-sse4.1 \
@@ -322,61 +333,157 @@ define Build/Configure
                        -no-avx512 \
                        $(if $(findstring -mdsp,$(TARGET_CFLAGS)),,-no-mips_dsp) \
                        $(if $(findstring -mdspr2,$(TARGET_CFLAGS)),,-no-mips_dspr2) \
-                       -no-mips_dspr2 \
-                       -force-pkg-config \
-                       -system-zlib \
-                       -no-mtdev \
-                       -no-journald \
-                       -syslog \
-                       -no-gif \
-                       $(if $(CONFIG_PACKAGE_qt5base-gui),-system-libpng,-no-libpng) \
-                       $(if $(CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg),-system-libjpeg,-no-libjpeg) \
-                       -system-doubleconversion \
-                       -system-freetype \
-                       -no-harfbuzz \
-                       $(if $(CONFIG_PACKAGE_qt5base-network),-openssl-linked,-no-openssl) \
-                       -no-libproxy \
-                       -system-pcre \
-                       -system-xcb \
-                       -system-xkbcommon \
-                       -no-xinput2 \
-                       -no-xcb-xlib \
-                       -no-glib \
-                       -no-pulseaudio \
-                       -no-alsa \
-                       -no-gtk \
+                       -no-reduce-exports \
+                       -no-reduce-relocations \
+                       -no-pch \
+                       -no-use-gold-linker \
+                       -no-warnings-are-errors \
+                       -pkg-config \
                        -no-optimized-qmake \
                        -nomake tools \
                        -make examples \
+                       $(if $(CONFIG_PACKAGE_qt5base-examples),-compile-examples,-no-compile-examples) \
                        $(if $(CONFIG_PACKAGE_qt5base-examples),-make examples,-nomake examples) \
                        $(if $(CONFIG_PACKAGE_qt5base-gui),-gui,-no-gui) \
                        $(if $(CONFIG_PACKAGE_qt5base-widgets),-widgets,-no-widgets) \
-                       -no-nis \
+                       -no-dbus \
+                       -accessibility \
+                       -no-qml-debug \
+                       -system-doubleconversion \
+                       -no-glib \
+                       -eventfd \
+                       -no-inotify \
+                       $(if $(CONFIG_BUILD_NLS),-no-iconv,-no-iconv) \
+                       -no-icu \
+                       -system-pcre \
+                       -system-zlib \
+                       -no-journald \
+                       -no-syslog \
+                       -ssl \
+                       $(if $(CONFIG_PACKAGE_qt5base-network),-openssl-linked,-no-openssl) \
+                       -system-proxies \
                        -no-cups \
-                       $(if $(CONFIG_BUILD_NLS),-iconv,-no-iconv) \
+                       -fontconfig \
+                       -system-freetype \
+                       -no-harfbuzz \
+                       -no-gtk \
+                       -opengl \
+                       -no-xcb-xlib \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-minimal),,-qpa minimal) \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb),,-qpa linuxfb) \
+                       -system-xcb \
+                       -no-directfb \
+                       -no-eglfs \
+                       -no-gbm \
+                       -no-kms \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb),-linuxfb,-no-linuxfb) \
+                       -no-mirclient \
+                       -no-xcb \
                        -evdev \
+                       -no-libinput \
+                       -no-mtdev \
                        -no-tslib \
-                       -no-icu \
-                       -fontconfig \
+                       -no-xinput2 \
+                       -no-xkbcommon-x11 \
+                       -no-xkbcommon-evdev \
+                       -no-gif \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-imageformats-ico),-ico,-no-ico) \
+                       $(if $(CONFIG_PACKAGE_qt5base-gui),-system-libpng,-no-libpng) \
+                       $(if $(CONFIG_PACKAGE_qt5base-plugin-imageformats-jpeg),-system-libjpeg,-no-libjpeg) \
+                       -no-sql-db2 \
+                       -no-sql-ibase \
+                       -no-sql-mysql \
+                       -no-sql-oci \
+                       -no-sql-odbc \
+                       -no-sql-psql \
+                       -no-sql-sqlite \
+                       -no-sql-sqlite2 \
+                       -no-sql-tds \
+                       -no-libproxy \
+                       -system-xkbcommon \
+       )
+endef
+
+
+define Host/Configure
+       # CROSS/TARGET_* need to be passed to configure, in order to use cross-compiling tools to check for requirements.
+       # Usually used variables such as CC/CXX/CFLAGS/CXXFLAGS/LDFLAGS would be used for compilation of host tools (qmake, moc, etc.),
+       # hence we use the TARGET_* nomenclature.
+       ( cd $(HOST_BUILD_DIR) ; \
+               TARGET_CFLAGS="$(HOST_CFLAGS)" \
+               TARGET_CXXFLAGS="$(HOST_CFLAGS) $(HOST_CXXFLAGS)" \
+               TARGET_LDFLAGS="$(HOST_LDFLAGS)" \
+               ./configure \
+                       -prefix $(STAGING_DIR_HOST) \
+                       -hostprefix $(STAGING_DIR_HOST) \
+                       -hostdatadir $(STAGING_DIR_HOST)/share \
+                       -datadir $(STAGING_DIR_HOST)/share \
+                       -archdatadir $(STAGING_DIR_HOST)/lib \
+                       -no-gcc-sysroot \
+                       -verbose \
+                       -opensource \
+                       -confirm-license \
+                       -release \
+                       -no-optimized-tools \
                        -no-strip \
-                       -no-pch \
+                       -shared \
+                       -no-framework \
+                       -nomake tools \
+                       -nomake examples \
+                       -no-compile-examples \
+                       -gui \
+                       -no-widgets \
                        -no-dbus \
-                       -no-reduce-relocations \
-                       -no-use-gold-linker \
+                       -no-accessibility \
+                       -no-qml-debug \
+                       -qt-doubleconversion \
+                       -no-glib \
+                       -no-eventfd \
+                       -no-inotify \
+                       -no-icu \
+                       -qt-pcre \
+                       -qt-zlib \
+                       -no-journald \
+                       -no-syslog \
+                       -no-ssl \
+                       -no-openssl \
+                       -no-cups \
+                       -no-fontconfig \
+                       -qt-freetype \
+                       -no-harfbuzz \
+                       -no-gtk \
+                       -no-opengl \
+                       -no-xcb-xlib \
                        -no-xcb \
+                       -no-directfb \
                        -no-eglfs \
-                       -no-kms \
                        -no-gbm \
-                       -no-directfb \
-                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-linuxfb),-linuxfb,-no-linuxfb) \
+                       -no-kms \
+                       -no-linuxfb \
                        -no-mirclient \
-                       -opengl \
-                       $(if $(CONFIG_PACKAGE_qt5base-plugin-platforms-minimal),,-qpa minimal) \
+                       -no-xcb \
+                       -evdev \
                        -no-libinput \
-                       -no-gstreamer \
-                       -system-proxies \
-                       -no-warnings-are-errors \
-                       -xplatform linux-openwrt-g++ \
+                       -no-mtdev \
+                       -no-tslib \
+                       -no-xinput2 \
+                       -no-xkbcommon-x11 \
+                       -no-xkbcommon-evdev \
+                       -no-gif \
+                       -no-ico \
+                       -qt-libpng \
+                       -no-libjpeg \
+                       -no-sql-db2 \
+                       -no-sql-ibase \
+                       -no-sql-mysql \
+                       -no-sql-oci \
+                       -no-sql-odbc \
+                       -no-sql-psql \
+                       -no-sql-sqlite \
+                       -no-sql-sqlite2 \
+                       -no-sql-tds \
+                       -no-libproxy \
+                       -no-xkbcommon \
        )
 endef
 
@@ -393,6 +500,32 @@ define Build/InstallDev
        $(call Build/Install/Libs,$(1),*)
 endef
 
+define Host/Install
+       $(call Host/Install/Default)
+
+       $(INSTALL_DIR) \
+         $(STAGING_DIR_HOST)/bin \
+         $(STAGING_DIR_HOST)/lib \
+         $(STAGING_DIR_HOST)/include \
+         $(STAGING_DIR_HOST)/share
+
+       $(CP) \
+         $(HOST_INSTALL_DIR)/lib/* \
+         $(STAGING_DIR_HOST)/lib/
+
+       $(CP) \
+         $(HOST_INSTALL_DIR)/include/* \
+         $(STAGING_DIR_HOST)/include/
+
+       $(CP) \
+         $(HOST_INSTALL_DIR)/share/* \
+         $(STAGING_DIR_HOST)/share/
+
+       $(CP) \
+         $(HOST_INSTALL_DIR)/bin/qmake \
+         $(STAGING_DIR_HOST)/bin/qmake_host
+endef
+
 define Package/qt5base-concurrent/install
        $(call Build/Install/Libs,$(1),libQt5Concurrent)
 endef
@@ -469,6 +602,10 @@ define Package/qt5base-plugin-platforms-linuxfb/install
        $(call Build/Install/Plugins,$(1),platforms,libqlinuxfb)
 endef
 
+define Package/qt5base-plugin-platforms-vnc/install
+       $(call Build/Install/Plugins,$(1),platforms,libqvnc)
+endef
+
 #define Package/qt5base-plugin-platforms-eglfs/install
 #      $(call Build/Install/Plugins,$(1),platforms,libqeglfs)
 #endef
@@ -493,7 +630,7 @@ define Package/qt5base-examples/install
        $(call Build/Install/Examples,$(1))
 endef
 
-$(eval $(call BuildPackage,qt5base))
+$(eval $(call BuildPackage,qt5base))
 $(eval $(call BuildPackage,qt5base-concurrent))
 $(eval $(call BuildPackage,qt5base-core))
 $(eval $(call BuildPackage,qt5base-gui))
@@ -517,5 +654,7 @@ $(eval $(call BuildPackage,qt5base-plugin-platforms-linuxfb))
 #$(eval $(call BuildPackage,qt5base-plugin-platforms-minimalegl))
 $(eval $(call BuildPackage,qt5base-plugin-platforms-minimal))
 $(eval $(call BuildPackage,qt5base-plugin-platforms-offscreen))
+$(eval $(call BuildPackage,qt5base-plugin-platforms-vnc))
 #$(eval $(call BuildPackage,qt5base-plugin-sqldrivers-sqlite))
 $(eval $(call BuildPackage,qt5base-examples))
+$(eval $(call HostBuild))