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
- Apply upstream zutil.h patch that fixes clang 18 and later
- Apply upstream libpng patch that fixes clang 18 and later
  • Loading branch information
azuwis committed Jan 5, 2025
1 parent af397f4 commit 3bed3d5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pkgs/development/libraries/qt-6/modules/qtwebengine/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ qtModule {
extraPrefix = "src/3rdparty/chromium/third_party/xnnpack/src/";
hash = "sha256-GUESVNR88I1K2V5xr0e09ec4j2eselMhNN06+PCcINM=";
})

# The latest version of Clang changed what macros it predefines on Apple
# targets, causing errors about predefined macros in zlib.
(fetchpatch {
url = "https://github.com/chromium/chromium/commit/2f39ac8d0a414dd65c0e1d5aae38c8f97aa06ae9.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
hash = "sha256-07hWANY9JGFmqvjdOD6SFmVI6sQRRyvW+7wxGZF5GVo=";
})

# The latest version of Clang changed what macros it predefines on Apple
# targets, causing errors about predefined macros in libpng.
(fetchpatch {
url = "https://github.com/chromium/chromium/commit/66defc14abe47c0494da9faebebfa0a5b6efcf38.patch";
stripLen = 1;
extraPrefix = "src/3rdparty/chromium/";
hash = "sha256-FWIi1VsBZFqOoPIkPxPkcfexPkx1458rB5ldtA7T2uE=";
})
];

postPatch =
Expand Down Expand Up @@ -151,6 +169,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 3bed3d5

Please sign in to comment.