From d2775e4ce0761c1a003c2131c4d47d9412cb8e77 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 25 Feb 2020 16:15:40 -0500 Subject: [PATCH] webkitgtk: ignore gettext when cross compiling Unfortunately, CMake looks in CMAKE_PREFIX_PATH for binaries when cross-compiling. This means that it will use gettext from CMAKE_PREFIX_PATH even when we provide a gettext binary in PATH! This is bad because the on in CMAKE_PREFIX_PATH is for the cross system, not the native one. The only documented way I can find to change this behavior is by manually setting the CMAKE_IGNORE_PATH variable. --- pkgs/development/libraries/webkitgtk/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index aa3d874979f..98259e1b034 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -51,6 +51,7 @@ , xdg-dbus-proxy , substituteAll , gnome3 +, glib }: assert enableGeoLocation -> geoclue2 != null; @@ -78,6 +79,14 @@ stdenv.mkDerivation rec { ./libglvnd-headers.patch ]; + preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + # Ignore gettext in cmake_prefix_path so that find_program doesn't + # pick up the wrong gettext. TODO: Find a better solution for + # this, maybe make cmake not look up executables in + # CMAKE_PREFIX_PATH. + cmakeFlags+=" -DCMAKE_IGNORE_PATH=${getBin gettext}/bin" + ''; + nativeBuildInputs = [ bison cmake @@ -89,6 +98,8 @@ stdenv.mkDerivation rec { pkgconfig python3 ruby + glib + wayland ]; buildInputs = [