69 , enableProprietaryCodecs ? true
73 pname = "qtwebengine";
74 qtInputs = [ qtdeclarative qtwebchannel qtwebsockets qtpositioning ];
83 (python3.withPackages (ps: with ps; [ html5lib ]))
89 outputs = [ "out" "dev" ];
91 dontUseGnConfigure = true;
93 # ninja builds some components with -Wno-format,
94 # which cannot be set at the same time as -Wformat-security
95 hardeningDisable = [ "format" ];
98 # fixes consistent crashing in github on 6.4.0, can probably remove when there is a patch release
99 # https://codereview.qt-project.org/c/qt/qtwebengine/+/436316
100 ../patches/qtwebengine-fix.patch
104 # Patch Chromium build tools
106 cd src/3rdparty/chromium;
108 # Manually fix unsupported shebangs
109 substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
110 --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
111 substituteInPlace third_party/webgpu-cts/src/tools/run_deno \
112 --replace "/usr/bin/env -S deno" "/usr/bin/deno" || true
116 substituteInPlace cmake/Functions.cmake \
117 --replace "/bin/bash" "${buildPackages.bash}/bin/bash"
119 sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
120 src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
122 sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
123 src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
125 substituteInPlace src/3rdparty/chromium/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc \
126 --replace "/usr/share/X11/xkb" "${xkeyboard_config}/share/X11/xkb"
128 # Patch library paths in sources
129 substituteInPlace src/core/web_engine_library_info.cpp \
130 --replace "QLibraryInfo::path(QLibraryInfo::DataPath)" "\"$out\"" \
131 --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \
132 --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\""
136 "-DQT_FEATURE_qtpdf_build=ON"
137 "-DQT_FEATURE_qtpdf_widgets_build=ON"
138 "-DQT_FEATURE_qtpdf_quick_build=ON"
139 "-DQT_FEATURE_pdf_v8=ON"
140 "-DQT_FEATURE_pdf_xfa=ON"
141 "-DQT_FEATURE_pdf_xfa_bmp=ON"
142 "-DQT_FEATURE_pdf_xfa_gif=ON"
143 "-DQT_FEATURE_pdf_xfa_png=ON"
144 "-DQT_FEATURE_pdf_xfa_tiff=ON"
145 "-DQT_FEATURE_webengine_system_icu=ON"
146 "-DQT_FEATURE_webengine_system_libevent=ON"
147 "-DQT_FEATURE_webengine_system_libxml=ON"
148 "-DQT_FEATURE_webengine_system_ffmpeg=ON"
149 # android only. https://bugreports.qt.io/browse/QTBUG-100293
150 # "-DQT_FEATURE_webengine_native_spellchecker=ON"
151 "-DQT_FEATURE_webengine_sanitizer=ON"
152 "-DQT_FEATURE_webengine_webrtc_pipewire=ON"
153 "-DQT_FEATURE_webengine_kerberos=ON"
154 ] ++ lib.optional enableProprietaryCodecs "-DQT_FEATURE_webengine_proprietary_codecs=ON";
156 propagatedBuildInputs = [
229 requiredSystemFeatures = [ "big-parallel" ];
232 export NINJAFLAGS="-j$NIX_BUILD_CORES"
236 # This is required at runtime
238 mv $dev/libexec/QtWebEngineProcess $out/libexec
242 description = "A web engine based on the Chromium web browser";
243 platforms = platforms.linux;
244 # This build takes a long time; particularly on slow architectures
245 # 1 hour on 32x3.6GHz -> maybe 12 hours on 4x2.4GHz