[vlc-commits] [Git][videolan/vlc][master] 4 commits: contrib: qt: share the same major.minor between all contribs

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue May 28 07:13:50 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
3df869c9 by Steve Lhomme at 2024-05-28T06:21:07+00:00
contrib: qt: share the same major.minor between all contribs

- - - - -
22c6fb66 by Steve Lhomme at 2024-05-28T06:21:07+00:00
contrib: qt: always pass the path to the host tools when cross compiling

- - - - -
5954e06a by Steve Lhomme at 2024-05-28T06:21:07+00:00
contrib: qt: factorize the Qt CMake config

- - - - -
e52b9c0e by Steve Lhomme at 2024-05-28T06:21:07+00:00
contrib: qt: fix native build of qsb

We don't need QT_SHADETOOLS_CONFIG.
For native builds we should not use QT_HOST_LIBS and we should use QT_HOST_LIBS.

- - - - -


7 changed files:

- contrib/src/main.mak
- contrib/src/qt/rules.mak
- contrib/src/qt5compat/rules.mak
- contrib/src/qtdeclarative/rules.mak
- contrib/src/qtshadertools/rules.mak
- contrib/src/qtsvg/rules.mak
- contrib/src/qtwayland/rules.mak


Changes:

=====================================
contrib/src/main.mak
=====================================
@@ -16,6 +16,9 @@ PKGS_ALL := $(patsubst $(SRC)/%/rules.mak,%,$(wildcard $(SRC)/*/rules.mak))
 DATE := $(shell date +%Y%m%d)
 VPATH := $(TARBALLS)
 
+# Default Qt version
+QTBASE_VERSION_MAJOR := 6.7
+
 # Common download locations
 GNU ?= http://ftp.gnu.org/gnu
 SF := https://downloads.sourceforge.net/project
@@ -25,7 +28,7 @@ VIDEOLAN_GIT := https://git.videolan.org/git
 GITHUB := https://github.com
 GOOGLE_CODE := https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com
 GNUGPG := https://www.gnupg.org/ftp/gcrypt
-QT := https://download.qt.io/official_releases/qt
+QT := https://download.qt.io/official_releases/qt/$(QTBASE_VERSION_MAJOR)
 XIPH := https://ftp.osuosl.org/pub/xiph/releases
 XORG := https://www.x.org/releases/individual
 
@@ -537,6 +540,24 @@ endif
 MESONCLEAN = rm -rf $(BUILD_DIR)/meson-private
 MESONBUILD = meson compile -C $(BUILD_DIR) $(MESON_BUILD) && meson install -C $(BUILD_DIR)
 
+# shared Qt config
+ifeq ($(call system_tool_majmin, qtpaths6 --query QT_VERSION),$(QTBASE_VERSION_MAJOR))
+# using system Qt native tools
+ifdef HAVE_CROSS_COMPILE
+ QT_HOST_PREFIX := $(shell PATH="${SYSTEM_PATH}" qtpaths6 --query QT_HOST_PREFIX)
+ QT_HOST_LIBS := $(shell PATH="${SYSTEM_PATH}" qtpaths6 --query QT_HOST_LIBS)
+ QT_HOST_PATH := -DQT_HOST_PATH=$(QT_HOST_PREFIX) -DQT_HOST_PATH_CMAKE_DIR=$(QT_HOST_LIBS)/cmake
+endif
+else
+# using locally compiled Qt native tools
+ifdef HAVE_CROSS_COMPILE
+ QT_HOST_PREFIX := $(BUILDPREFIX)
+ QT_HOST_LIBS := $(QT_HOST_PREFIX)/lib
+ QT_HOST_PATH := -DQT_HOST_PATH=$(QT_HOST_PREFIX) -DQT_HOST_PATH_CMAKE_DIR=$(QT_HOST_LIBS)/cmake
+endif
+endif
+QT_CMAKE_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake $(QT_HOST_PATH)
+
 ifdef GPL
 REQUIRE_GPL =
 else


=====================================
contrib/src/qt/rules.mak
=====================================
@@ -1,10 +1,9 @@
 # qtbase
 
-QTBASE_VERSION_MAJOR := 6.7
 QTBASE_VERSION := $(QTBASE_VERSION_MAJOR).1
 # Insert potential -betaX suffix here:
 QTBASE_VERSION_FULL := $(QTBASE_VERSION)
-QTBASE_URL := $(QT)/$(QTBASE_VERSION_MAJOR)/$(QTBASE_VERSION_FULL)/submodules/qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz
+QTBASE_URL := $(QT)/$(QTBASE_VERSION_FULL)/submodules/qtbase-everywhere-src-$(QTBASE_VERSION_FULL).tar.xz
 
 ifdef HAVE_MACOSX
 #PKGS += qt
@@ -85,8 +84,8 @@ QTBASE_CONFIG += -static -opensource -confirm-license -no-pkg-config -no-openssl
 	-no-feature-syntaxhighlighter -no-feature-undoview -no-feature-splashscreen \
 	-no-feature-dockwidget -no-feature-statusbar -no-feature-statustip \
 	-no-feature-keysequenceedit -no-feature-pkg-config \
-	-nomake examples -prefix $(PREFIX) -qt-host-path $(BUILDPREFIX) \
-	-- -DCMAKE_TOOLCHAIN_FILE=$(abspath toolchain.cmake)
+	-nomake examples -prefix $(PREFIX) \
+	-- -DCMAKE_TOOLCHAIN_FILE=$(abspath toolchain.cmake) $(QT_HOST_PATH)
 
 QTBASE_NATIVE_CONFIG := -DQT_BUILD_EXAMPLES=FALSE -DQT_BUILD_TESTS=FALSE -DFEATURE_pkg_config=OFF \
 	-DFEATURE_accessibility=OFF -DFEATURE_widgets=OFF -DFEATURE_printsupport=OFF -DFEATURE_androiddeployqt=OFF \


=====================================
contrib/src/qt5compat/rules.mak
=====================================
@@ -1,8 +1,7 @@
 # Qt5Compat
 
-QT5COMPAT_VERSION_MAJOR := 6.7
-QT5COMPAT_VERSION := $(QT5COMPAT_VERSION_MAJOR).1
-QT5COMPAT_URL := $(QT)/$(QT5COMPAT_VERSION_MAJOR)/$(QT5COMPAT_VERSION)/submodules/qt5compat-everywhere-src-$(QT5COMPAT_VERSION).tar.xz
+QT5COMPAT_VERSION := $(QTBASE_VERSION_MAJOR).1
+QT5COMPAT_URL := $(QT)/$(QT5COMPAT_VERSION)/submodules/qt5compat-everywhere-src-$(QT5COMPAT_VERSION).tar.xz
 
 DEPS_qt5compat += qtdeclarative $(DEPS_qtdeclarative)
 
@@ -10,7 +9,7 @@ ifdef HAVE_WIN32
 PKGS += qt5compat
 endif
 
-ifeq ($(call need_pkg,"Qt6Core5Compat >= $(QT5COMPAT_VERSION_MAJOR)"),)
+ifeq ($(call need_pkg,"Qt6Core5Compat >= $(QTBASE_VERSION_MAJOR)"),)
 PKGS_FOUND += qt5compat
 endif
 
@@ -19,7 +18,7 @@ $(TARBALLS)/qt5compat-everywhere-src-$(QT5COMPAT_VERSION).tar.xz:
 
 .sum-qt5compat: qt5compat-everywhere-src-$(QT5COMPAT_VERSION).tar.xz
 
-QT5_COMPAT_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake
+QT5_COMPAT_CONFIG := $(QT_CMAKE_CONFIG)
 ifdef ENABLE_PDB
 QT5_COMPAT_CONFIG += -DCMAKE_BUILD_TYPE=RelWithDebInfo
 else


=====================================
contrib/src/qtdeclarative/rules.mak
=====================================
@@ -1,8 +1,7 @@
 # QtDeclarative
 
-QTDECLARATIVE_VERSION_MAJOR := 6.7
-QTDECLARATIVE_VERSION := $(QTDECLARATIVE_VERSION_MAJOR).1
-QTDECLARATIVE_URL := $(QT)/$(QTDECLARATIVE_VERSION_MAJOR)/$(QTDECLARATIVE_VERSION)/submodules/qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz
+QTDECLARATIVE_VERSION := $(QTBASE_VERSION_MAJOR).1
+QTDECLARATIVE_URL := $(QT)/$(QTDECLARATIVE_VERSION)/submodules/qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz
 
 DEPS_qtdeclarative-tools = qt-tools $(DEPS_qt-tools) qtshadertools-tools $(DEPS_qtshadertools-tools)
 
@@ -16,12 +15,12 @@ PKGS_TOOLS += qtdeclarative-tools
 endif
 PKGS_ALL += qtdeclarative-tools
 
-ifeq ($(call need_pkg,"Qt6Qml >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6Quick >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6QuickControls2 >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6QuickLayouts >= $(QTDECLARATIVE_VERSION_MAJOR) Qt6QmlWorkerScript >= $(QTDECLARATIVE_VERSION_MAJOR)"),)
+ifeq ($(call need_pkg,"Qt6Qml >= $(QTBASE_VERSION_MAJOR) Qt6Quick >= $(QTBASE_VERSION_MAJOR) Qt6QuickControls2 >= $(QTBASE_VERSION_MAJOR) Qt6QuickLayouts >= $(QTBASE_VERSION_MAJOR) Qt6QmlWorkerScript >= $(QTBASE_VERSION_MAJOR)"),)
 PKGS_FOUND += qtdeclarative
 endif
 ifndef HAVE_CROSS_COMPILE
 PKGS_FOUND += qtdeclarative-tools
-else ifeq ($(call system_tool_majmin, qmlcachegen --version),$(QTDECLARATIVE_VERSION_MAJOR))
+else ifeq ($(call system_tool_majmin, qmlcachegen --version),$(QTBASE_VERSION_MAJOR))
 PKGS_FOUND += qtdeclarative-tools
 endif
 
@@ -73,8 +72,7 @@ QT_DECLARATIVE_COMMON_CONFIG := \
 	-DFEATURE_quicktemplates2_calendar=OFF
 
 QT_DECLARATIVE_CONFIG := $(QT_DECLARATIVE_COMMON_CONFIG) \
-	-DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake \
-	-DQT_HOST_PATH=$(BUILDPREFIX)
+	$(QT_CMAKE_CONFIG)
 ifdef ENABLE_PDB
 QT_DECLARATIVE_CONFIG += -DCMAKE_BUILD_TYPE=RelWithDebInfo
 else
@@ -88,7 +86,7 @@ QT_DECLARATIVE_NATIVE_CONFIG := $(QT_DECLARATIVE_COMMON_CONFIG) \
 	-DFEATURE_qml_object_model=OFF \
 	-DFEATURE_qml_table_model=OFF \
 	-DFEATURE_quick_shadereffect=OFF \
-	-DCMAKE_TOOLCHAIN_FILE=$(BUILDPREFIX)/lib/cmake/Qt6/qt.toolchain.cmake
+	-DCMAKE_TOOLCHAIN_FILE=$(QT_HOST_LIBS)/cmake/Qt6/qt.toolchain.cmake
 
 .qtdeclarative-tools: BUILD_DIR=$</vlc_native
 .qtdeclarative-tools: qtdeclarative


=====================================
contrib/src/qtshadertools/rules.mak
=====================================
@@ -1,9 +1,8 @@
 # qtshadertools
 # required for Qt5Compat, and for qtdeclarative.
 
-QTSHADERTOOLS_VERSION_MAJOR := 6.7
-QTSHADERTOOLS_VERSION := $(QTSHADERTOOLS_VERSION_MAJOR).1
-QTSHADERTOOLS_URL := $(QT)/$(QTSHADERTOOLS_VERSION_MAJOR)/$(QTSHADERTOOLS_VERSION)/submodules/qtshadertools-everywhere-src-$(QTSHADERTOOLS_VERSION).tar.xz
+QTSHADERTOOLS_VERSION := $(QTBASE_VERSION_MAJOR).1
+QTSHADERTOOLS_URL := $(QT)/$(QTSHADERTOOLS_VERSION)/submodules/qtshadertools-everywhere-src-$(QTSHADERTOOLS_VERSION).tar.xz
 
 DEPS_qtshadertools-tools = qt-tools $(DEPS_qt-tools)
 
@@ -16,7 +15,7 @@ PKGS_TOOLS += qtshadertools-tools
 endif
 PKGS_ALL += qtshadertools-tools
 
-ifeq ($(call system_tool_majmin, qsb --version),$(QTSHADERTOOLS_VERSION_MAJOR))
+ifeq ($(call system_tool_majmin, qsb --version),$(QTBASE_VERSION_MAJOR))
 PKGS_FOUND += qtshadertools-tools
 endif
 
@@ -28,15 +27,12 @@ $(TARBALLS)/qtshadertools-everywhere-src-$(QTSHADERTOOLS_VERSION).tar.xz:
 .sum-qtshadertools-tools: .sum-qtshadertools
 	touch $@
 
-QT_SHADETOOLS_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake -DQT_HOST_PATH=$(BUILDPREFIX)
-ifdef ENABLE_PDB
-QT_SHADETOOLS_CONFIG += -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ifdef HAVE_CROSS_COMPILE
+QT_SHADETOOLS_NATIVE_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(QT_HOST_LIBS)/cmake/Qt6/qt.toolchain.cmake
 else
-QT_SHADETOOLS_CONFIG += -DCMAKE_BUILD_TYPE=Release
+QT_SHADETOOLS_NATIVE_CONFIG := $(QT_CMAKE_CONFIG)
 endif
 
-QT_SHADETOOLS_NATIVE_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(BUILDPREFIX)/lib/cmake/Qt6/qt.toolchain.cmake
-
 qtshadertools: qtshadertools-everywhere-src-$(QTSHADERTOOLS_VERSION).tar.xz .sum-qtshadertools
 	$(UNPACK)
 	$(MOVE)


=====================================
contrib/src/qtsvg/rules.mak
=====================================
@@ -1,8 +1,7 @@
 # qtsvg
 
-QTSVG_VERSION_MAJOR := 6.7
-QTSVG_VERSION := $(QTSVG_VERSION_MAJOR).1
-QTSVG_URL := $(QT)/$(QTSVG_VERSION_MAJOR)/$(QTSVG_VERSION)/submodules/qtsvg-everywhere-src-$(QTSVG_VERSION).tar.xz
+QTSVG_VERSION := $(QTBASE_VERSION_MAJOR).1
+QTSVG_URL := $(QT)/$(QTSVG_VERSION)/submodules/qtsvg-everywhere-src-$(QTSVG_VERSION).tar.xz
 
 DEPS_qtsvg += qt $(DEPS_qt)
 
@@ -10,7 +9,7 @@ ifdef HAVE_WIN32
 PKGS += qtsvg
 endif
 
-ifeq ($(call need_pkg,"Qt6Svg >= $(QTSVG_VERSION_MAJOR)"),)
+ifeq ($(call need_pkg,"Qt6Svg >= $(QTBASE_VERSION_MAJOR)"),)
 PKGS_FOUND += qtsvg
 endif
 
@@ -19,7 +18,7 @@ $(TARBALLS)/qtsvg-everywhere-src-$(QTSVG_VERSION).tar.xz:
 
 .sum-qtsvg: qtsvg-everywhere-src-$(QTSVG_VERSION).tar.xz
 
-QTSVG_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake
+QTSVG_CONFIG := $(QT_CMAKE_CONFIG)
 ifdef ENABLE_PDB
 QTSVG_CONFIG += -DCMAKE_BUILD_TYPE=RelWithDebInfo
 else


=====================================
contrib/src/qtwayland/rules.mak
=====================================
@@ -1,8 +1,7 @@
 # qtwayland
 
-QTWAYLAND_VERSION_MAJOR := 6.7
-QTWAYLAND_VERSION := $(QTWAYLAND_VERSION_MAJOR).1
-QTWAYLAND_URL := $(QT)/$(QTWAYLAND_VERSION_MAJOR)/$(QTWAYLAND_VERSION)/submodules/qtwayland-everywhere-src-$(QTWAYLAND_VERSION).tar.xz
+QTWAYLAND_VERSION := $(QTBASE_VERSION_MAJOR).1
+QTWAYLAND_URL := $(QT)/$(QTWAYLAND_VERSION)/submodules/qtwayland-everywhere-src-$(QTWAYLAND_VERSION).tar.xz
 
 ifdef HAVE_LINUX
 ifneq ($(findstring qt,$(PKGS)),)
@@ -17,7 +16,7 @@ $(TARBALLS)/qtwayland-everywhere-src-$(QTWAYLAND_VERSION).tar.xz:
 
 .sum-qtwayland: qtwayland-everywhere-src-$(QTWAYLAND_VERSION).tar.xz
 
-QTWAYLAND_CONFIG := -DCMAKE_TOOLCHAIN_FILE=$(PREFIX)/lib/cmake/Qt6/qt.toolchain.cmake
+QTWAYLAND_CONFIG := $(QT_CMAKE_CONFIG)
 ifdef ENABLE_PDB
 QTWAYLAND_CONFIG += -DCMAKE_BUILD_TYPE=RelWithDebInfo
 else



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/380487aa3d6003b9023dfc7c1a389c3f9ec1f48a...e52b9c0e9f88608af30fefba1d4e9fd7534f8961

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/380487aa3d6003b9023dfc7c1a389c3f9ec1f48a...e52b9c0e9f88608af30fefba1d4e9fd7534f8961
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list