about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix33
1 files changed, 31 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
index df60188800ab..a2b38046c5a8 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -11,6 +11,7 @@ Check for any minor version changes.
 , lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
 , bison, cups ? null, harfbuzz, libGL, perl, python3
 , gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_15, overrideSDK, overrideLibcxx
 , darwin
 
   # options
@@ -45,13 +46,29 @@ let
       ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
       ./qtbase.patch.d/0010-qtbase-assert.patch
       ./qtbase.patch.d/0011-fix-header_module.patch
-      ./qtbase.patch.d/9999-backport-dbus-crash.patch
     ];
     qtdeclarative = [
       ./qtdeclarative.patch
       # prevent headaches from stale qmlcache data
       ./qtdeclarative-default-disable-qmlcache.patch
     ];
+    qtlocation = lib.optionals stdenv.cc.isClang [
+      # Fix build with Clang 16
+      (fetchpatch {
+        url = "https://github.com/boostorg/numeric_conversion/commit/50a1eae942effb0a9b90724323ef8f2a67e7984a.patch";
+        stripLen = 1;
+        extraPrefix = "src/3rdparty/mapbox-gl-native/deps/boost/1.65.1/";
+        hash = "sha256-UEvIXzn387f9BAeBdhheStD/4M7en+rmqX8C6gstl6k=";
+      })
+    ];
+    qtmultimedia = lib.optionals stdenv.isDarwin [
+      # build patch for qtmultimedia with xcode 15
+      (fetchpatch {
+        url = "https://raw.githubusercontent.com/Homebrew/formula-patches/3f509180/qt5/qt5-qtmultimedia-xcode15.patch";
+        stripLen = 1;
+        hash = "sha256-HrEqfmm8WbapWgLM0L4AKW8168pwT2zYI8HOJruEPSs=";
+      })
+    ];
     qtpim = [
       ## Upstream patches after the Qt6 transition that apply without problems & fix bugs
 
@@ -272,6 +289,18 @@ let
       qtwayland = callPackage ../modules/qtwayland.nix {};
       qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
       qtwebengine = callPackage ../modules/qtwebengine.nix {
+        # The version of Chromium used by Qt WebEngine 5.15.x does not build with clang 16 due
+        # to the following errors:
+        # * -Wenum-constexpr-conversion: This is a downgradable error in clang 16, but it is planned
+        #   to be made into a hard error in a future version of clang. Patches are not available for
+        #   the version of v8 used by Chromium in Qt WebEngine, and fixing the code is non-trivial.
+        # * -Wincompatible-function-pointer-types: This is also a downgradable error generated
+        #   starting with clang 16. Patches are available upstream that can be backported.
+        # Because the first error is non-trivial to fix and suppressing it risks future breakage,
+        # clang is pinned to clang 15. That also makes fixing the second set of errors unnecessary.
+        stdenv =
+          let stdenv' = if stdenv.cc.isClang then overrideLibcxx llvmPackages_15.stdenv else stdenv;
+          in if stdenv'.isDarwin then overrideSDK stdenv' "11.0" else stdenv';
         inherit (srcs.qtwebengine) version;
         python = python3;
         postPatch = ''
@@ -306,7 +335,7 @@ let
         qt3d qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
         qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
         qtscript qtsensors qtserialport qtsvg qttools qttranslations
-        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebsockets
         qtwebview qtx11extras qtxmlpatterns qtlottie qtdatavis3d
       ] ++ lib.optional (!stdenv.isDarwin) qtwayland
         ++ lib.optional (stdenv.isDarwin) qtmacextras);