From 0807fca47e29e6de510721bc1164f9f9ee3d774c Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 26 Jan 2023 12:19:25 +0000 Subject: [PATCH] libxml2: restrict Python support in cross builds --- pkgs/development/libraries/libxml2/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 6e8936f7ce6..23123940057 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -11,7 +11,10 @@ , ncurses , findXMLCatalogs , libiconv -, pythonSupport ? enableShared +# Python limits cross-compilation to an allowlist of host OSes. +# https://github.com/python/cpython/blob/dfad678d7024ab86d265d84ed45999e031a03691/configure.ac#L534-L562 +, pythonSupport ? enableShared && + (stdenv.hostPlatform == stdenv.buildPlatform || stdenv.hostPlatform.isCygwin || stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isWasi) , icuSupport ? false , icu , enableShared ? stdenv.hostPlatform.libc != "msvcrt" && !stdenv.hostPlatform.isStatic