Skip to content

Commit

Permalink
qt6: don't treat absolute paths without known suffix as library (#367206
Browse files Browse the repository at this point in the history
)
  • Loading branch information
K900 authored Dec 31, 2024
2 parents aa5f70e + 55b3d70 commit d1a5190
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/development/libraries/qt-6/modules/qtbase/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ stdenv.mkDerivation rec {
./qmlimportscanner-import-path.patch
# don't pass qtbase's QML directory to qmlimportscanner if it's empty
./skip-missing-qml-directory.patch

# Qt treats linker flags without known suffix as libraries since 6.7.2 (see qt/qtbase commit ea0f00d).
# Don't do this for absolute paths (like `/nix/store/…/QtMultimedia.framework/Versions/A/QtMultimedia`).
# Upcoming upstream fix: https://codereview.qt-project.org/c/qt/qtbase/+/613683.
./dont-treat-abspaths-without-suffix-as-libraries.patch
];

postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/cmake/QtGenerateLibHelpers.cmake b/cmake/QtGenerateLibHelpers.cmake
index 96675267d2..c9d4a69497 100644
--- a/cmake/QtGenerateLibHelpers.cmake
+++ b/cmake/QtGenerateLibHelpers.cmake
@@ -10,7 +10,7 @@ function(qt_get_library_name_without_prefix_and_suffix out_var file_path)
if(NOT file_path MATCHES "^-") # not a linker flag
get_filename_component(basename "${file_path}" NAME_WE)
get_filename_component(ext "${file_path}" EXT)
- if(NOT ext) # seems like a library name without prefix and suffix
+ if(NOT ext AND NOT IS_ABSOLUTE "${file_path}")
# seems like a library name without prefix and suffix
set(${out_var} "${file_path}" PARENT_SCOPE)
return()
endif()

0 comments on commit d1a5190

Please sign in to comment.