Skip to content

Commit d5c308d

Browse files
committed
depends: enable Linux desktop OpenGL
1 parent c238cef commit d5c308d

2 files changed

Lines changed: 65 additions & 7 deletions

File tree

.github/workflows/depends-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
build-essential \
6060
cmake \
6161
curl \
62+
libgl-dev \
63+
libx11-xcb-dev \
6264
make \
6365
ninja-build \
6466
patch \

patches/depends-Add-Qt-Qml-and-Qt-Quick-modules.patch

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
From 09508f4d1c9f54f7c418ec5fd61974fd3b4176c8 Mon Sep 17 00:00:00 2001
22
From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
33
Date: Mon, 8 Jun 2026 16:33:21 +0100
4-
Subject: [PATCH 2/3] depends: Add Qt Qml and Qt Quick modules
4+
Subject: [PATCH 2/3] depends: Add Qt QML, Qt Quick, and Linux OpenGL
55

66
---
7-
depends/packages/native_qt.mk | 22 +++++++++++++++---
8-
depends/packages/qt.mk | 27 +++++++++++++++++++++-
7+
depends/packages/native_qt.mk | 22 +++++++++++++++++---
8+
depends/packages/qt.mk | 33 ++++++++++++++++++++++++++----
99
depends/packages/qt_details.mk | 6 +++++
1010
depends/patches/qt/qtbase_skip_tools.patch | 8 +++----
11-
depends/patches/qt/static_fixes.patch | 10 ++++++++
12-
5 files changed, 64 insertions(+), 9 deletions(-)
11+
depends/patches/qt/static_fixes.patch | 10 ++++++++++
12+
depends/toolchain.cmake.in | 11 +++++++++--
13+
6 files changed, 76 insertions(+), 14 deletions(-)
1314

1415
diff --git a/depends/packages/native_qt.mk b/depends/packages/native_qt.mk
1516
index 2bf088c10a..6d2aec3734 100644
@@ -118,6 +119,14 @@ index 9b7cec341d..b0f51fe437 100644
118119
$(package)_extra_sources += $($(package)_qttools_file_name)
119120

120121
$(package)_top_download_path=$(qt_details_top_download_path)
122+
@@ -68,7 +76,6 @@ $(package)_config_opts += -no-libjpeg
123+
$(package)_config_opts += -no-libproxy
124+
$(package)_config_opts += -no-libudev
125+
$(package)_config_opts += -no-mtdev
126+
-$(package)_config_opts += -no-opengl
127+
$(package)_config_opts += -no-openssl
128+
$(package)_config_opts += -no-openvg
129+
$(package)_config_opts += -no-reduce-relocations
121130
@@ -127,6 +135,9 @@ $(package)_config_opts += -no-feature-macdeployqt
122131
$(package)_config_opts += -no-feature-qmake
123132
$(package)_config_opts += -no-feature-windeployqt
@@ -128,6 +137,31 @@ index 9b7cec341d..b0f51fe437 100644
128137
ifeq ($(host),$(build))
129138
# Qt Tools module.
130139
$(package)_config_opts += -feature-linguist
140+
@@ -142,14 +152,14 @@ $(package)_config_opts += -no-feature-qtplugininfo
141+
endif
142+
143+
$(package)_config_opts_darwin := -no-dbus
144+
+$(package)_config_opts_darwin += -no-opengl
145+
$(package)_config_opts_darwin += -no-feature-printsupport
146+
$(package)_config_opts_darwin += -no-feature-freetype
147+
$(package)_config_opts_darwin += -no-pkg-config
148+
149+
$(package)_config_opts_linux := -fontconfig
150+
+$(package)_config_opts_linux += -opengl desktop
151+
$(package)_config_opts_linux += -no-feature-process
152+
-$(package)_config_opts_linux += -no-feature-xlib
153+
-$(package)_config_opts_linux += -no-xcb-xlib
154+
$(package)_config_opts_linux += -pkg-config
155+
$(package)_config_opts_linux += -system-freetype
156+
$(package)_config_opts_linux += -xcb
157+
@@ -160,6 +170,7 @@ $(package)_config_opts_freebsd := $$($(package)_config_opts_linux)
158+
$(package)_config_opts_freebsd += -no-feature-inotify
159+
160+
$(package)_config_opts_mingw32 := -no-dbus
161+
+$(package)_config_opts_mingw32 += -no-opengl
162+
$(package)_config_opts_mingw32 += -no-feature-freetype
163+
$(package)_config_opts_mingw32 += -no-pkg-config
164+
131165
@@ -224,6 +235,8 @@ endef
132166

133167
define $(package)_fetch_cmds
@@ -176,6 +210,28 @@ index 9b7cec341d..b0f51fe437 100644
176210
cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \
177211
mkdir -p cmake && \
178212
cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \
213+
diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in
214+
index 87189efa1c..fbc6dccda1 100644
215+
--- a/depends/toolchain.cmake.in
216+
+++ b/depends/toolchain.cmake.in
217+
@@ -87,8 +87,15 @@ set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF)
218+
219+
set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}")
220+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
221+
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
222+
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
223+
+# Linux OpenGL intentionally uses system GL and X11 libraries, so consumers
224+
+# must be able to resolve their headers and shared libraries outside depends.
225+
+if("@host_system_name@" STREQUAL "Linux")
226+
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
227+
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
228+
+else()
229+
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
230+
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
231+
+endif()
232+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
233+
set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations")
234+
179235
diff --git a/depends/packages/qt_details.mk b/depends/packages/qt_details.mk
180236
index e49ac6a287..1e7264ab1a 100644
181237
--- a/depends/packages/qt_details.mk
@@ -231,11 +287,11 @@ index 1ae3f5774a..317dd3608d 100644
231287
#define explicit dont_use_cxx_explicit
232288
+--- a/qtbase/src/plugins/platforms/xcb/CMakeLists.txt
233289
++++ b/qtbase/src/plugins/platforms/xcb/CMakeLists.txt
234-
+@@ -65,6 +65,7 @@ qt_internal_add_module(XcbQpaPrivate
290+
+@@ -65,6 +65,8 @@ qt_internal_add_module(XcbQpaPrivate
235291
+ XCB::XFIXES
236292
+ XCB::XKB
237293
+ XKB::XKB
238294
++ $<BUILD_INTERFACE:X11::Xau>
295+
++ "$<LINK_ONLY:-lXau>"
239296
+ NO_UNITY_BUILD # X11 define clashes
240297
+ )
241-
+

0 commit comments

Comments
 (0)