Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-24.11] qt6.qtwebengine: fix build on darwin #372849

Open
wants to merge 2 commits into
base: release-24.11
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions pkgs/development/libraries/qt-6/modules/qtwebengine/default.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 @@ -130,6 +139,13 @@ qtModule {
--replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \
--replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \
--replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\""

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 All @@ -139,8 +155,6 @@ qtModule {
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure.cmake src/gn/CMakeLists.txt \
--replace "AppleClang" "Clang"
substituteInPlace cmake/Functions.cmake \
--replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun"
'';
Expand Down
Loading