diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix | 150 |
1 files changed, 74 insertions, 76 deletions
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 729c5f388f99..03247487749a 100644 --- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -15,21 +15,22 @@ , pipewire_0_2 , enableProprietaryCodecs ? true , gn -, cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin +, cctools, libobjc, libunwind, sandbox, xnu +, ApplicationServices, AVFoundation, Foundation, ForceFeedback, GameController, AppKit +, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication +, cups, openbsm, runCommand, xcbuild, writeScriptBin , ffmpeg ? null , lib, stdenv, fetchpatch , version ? null , qtCompatVersion }: -with lib; - qtModule { pname = "qtwebengine"; qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ]; nativeBuildInputs = [ bison coreutils flex git gperf ninja pkg-config python2 which gn nodejs - ] ++ optional stdenv.isDarwin xcbuild; + ] ++ lib.optional stdenv.isDarwin xcbuild; doCheck = true; outputs = [ "bin" "dev" "out" ]; @@ -42,66 +43,65 @@ qtModule { # which cannot be set at the same time as -Wformat-security hardeningDisable = [ "format" ]; - 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 - - patchShebangs . - ) - '' - # Prevent Chromium build script from making the path to `clang` relative to - # the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR` - # from `src/core/config/mac_osx.pri`. - + optionalString stdenv.isDarwin '' - substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \ - --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"' - '' - # Patch library paths in Qt sources - + '' - sed -i \ - -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \ - -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \ - -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \ - src/core/web_engine_library_info.cpp - '' - # Patch library paths in Chromium sources - + optionalString (!stdenv.isDarwin) '' - 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 - '' - + optionalString stdenv.isDarwin ( - (if (lib.versionAtLeast qtCompatVersion "5.14") then '' - substituteInPlace src/buildtools/config/mac_osx.pri \ - --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' - '' else '' - substituteInPlace src/core/config/mac_osx.pri \ - --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' - '') - # Following is required to prevent a build error: - # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it - + '' - substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \ - --replace '$sysroot/usr' "${darwin.xnu}" - '' - # Apple has some secret stuff they don't share with OpenBSM - + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' - substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \ - --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]" - substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \ - --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]" - '' else '' - substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ - --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" - '')); + 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 + + # TODO: be more precise + patchShebangs . + ) + '' + # Prevent Chromium build script from making the path to `clang` relative to + # the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR` + # from `src/core/config/mac_osx.pri`. + + lib.optionalString stdenv.isDarwin '' + substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \ + --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"' + '' + # Patch library paths in Qt sources + + '' + sed -i \ + -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \ + -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \ + -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \ + src/core/web_engine_library_info.cpp + '' + # Patch library paths in Chromium sources + + lib.optionalString (!stdenv.isDarwin) '' + 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 ( + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' + substituteInPlace src/buildtools/config/mac_osx.pri \ + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' + '' else '' + substituteInPlace src/core/config/mac_osx.pri \ + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' + '') + # Following is required to prevent a build error: + # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it + + '' + substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \ + --replace '$sysroot/usr' "${xnu}" + '' + # Apple has some secret stuff they don't share with OpenBSM + + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \ + --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]" + substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \ + --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]" + '' else '' + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ + --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" + '')); NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit @@ -134,8 +134,8 @@ qtModule { ''; qmakeFlags = [ "--" "-system-ffmpeg" ] - ++ optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire" - ++ optional enableProprietaryCodecs "-proprietary-codecs"; + ++ lib.optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire" + ++ lib.optional enableProprietaryCodecs "-proprietary-codecs"; propagatedBuildInputs = [ # Image formats @@ -152,7 +152,7 @@ qtModule { libevent ffmpeg - ] ++ optionals (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.isDarwin) [ dbus zlib minizip snappy nss protobuf jsoncpp # Audio formats @@ -166,16 +166,16 @@ qtModule { # X11 libs xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst - xorg.libXcomposite xorg.libXdamage libdrm + xorg.libXcomposite xorg.libXdamage libdrm xorg.libxkbfile - ] ++ optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [ + ] ++ lib.optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [ # Pipewire pipewire_0_2 ] # FIXME These dependencies shouldn't be needed but can't find a way # around it. Chromium pulls this in while bootstrapping GN. - ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ + ++ lib.optionals stdenv.isDarwin [ libobjc cctools @@ -196,11 +196,11 @@ qtModule { openbsm libunwind - ]); + ]; - buildInputs = optionals stdenv.isDarwin (with darwin; [ + buildInputs = lib.optionals stdenv.isDarwin [ cups - apple_sdk.libs.sandbox + sandbox # `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py` # to get some information about the host platform. @@ -216,11 +216,10 @@ qtModule { shift done '') - ]); + ]; dontUseNinjaBuild = true; dontUseNinjaInstall = true; - dontUseXcbuild = true; postInstall = lib.optionalString stdenv.isLinux '' cat > $out/libexec/qt.conf <<EOF @@ -241,5 +240,4 @@ qtModule { # This build takes a long time; particularly on slow architectures timeout = 24 * 3600; }; - } |