diff --git a/pkgs/development/libraries/qt-6/modules/qtbase/default.nix b/pkgs/development/libraries/qt-6/modules/qtbase/default.nix index 7065eae8e631f..5290c15fee371 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase/default.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase/default.nix @@ -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 '' diff --git a/pkgs/development/libraries/qt-6/modules/qtbase/dont-treat-abspaths-without-suffix-as-libraries.patch b/pkgs/development/libraries/qt-6/modules/qtbase/dont-treat-abspaths-without-suffix-as-libraries.patch new file mode 100644 index 0000000000000..b9ee097808787 --- /dev/null +++ b/pkgs/development/libraries/qt-6/modules/qtbase/dont-treat-abspaths-without-suffix-as-libraries.patch @@ -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()