Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5.qtwebengine: point build at proper pkg-config for cross #220319

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion pkgs/development/libraries/qt-5/modules/qtwebengine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

, bison, flex, git, gperf, ninja, pkg-config, python, which
, nodejs, qtbase, perl
, buildPackages

, xorg, libXcursor, libXScrnSaver, libXrandr, libXtst
, fontconfig, freetype, harfbuzz, icu, dbus, libdrm
Expand All @@ -28,11 +29,30 @@
, postPatch ? ""
}:

let
# qtwebengine expects to find an executable in $PATH which runs on
# the build platform yet knows about the host `.pc` files.
# Most configury allows setting $PKG_CONFIG to point to an
# arbitrarily-named script which serves this purpose; however QT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not patch that out instead?

# insists that it is named `pkg-config` with no target prefix.
# So we re-wrap the host platform's pkg-config.
pkg-config-wrapped-without-prefix = stdenv.mkDerivation {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are only running commands in installPhase you probably want to use runCommand instead

pname = "pkg-config-wrapper-without-target-prefix";
inherit (buildPackages.pkg-config) version;
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
ln -s '${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config' $out/bin/pkg-config
'';
};
in

qtModule {
pname = "qtwebengine";
qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
nativeBuildInputs = [
bison flex git gperf ninja pkg-config python which gn nodejs
bison flex git gperf ninja pkg-config python pkg-config-wrapped-without-prefix which gn nodejs perl
] ++ lib.optional stdenv.isDarwin xcbuild;
doCheck = true;
outputs = [ "bin" "dev" "out" ];
Expand Down Expand Up @@ -119,6 +139,8 @@ qtModule {
if [ -d "$PWD/tools/qmake" ]; then
QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
fi
'' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
export PKG_CONFIG_EXECUTABLE='${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config'
'';

qmakeFlags = [ "--" "-system-ffmpeg" ]
Expand Down