From 30de8056910aa858d6feb4b0fb436727c4941b61 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Tue, 1 Apr 2025 13:13:08 +0200 Subject: [PATCH] itstool: fix cross --- pkgs/by-name/it/itstool/package.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/it/itstool/package.nix b/pkgs/by-name/it/itstool/package.nix index 7ef080da6d19..d0c4869c6d84 100644 --- a/pkgs/by-name/it/itstool/package.nix +++ b/pkgs/by-name/it/itstool/package.nix @@ -3,6 +3,7 @@ lib, fetchurl, python3, + autoreconfHook, }: stdenv.mkDerivation rec { @@ -16,14 +17,18 @@ stdenv.mkDerivation rec { strictDeps = true; - nativeBuildInputs = [ - python3 - python3.pkgs.wrapPython - ]; + postPatch = '' + # Do not let autoconf find Python, but set it directly. This fixes cross-compilation. + substituteInPlace configure.ac \ + --replace-fail 'AM_PATH_PYTHON([2.6])' "" \ + --replace-fail 'AC_MSG_ERROR(Python module $py_module is needed to run this package)' "" + substituteInPlace itstool.in \ + --replace-fail "@PYTHON@" "${python3.interpreter}" + ''; - buildInputs = [ - python3 - python3.pkgs.libxml2 + nativeBuildInputs = [ + autoreconfHook + python3.pkgs.wrapPython ]; pythonPath = [