python3: Fix cross compilation to FreeBSD

- autoreconf needs to be run if we patch configure.ac
- the patch lines need to be adjusted otherwise it applies wrong
This commit is contained in:
Audrey Dutcher
2025-12-06 15:18:45 -07:00
parent a937d80b7c
commit 5f12790a4c
2 changed files with 12 additions and 6 deletions
@@ -208,10 +208,16 @@ let
nativeBuildInputs = [
nukeReferences
]
++ optionals (!stdenv.hostPlatform.isDarwin && !withMinimalDeps) [
autoconf-archive # needed for AX_CHECK_COMPILE_FLAG
autoreconfHook
]
++
optionals
(
(!stdenv.hostPlatform.isDarwin && !withMinimalDeps)
|| (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isFreeBSD)
)
[
autoconf-archive # needed for AX_CHECK_COMPILE_FLAG
autoreconfHook
]
++
optionals ((!stdenv.hostPlatform.isDarwin || passthru.pythonAtLeast "3.14") && !withMinimalDeps)
[
@@ -1,6 +1,6 @@
--- a/configure.ac 2024-06-07 09:17:50.608162031 -0700
+++ b/configure.ac 2024-06-07 09:45:59.844518241 -0700
@@ -554,6 +554,9 @@
@@ -339,6 +339,9 @@
*-*-wasi)
ac_sys_system=WASI
;;
@@ -10,7 +10,7 @@
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
@@ -614,6 +617,9 @@
@@ -780,6 +783,9 @@
wasm32-*-* | wasm64-*-*)
_host_cpu=$host_cpu
;;