Skip to content

Commit

Permalink
qt6.qtwebengine: fix build on darwin
Browse files Browse the repository at this point in the history
- Disable metal shader compilation
- Use clang 17
  • Loading branch information
azuwis committed Nov 30, 2024
1 parent a2e7cda commit 5dcb136
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkgs/development/libraries/qt-6/modules/qtwebengine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
, flex
, git
, gperf
, llvmPackages_17
, ninja
, pkg-config
, python3
Expand Down Expand Up @@ -67,7 +68,15 @@
, xcbuild
}:

qtModule {
let
# Error when using clang 16:
# .../src/3rdparty/chromium/base/containers/flat_tree.h:354:22:
# error: invalid operands to binary expression ('const container_type' (aka 'const std::vector<device::BluetoothUUID>') and 'const container_type')
# return lhs.body_ <=> rhs.body_;
# ~~~~~~~~~ ^ ~~~~~~~~~
stdenv' = if stdenv.cc.isClang then llvmPackages_17.stdenv else stdenv;
in
(qtModule.override { stdenv = stdenv'; }) {
pname = "qtwebengine";
nativeBuildInputs = [
bison
Expand Down Expand Up @@ -133,6 +142,10 @@ qtModule {
substituteInPlace configure.cmake src/gn/CMakeLists.txt \
--replace "AppleClang" "Clang"
# Disable metal shader compilation, Xcode only
substituteInPlace src/3rdparty/chromium/third_party/angle/src/libANGLE/renderer/metal/metal_backend.gni \
--replace-fail 'angle_has_build && !is_ios && target_os == host_os' "false"
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
Expand Down

0 comments on commit 5dcb136

Please sign in to comment.