guix_mirror_bot pushed a commit to branch qt-team
in repository guix.

commit d16f557f141e9c49853e34b46834eca534db99f7
Author: Efraim Flashner <[email protected]>
AuthorDate: Mon Oct 6 10:17:11 2025 +0300

    gnu: qtbase: Always find libvulkan.
    
    Fixes: guix/guix#3330
    
    * gnu/packages/qt.scm (qtbase)[source]: Add patch.
    [arguments]: Adjust a phase to substitute the location for libvulkan.so.
    * gnu/packages/patches/qtbase-patch-libvulkan.patch: New file.
    * gnu/local.mk (dist_patch_DATA): Register it.
    
    Co-authored-by: kestrelwx <[email protected]>
    Change-Id: I39f1be5a30c5c17a4e4ea6c853b475f20ba8272c
    Signed-off-by: Andreas Enge <[email protected]>
---
 gnu/local.mk                                      |  1 +
 gnu/packages/patches/qtbase-patch-libvulkan.patch | 28 +++++++++++++++++++++++
 gnu/packages/qt.scm                               |  9 +++++++-
 3 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 56afdd981b..34083b7260 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2204,6 +2204,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/qtbase-qmake-fix-includedir.patch       \
   %D%/packages/patches/qtbase-qmlimportscanner-qml-import-path.patch   \
   %D%/packages/patches/qtbase-moc-ignore-gcc-macro.patch       \
+  %D%/packages/patches/qtbase-patch-libvulkan.patch            \
   %D%/packages/patches/qtbase-qmake-use-libname.patch          \
   %D%/packages/patches/qtbase-5-use-TZDIR.patch                        \
   %D%/packages/patches/qtscript-disable-tests.patch            \
diff --git a/gnu/packages/patches/qtbase-patch-libvulkan.patch 
b/gnu/packages/patches/qtbase-patch-libvulkan.patch
new file mode 100644
index 0000000000..b8b3847504
--- /dev/null
+++ b/gnu/packages/patches/qtbase-patch-libvulkan.patch
@@ -0,0 +1,28 @@
+Add the full name for libvulkan.so.1 so that we can patch it in the 'build 
phase.
+Not sent upstream.
+
+diff --git a/src/gui/vulkan/qbasicvulkanplatforminstance.cpp 
b/src/gui/vulkan/qbasicvulkanplatforminstance.cpp
+index 47d9a7e9..80c929e5 100644
+--- a/src/gui/vulkan/qbasicvulkanplatforminstance.cpp
++++ b/src/gui/vulkan/qbasicvulkanplatforminstance.cpp
+@@ -45,7 +45,7 @@ QBasicPlatformVulkanInstance::~QBasicPlatformVulkanInstance()
+ 
+ void QBasicPlatformVulkanInstance::loadVulkanLibrary(const QString 
&defaultLibraryName, int defaultLibraryVersion)
+ {
+-    QVarLengthArray<std::pair<QString, int>, 3> loadList;
++    QVarLengthArray<std::pair<QString, int>, 4> loadList;
+ 
+     // First in the list of libraries to try is the manual override, relevant 
on
+     // embedded systems without a Vulkan loader and possibly with custom 
vendor
+@@ -63,6 +63,11 @@ void QBasicPlatformVulkanInstance::loadVulkanLibrary(const 
QString &defaultLibra
+     if (defaultLibraryVersion >= 0)
+         loadList.append({ defaultLibraryName, -1 });
+ 
++#ifdef __linux__
++    // As a fallback we append to the list the full default name of libvulkan.
++    loadList.append({ QString::fromUtf8("libvulkan.so.1"), -1 });
++#endif
++
+     bool ok = false;
+     for (const auto &lib : loadList) {
+         m_vulkanLib.reset(new QLibrary);
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 28f518d6de..644f779859 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -786,7 +786,8 @@ developers using C++ or QML, a CSS & JavaScript like 
language.")
                 "qtbase-absolute-runpath.patch"
                 "qtbase-qmake-use-libname.patch"
                 "qtbase-qmlimportscanner-qml-import-path.patch"
-                "qtbase-qmake-fix-includedir.patch"))))
+                "qtbase-qmake-fix-includedir.patch"
+                "qtbase-patch-libvulkan.patch"))))
     (build-system cmake-build-system)
     (arguments
      (substitute-keyword-arguments (package-arguments qtbase-5)
@@ -897,6 +898,11 @@ tst_qt_cmake_create.cpp"
                   (("/bin/ls")
                    (search-input-file inputs "bin/ls")))
 
+                ;; Patch the added reference for libvulkan.so
+                (substitute* "src/gui/vulkan/qbasicvulkanplatforminstance.cpp"
+                  (("libvulkan\\.so\\.1")
+                   (search-input-file inputs "lib/libvulkan.so.1")))
+
                 ;; Use shared-mime-info as the default MIME type database.
                 (substitute* "src/corelib/mimetypes/qmimedatabase.cpp"
                   (("return dirs;" all)
@@ -1213,6 +1219,7 @@ tst_qt_cmake_create.cpp"
                 libxcb
                 libxext
                 shared-mime-info
+                vulkan-loader
                 xcb-util-cursor
                 `(,zstd "lib"))))
     (native-search-paths

Reply via email to