2022-06-16 17:23:12 +00:00
|
|
|
{ qtModule
|
|
|
|
, qtdeclarative
|
|
|
|
, qtwebchannel
|
|
|
|
, qtpositioning
|
|
|
|
, qtwebsockets
|
2022-08-21 13:32:41 +00:00
|
|
|
, buildPackages
|
2022-06-16 17:23:12 +00:00
|
|
|
, bison
|
|
|
|
, coreutils
|
|
|
|
, flex
|
|
|
|
, git
|
|
|
|
, gperf
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, which
|
|
|
|
, nodejs
|
|
|
|
, xorg
|
|
|
|
, libXcursor
|
|
|
|
, libXScrnSaver
|
|
|
|
, libXrandr
|
|
|
|
, libXtst
|
|
|
|
, libxshmfence
|
|
|
|
, libXi
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, harfbuzz
|
|
|
|
, icu
|
|
|
|
, dbus
|
|
|
|
, libdrm
|
|
|
|
, zlib
|
|
|
|
, minizip
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libtiff
|
|
|
|
, libwebp
|
|
|
|
, libopus
|
|
|
|
, jsoncpp
|
|
|
|
, protobuf
|
|
|
|
, libvpx
|
|
|
|
, srtp
|
|
|
|
, snappy
|
|
|
|
, nss
|
|
|
|
, libevent
|
|
|
|
, openssl
|
|
|
|
, alsa-lib
|
|
|
|
, pulseaudio
|
|
|
|
, libcap
|
|
|
|
, pciutils
|
|
|
|
, systemd
|
|
|
|
, pipewire
|
|
|
|
, gn
|
2023-03-27 19:17:25 +00:00
|
|
|
, ffmpeg_4
|
2022-06-16 17:23:12 +00:00
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, glib
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, lcms2
|
|
|
|
, libkrb5
|
2022-09-30 11:47:45 +00:00
|
|
|
, mesa
|
2022-06-16 17:23:12 +00:00
|
|
|
, enableProprietaryCodecs ? true
|
2023-04-29 16:46:19 +00:00
|
|
|
# darwin
|
|
|
|
, 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
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
qtModule {
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "qtwebengine";
|
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
coreutils
|
|
|
|
flex
|
|
|
|
git
|
|
|
|
gperf
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
(python3.withPackages (ps: with ps; [ html5lib ]))
|
|
|
|
which
|
|
|
|
gn
|
|
|
|
nodejs
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
bootstrap_cmds
|
|
|
|
cctools
|
|
|
|
xcbuild
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
dontUseGnConfigure = true;
|
|
|
|
|
|
|
|
# ninja builds some components with -Wno-format,
|
|
|
|
# which cannot be set at the same time as -Wformat-security
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
patches = [
|
|
|
|
# removes macOS 12+ dependencies
|
|
|
|
../patches/qtwebengine-darwin-no-low-latency-flag.patch
|
|
|
|
../patches/qtwebengine-darwin-no-copy-certificate-chain.patch
|
|
|
|
# Don't assume /usr/share/X11, and also respect the XKB_CONFIG_ROOT
|
|
|
|
# environment variable, since NixOS relies on it working.
|
|
|
|
# See https://github.com/NixOS/nixpkgs/issues/226484 for more context.
|
|
|
|
../patches/qtwebengine-xkb-includes.patch
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
../patches/qtwebengine-link-pulseaudio.patch
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
# Override locales install path so they go to QtWebEngine's $out
|
|
|
|
../patches/qtwebengine-locales-path.patch
|
2023-04-29 16:46:19 +00:00
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Patch Chromium build tools
|
|
|
|
(
|
|
|
|
cd src/3rdparty/chromium;
|
|
|
|
|
|
|
|
# Manually fix unsupported shebangs
|
|
|
|
substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
|
|
|
|
--replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
|
2022-09-30 11:47:45 +00:00
|
|
|
substituteInPlace third_party/webgpu-cts/src/tools/run_deno \
|
2022-06-16 17:23:12 +00:00
|
|
|
--replace "/usr/bin/env -S deno" "/usr/bin/deno" || true
|
|
|
|
patchShebangs .
|
|
|
|
)
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
substituteInPlace cmake/Functions.cmake \
|
|
|
|
--replace "/bin/bash" "${buildPackages.bash}/bin/bash"
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Patch library paths in sources
|
|
|
|
substituteInPlace src/core/web_engine_library_info.cpp \
|
|
|
|
--replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \
|
|
|
|
--replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \
|
|
|
|
--replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\""
|
2023-04-29 16:46:19 +00:00
|
|
|
''
|
|
|
|
+ lib.optionalString stdenv.isLinux ''
|
|
|
|
sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
|
|
|
|
src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
|
|
|
|
|
|
|
|
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
|
|
|
|
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
|
|
|
|
''
|
|
|
|
+ lib.optionalString stdenv.isDarwin ''
|
2023-10-19 13:55:26 +00:00
|
|
|
substituteInPlace configure.cmake src/gn/CMakeLists.txt \
|
2023-04-29 16:46:19 +00:00
|
|
|
--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}"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DQT_FEATURE_qtpdf_build=ON"
|
|
|
|
"-DQT_FEATURE_qtpdf_widgets_build=ON"
|
|
|
|
"-DQT_FEATURE_qtpdf_quick_build=ON"
|
|
|
|
"-DQT_FEATURE_pdf_v8=ON"
|
|
|
|
"-DQT_FEATURE_pdf_xfa=ON"
|
|
|
|
"-DQT_FEATURE_pdf_xfa_bmp=ON"
|
|
|
|
"-DQT_FEATURE_pdf_xfa_gif=ON"
|
|
|
|
"-DQT_FEATURE_pdf_xfa_png=ON"
|
|
|
|
"-DQT_FEATURE_pdf_xfa_tiff=ON"
|
|
|
|
"-DQT_FEATURE_webengine_system_icu=ON"
|
|
|
|
"-DQT_FEATURE_webengine_system_libevent=ON"
|
|
|
|
"-DQT_FEATURE_webengine_system_libxml=ON"
|
|
|
|
"-DQT_FEATURE_webengine_system_ffmpeg=ON"
|
|
|
|
# android only. https://bugreports.qt.io/browse/QTBUG-100293
|
|
|
|
# "-DQT_FEATURE_webengine_native_spellchecker=ON"
|
|
|
|
"-DQT_FEATURE_webengine_sanitizer=ON"
|
|
|
|
"-DQT_FEATURE_webengine_kerberos=ON"
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
"-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}"
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
qtdeclarative
|
|
|
|
qtwebchannel
|
|
|
|
qtwebsockets
|
|
|
|
qtpositioning
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Image formats
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
libtiff
|
|
|
|
libwebp
|
|
|
|
|
|
|
|
# Video formats
|
|
|
|
srtp
|
|
|
|
libvpx
|
|
|
|
|
|
|
|
# Audio formats
|
|
|
|
libopus
|
|
|
|
|
|
|
|
# Text rendering
|
|
|
|
harfbuzz
|
|
|
|
icu
|
|
|
|
|
|
|
|
openssl
|
|
|
|
glib
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
lcms2
|
|
|
|
|
|
|
|
libevent
|
2023-03-27 19:17:25 +00:00
|
|
|
ffmpeg_4
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2022-06-16 17:23:12 +00:00
|
|
|
dbus
|
|
|
|
zlib
|
|
|
|
minizip
|
|
|
|
snappy
|
|
|
|
nss
|
|
|
|
protobuf
|
|
|
|
jsoncpp
|
|
|
|
|
|
|
|
# Audio formats
|
|
|
|
alsa-lib
|
|
|
|
pulseaudio
|
|
|
|
|
|
|
|
# Text rendering
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
|
|
|
|
libcap
|
|
|
|
pciutils
|
|
|
|
|
|
|
|
# X11 libs
|
|
|
|
xorg.xrandr
|
|
|
|
libXScrnSaver
|
|
|
|
libXcursor
|
|
|
|
libXrandr
|
|
|
|
xorg.libpciaccess
|
|
|
|
libXtst
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXdamage
|
|
|
|
libdrm
|
|
|
|
xorg.libxkbfile
|
|
|
|
libxshmfence
|
|
|
|
libXi
|
|
|
|
xorg.libXext
|
|
|
|
|
|
|
|
# Pipewire
|
|
|
|
pipewire
|
|
|
|
|
|
|
|
libkrb5
|
2022-09-30 11:47:45 +00:00
|
|
|
mesa
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ 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
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cups
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
libpm
|
|
|
|
sandbox
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
requiredSystemFeatures = [ "big-parallel" ];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
preConfigure = ''
|
|
|
|
export NINJAFLAGS="-j$NIX_BUILD_CORES"
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A web engine based on the Chromium web browser";
|
2023-04-29 16:46:19 +00:00
|
|
|
platforms = platforms.unix;
|
2022-06-16 17:23:12 +00:00
|
|
|
# This build takes a long time; particularly on slow architectures
|
|
|
|
# 1 hour on 32x3.6GHz -> maybe 12 hours on 4x2.4GHz
|
|
|
|
timeout = 24 * 3600;
|
|
|
|
};
|
|
|
|
}
|