Skip to content

Commit

Permalink
Merge pull request #226377 from wegank/qt6-qtwebengine-darwin-pre
Browse files Browse the repository at this point in the history
qt6.qtwebengine: add frameworks for darwin
  • Loading branch information
wegank authored Apr 16, 2023
2 parents 3ec47ba + 7f8c357 commit 488cc85
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 3 deletions.
11 changes: 10 additions & 1 deletion pkgs/development/libraries/qt-6/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,16 @@ let
qtvirtualkeyboard = callPackage ./modules/qtvirtualkeyboard.nix { };
qtwayland = callPackage ./modules/qtwayland.nix { };
qtwebchannel = callPackage ./modules/qtwebchannel.nix { };
qtwebengine = callPackage ./modules/qtwebengine.nix { };
qtwebengine = callPackage ./modules/qtwebengine.nix {
inherit (darwin) bootstrap_cmds cctools xnu;
inherit (darwin.apple_sdk_11_0) libpm libunwind;
inherit (darwin.apple_sdk_11_0.libs) sandbox;
inherit (darwin.apple_sdk_11_0.frameworks)
AGL AVFoundation Accelerate Cocoa CoreLocation CoreML ForceFeedback
GameController ImageCaptureCore LocalAuthentication
MediaAccessibility MediaPlayer MetalKit Network OpenDirectory Quartz
ReplayKit SecurityInterface Vision;
};
qtwebsockets = callPackage ./modules/qtwebsockets.nix { };
qtwebview = callPackage ./modules/qtwebview.nix {
inherit (darwin.apple_sdk_11_0.frameworks) WebKit;
Expand Down
73 changes: 71 additions & 2 deletions pkgs/development/libraries/qt-6/modules/qtwebengine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
, systemd
, pipewire
, gn
, cups
, openbsm
, runCommand
, writeScriptBin
, ffmpeg_4
Expand All @@ -67,6 +65,36 @@
, mesa
, xkeyboard_config
, enableProprietaryCodecs ? true
# darwin
, clang_14
, bootstrap_cmds
, cctools
, xcbuild
, AGL
, AVFoundation
, Accelerate
, Cocoa
, CoreLocation
, CoreML
, ForceFeedback
, GameController
, ImageCaptureCore
, LocalAuthentication
, MediaAccessibility
, MediaPlayer
, MetalKit
, Network
, OpenDirectory
, Quartz
, ReplayKit
, SecurityInterface
, Vision
, openbsm
, libunwind
, cups
, libpm
, sandbox
, xnu
}:

qtModule {
Expand All @@ -84,6 +112,11 @@ qtModule {
which
gn
nodejs
] ++ lib.optionals stdenv.isDarwin [
clang_14
bootstrap_cmds
cctools
xcbuild
];
doCheck = true;
outputs = [ "out" "dev" ];
Expand Down Expand Up @@ -125,6 +158,14 @@ qtModule {
substituteInPlace src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc \
--replace "/usr/share/X11/xkb" "${xkeyboard_config}/share/X11/xkb"
''
+ lib.optionalString stdenv.isDarwin ''
substituteInPlace configure.cmake \
--replace "AppleClang" "Clang"
substituteInPlace cmake/Functions.cmake \
--replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun"
substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
--replace "\$sysroot/usr" "${xnu}"
'';

cmakeFlags = [
Expand All @@ -149,6 +190,8 @@ qtModule {
"-DQT_FEATURE_webengine_webrtc_pipewire=ON"
] ++ lib.optionals enableProprietaryCodecs [
"-DQT_FEATURE_webengine_proprietary_codecs=ON"
] ++ lib.optionals stdenv.isDarwin [
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.targetPlatform.darwinSdkVersion}"
];

propagatedBuildInputs = [
Expand Down Expand Up @@ -218,10 +261,36 @@ qtModule {

libkrb5
mesa
] ++ lib.optionals stdenv.isDarwin [
AGL
AVFoundation
Accelerate
Cocoa
CoreLocation
CoreML
ForceFeedback
GameController
ImageCaptureCore
LocalAuthentication
MediaAccessibility
MediaPlayer
MetalKit
Network
OpenDirectory
Quartz
ReplayKit
SecurityInterface
Vision

openbsm
libunwind
];

buildInputs = [
cups
] ++ lib.optionals stdenv.isDarwin [
libpm
sandbox
];

requiredSystemFeatures = [ "big-parallel" ];
Expand Down

0 comments on commit 488cc85

Please sign in to comment.