qtwebengine: rewrite
Fixes #39334 and Fixes #36729 Also, Fixes #36932 (hopefully it's still building) (This might be able to be able to be cherry-picked to 18.03 but be careful - chromium is extremely touchy. Probably best to wait for it to be built successfully on Hydra a few times.)
This commit is contained in:
parent
b87cb29d1b
commit
ec632b745f
@ -9,9 +9,8 @@ args:
|
|||||||
let
|
let
|
||||||
args_ = {
|
args_ = {
|
||||||
|
|
||||||
qmakeFlags =
|
qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
|
||||||
(args.qmakeFlags or [])
|
++ (args.qmakeFlags or []);
|
||||||
++ [ ("CONFIG+=" + (if debug then "debug" else "release")) ];
|
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE =
|
NIX_CFLAGS_COMPILE =
|
||||||
optional (!debug) "-DQT_NO_DEBUG"
|
optional (!debug) "-DQT_NO_DEBUG"
|
||||||
|
@ -11,9 +11,8 @@
|
|||||||
, libcap
|
, libcap
|
||||||
, pciutils
|
, pciutils
|
||||||
, systemd
|
, systemd
|
||||||
|
|
||||||
, enableProprietaryCodecs ? true
|
, enableProprietaryCodecs ? true
|
||||||
|
, gn, darwin, openbsm
|
||||||
, lib, stdenv # lib.optional, needsPax
|
, lib, stdenv # lib.optional, needsPax
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -25,7 +24,7 @@ qtModule {
|
|||||||
name = "qtwebengine";
|
name = "qtwebengine";
|
||||||
qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
|
qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
bison coreutils flex git gperf ninja pkgconfig python2 which
|
bison coreutils flex git gperf ninja pkgconfig python2 which gn
|
||||||
];
|
];
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
outputs = [ "bin" "dev" "out" ];
|
outputs = [ "bin" "dev" "out" ];
|
||||||
@ -61,8 +60,50 @@ qtModule {
|
|||||||
|
|
||||||
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
|
sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
|
||||||
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
|
src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
|
||||||
|
''
|
||||||
|
+ optionalString stdenv.isDarwin ''
|
||||||
|
# Remove annoying xcode check
|
||||||
|
substituteInPlace mkspecs/features/platform.prf \
|
||||||
|
--replace "lessThan(QMAKE_XCODE_VERSION, 7.3)" false
|
||||||
|
substituteInPlace src/core/config/mac_osx.pri \
|
||||||
|
--replace /usr ${stdenv.cc} \
|
||||||
|
--replace "isEmpty(QMAKE_MAC_SDK_VERSION)" false
|
||||||
|
|
||||||
|
# FIXME Needed with old Apple SDKs
|
||||||
|
# Abandon all hope ye who try to make sense of this.
|
||||||
|
substituteInPlace src/3rdparty/chromium/base/mac/foundation_util.mm \
|
||||||
|
--replace "NSArray<NSString*>*" "NSArray*"
|
||||||
|
substituteInPlace src/3rdparty/chromium/base/mac/sdk_forward_declarations.h \
|
||||||
|
--replace "NSDictionary<VNImageOption, id>*" "NSDictionary*" \
|
||||||
|
--replace "NSArray<VNRequest*>*" "NSArray*" \
|
||||||
|
--replace "typedef NSString* VNImageOption NS_STRING_ENUM" "typedef NSString* VNImageOption"
|
||||||
|
|
||||||
|
cat <<EOF > src/3rdparty/chromium/build/mac/find_sdk.py
|
||||||
|
#!/usr/bin/env python
|
||||||
|
print("10.10.0")
|
||||||
|
print("")
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > src/3rdparty/chromium/build/config/mac/sdk_info.py
|
||||||
|
#!/usr/bin/env python
|
||||||
|
print('xcode_version="9.1"')
|
||||||
|
print('xcode_version_int=9')
|
||||||
|
print('xcode_build="9B55"')
|
||||||
|
print('machine_os_build="17E199"')
|
||||||
|
print('sdk_path=""')
|
||||||
|
print('sdk_version="10.10"')
|
||||||
|
print('sdk_platform_path=""')
|
||||||
|
print('sdk_build="17B41"')
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Apple has some secret stuff they don't share with OpenBSM
|
||||||
|
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]"
|
||||||
|
substituteInPlace src/3rdparty/chromium/sandbox/mac/bootstrap_sandbox.cc \
|
||||||
|
--replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10";
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export NINJAFLAGS=-j$NIX_BUILD_CORES
|
export NINJAFLAGS=-j$NIX_BUILD_CORES
|
||||||
@ -70,13 +111,9 @@ qtModule {
|
|||||||
if [ -d "$PWD/tools/qmake" ]; then
|
if [ -d "$PWD/tools/qmake" ]; then
|
||||||
QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
|
QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
qmakeFlags =
|
qmakeFlags = optional enableProprietaryCodecs "-- -proprietary-codecs";
|
||||||
[
|
|
||||||
# Use system Ninja because bootstrapping it is fragile
|
|
||||||
"WEBENGINE_CONFIG+=use_system_ninja"
|
|
||||||
] ++ optional enableProprietaryCodecs "WEBENGINE_CONFIG+=use_proprietary_codecs";
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
# Image formats
|
# Image formats
|
||||||
@ -90,9 +127,10 @@ qtModule {
|
|||||||
|
|
||||||
# Text rendering
|
# Text rendering
|
||||||
harfbuzz icu
|
harfbuzz icu
|
||||||
]
|
|
||||||
++ optionals (!stdenv.isDarwin) [
|
libevent
|
||||||
dbus zlib minizip snappy nss protobuf jsoncpp libevent
|
] ++ optionals (!stdenv.isDarwin) [
|
||||||
|
dbus zlib minizip snappy nss protobuf jsoncpp
|
||||||
|
|
||||||
# Audio formats
|
# Audio formats
|
||||||
alsaLib
|
alsaLib
|
||||||
@ -106,17 +144,44 @@ qtModule {
|
|||||||
# X11 libs
|
# X11 libs
|
||||||
xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
|
xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
|
||||||
xorg.libXcomposite xorg.libXdamage libdrm
|
xorg.libXcomposite xorg.libXdamage libdrm
|
||||||
];
|
]
|
||||||
|
|
||||||
|
# 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; [
|
||||||
|
libobjc
|
||||||
|
cctools
|
||||||
|
|
||||||
|
# frameworks
|
||||||
|
ApplicationServices
|
||||||
|
Foundation
|
||||||
|
AppKit
|
||||||
|
ImageCaptureCore
|
||||||
|
CoreBluetooth
|
||||||
|
IOBluetooth
|
||||||
|
CoreWLAN
|
||||||
|
Quartz
|
||||||
|
Cocoa
|
||||||
|
|
||||||
|
openbsm
|
||||||
|
libunwind
|
||||||
|
]);
|
||||||
|
|
||||||
dontUseNinjaBuild = true;
|
dontUseNinjaBuild = true;
|
||||||
dontUseNinjaInstall = true;
|
dontUseNinjaInstall = true;
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = lib.optionalString stdenv.isLinux ''
|
||||||
cat > $out/libexec/qt.conf <<EOF
|
cat > $out/libexec/qt.conf <<EOF
|
||||||
[Paths]
|
[Paths]
|
||||||
Prefix = ..
|
Prefix = ..
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
paxmark m $out/libexec/QtWebEngineProcess
|
paxmark m $out/libexec/QtWebEngineProcess
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A web engine based on the Chromium web browser";
|
||||||
|
maintainers = with maintainers; [ matthewbauer ];
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user