qt: playlist: use item title if available
[vlc.git] / contrib / src / qt / rules.mak
blob7977cef014f1145d317f9acf5a47efa2be47b3a8
1 # Qt
3 QT_VERSION_MAJOR := 5.15
4 QT_VERSION := $(QT_VERSION_MAJOR).1
5 # Insert potential -betaX suffix here:
6 QT_VERSION_FULL := $(QT_VERSION)
7 QT_URL := https://download.qt.io/official_releases/qt/$(QT_VERSION_MAJOR)/$(QT_VERSION_FULL)/submodules/qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz
9 ifdef HAVE_MACOSX
10 #PKGS += qt
11 endif
12 ifdef HAVE_WIN32
13 PKGS += qt
14 DEPS_qt = fxc2 $(DEPS_fxc2)
15 ifdef HAVE_CROSS_COMPILE
16 DEPS_qt += wine-headers
17 endif
18 endif
20 ifeq ($(call need_pkg,"Qt5Core >= 5.11 Qt5Gui Qt5Widgets"),)
21 PKGS_FOUND += qt
22 endif
24 $(TARBALLS)/qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz:
25 $(call download_pkg,$(QT_URL),qt)
27 .sum-qt: qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz
29 qt: qtbase-everywhere-src-$(QT_VERSION_FULL).tar.xz .sum-qt
30 $(UNPACK)
31 $(APPLY) $(SRC)/qt/0001-allow-to-pass-user-defined-compilation-flags-to-qt.patch
32 ifdef HAVE_WIN32
33 $(APPLY) $(SRC)/qt/0002-Windows-QPA-Disable-systray-notification-sounds.patch
34 ifndef HAVE_WIN64
35 $(APPLY) $(SRC)/qt/0001-disable-qt_random_cpu.patch
36 endif
37 $(APPLY) $(SRC)/qt/0006-ANGLE-don-t-use-msvc-intrinsics-when-crosscompiling-.patch
38 $(APPLY) $(SRC)/qt/0007-ANGLE-remove-static-assert-that-can-t-be-evaluated-b.patch
39 $(APPLY) $(SRC)/qt/0008-ANGLE-disable-ANGLE_STD_ASYNC_WORKERS-when-compiling.patch
40 $(APPLY) $(SRC)/qt/0009-Add-KHRONOS_STATIC-to-allow-static-linking-on-Windows.patch
42 ifdef HAVE_CROSS_COMPILE
43 $(APPLY) $(SRC)/qt/0003-allow-cross-compilation-of-angle-with-wine.patch
44 ifndef HAVE_CLANG
45 $(APPLY) $(SRC)/qt/0010-Windows-QPA-Fix-build-with-mingw64-Win32-threading.patch
46 endif
47 else
48 $(APPLY) $(SRC)/qt/qt-fix-msys-long-pathes.patch
49 $(APPLY) $(SRC)/qt/0003-fix-angle-compilation.patch
50 cd $(UNPACK_DIR); for i in QtFontDatabaseSupport QtWindowsUIAutomationSupport QtEventDispatcherSupport QtCore; do \
51 sed -i -e 's,"../../../../../src,"../src,g' include/$$i/$(QT_VERSION)/$$i/private/*.h; done
52 endif
54 endif
55 $(MOVE)
58 ifdef HAVE_WIN32
59 QT_OPENGL := -angle
60 else
61 QT_OPENGL := -opengl desktop
62 endif
64 ifdef HAVE_MACOSX
65 QT_SPEC := darwin-g++
66 endif
68 ifdef HAVE_WIN32
70 ifdef HAVE_CLANG
71 QT_SPEC := win32-clang-g++
72 else
73 QT_SPEC := win32-g++
74 endif
76 ifdef HAVE_CROSS_COMPILE
77 QT_PLATFORM := -xplatform $(QT_SPEC) -device-option CROSS_COMPILE=$(HOST)-
78 else
79 ifneq ($(QT_SPEC),)
80 QT_PLATFORM := -platform $(QT_SPEC)
81 endif
82 endif
84 endif
86 QT_PLATFORM += -device-option VLC_EXTRA_CFLAGS="-isystem $(PREFIX)/include" \
87 -device-option VLC_EXTRA_CXXFLAGS="-isystem $(PREFIX)/include"
89 QT_CONFIG := -static -no-shared -opensource -confirm-license -no-pkg-config \
90 -no-sql-sqlite -no-gif -qt-libjpeg -no-openssl $(QT_OPENGL) -no-dbus \
91 -no-vulkan -no-sql-odbc -no-pch -no-feature-testlib \
92 -no-compile-examples -nomake examples -nomake tests -qt-zlib
94 QT_CONFIG += -skip qtsql
95 QT_CONFIG += -release
97 ifeq ($(V),1)
98 QT_CONFIG += -verbose
99 endif
101 ifdef HAVE_MINGW_W64
102 QT_CONFIG += -no-direct2d
103 endif
105 ENV_VARS := $(HOSTVARS) DXSDK_DIR=$(PREFIX)/bin
107 .qt: qt
108 # Prevent all Qt contribs from generating and installing libtool .la files
109 cd $< && sed -i "/CONFIG/ s/ create_libtool/ -create_libtool/g" mkspecs/features/qt_module.prf
110 +cd $< && $(ENV_VARS) ./configure $(QT_PLATFORM) $(QT_CONFIG) -prefix $(PREFIX) -hostprefix $(PREFIX)/lib/qt5
111 # Make && Install libraries
112 cd $< && $(ENV_VARS) $(MAKE)
113 cd $< && $(MAKE) -C src sub-corelib-install_subtargets sub-gui-install_subtargets sub-widgets-install_subtargets sub-platformsupport-install_subtargets sub-zlib-install_subtargets sub-bootstrap-install_subtargets sub-network-install_subtargets
114 # Install tools
115 cd $< && $(MAKE) -C src sub-moc-install_subtargets sub-rcc-install_subtargets sub-uic-install_subtargets sub-qlalr-install_subtargets
116 # Install plugins
117 cd $< && $(MAKE) -C src -C plugins sub-imageformats-install_subtargets sub-platforms-install_subtargets sub-styles-install_subtargets
118 $(SRC)/qt/AddStaticLink.sh "$(PREFIX)" Qt5Gui plugins/imageformats qjpeg
119 ifdef HAVE_WIN32
120 # Add the private include to our project (similar to using "gui-private" in a qmake project) as well as ANGLE headers
121 sed -i.orig -e 's#-I$${includedir}/QtGui#-I$${includedir}/QtGui -I$${includedir}/QtGui/$(QT_VERSION)/QtGui -I$${includedir}/QtANGLE#' $(PREFIX)/lib/pkgconfig/Qt5Gui.pc
122 $(SRC)/qt/AddStaticLink.sh "$(PREFIX)" Qt5Gui plugins/platforms qwindows
123 # Vista styling
124 $(SRC)/qt/AddStaticLink.sh "$(PREFIX)" Qt5Widgets plugins/styles qwindowsvistastyle
125 endif
126 #fix host tools headers to avoid collusion with target headers
127 mkdir -p $(PREFIX)/lib/qt5/include
128 cp -R $(PREFIX)/include/QtCore $(PREFIX)/lib/qt5/include
129 sed -i -e "s#\$\$QT_MODULE_INCLUDE_BASE#$(PREFIX)/lib/qt5/include#g" $(PREFIX)/lib/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri
130 # Install a qmake with correct paths set
131 cd $< && $(MAKE) sub-qmake-qmake-aux-pro-install_subtargets install_mkspecs
132 touch $@