From 9264b0fd2a3c5a38faef02ccbd33ab4ce5f3d992 Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 3 Oct 2024 05:02:35 +0000 Subject: [PATCH] ibus: fix cross compilation --- pkgs/tools/inputmethods/ibus/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix index e396b6f06444e..e2c2383ae3999 100644 --- a/pkgs/tools/inputmethods/ibus/default.nix +++ b/pkgs/tools/inputmethods/ibus/default.nix @@ -37,7 +37,7 @@ let python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]); - python3BuildEnv = python3.buildEnv.override { + python3BuildEnv = python3.pythonOnBuildForHost.buildEnv.override { # ImportError: No module named site postBuild = '' makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH @@ -97,8 +97,10 @@ stdenv.mkDerivation rec { # The `AX_PROG_{CC,CXX}_FOR_BUILD` autoconf macros can pick up unwrapped GCC binaries, # so we set `{CC,CXX}_FOR_BUILD` to override that behavior. # https://github.com/NixOS/nixpkgs/issues/21751 - "CC_FOR_BUILD=${stdenv.cc}/bin/cc" - "CXX_FOR_BUILD=${stdenv.cc}/bin/c++" + "CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" + "CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}c++" + "GLIB_COMPILE_RESOURCES=${lib.getDev buildPackages.glib}/bin/glib-compile-resources" + "PKG_CONFIG_VAPIGEN_VAPIGEN=${lib.getBin buildPackages.vala}/bin/vapigen" "--disable-memconf" (lib.enableFeature (dconf != null) "dconf") (lib.enableFeature (libnotify != null) "libnotify") @@ -109,6 +111,7 @@ stdenv.mkDerivation rec { "--enable-install-tests" "--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji" "--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations" + "--with-python=${python3BuildEnv.interpreter}" "--with-ucd-dir=${unicode-character-database}/share/unicode" ]; @@ -117,6 +120,11 @@ stdenv.mkDerivation rec { "test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus" ]; + + depsBuildBuild = [ + pkg-config + ]; + nativeBuildInputs = [ autoreconfHook gtk-doc @@ -146,6 +154,7 @@ stdenv.mkDerivation rec { json-glib libnotify libdbusmenu-gtk3 + vala # for share/vala/Makefile.vapigen (PKG_CONFIG_VAPIGEN_VAPIGEN) ] ++ lib.optionals withWayland [ libxkbcommon wayland