Skip to content

Commit

Permalink
Merge pull request #318167 from rhelmot/freebsd-python-cross
Browse files Browse the repository at this point in the history
python3: Enable FreeBSD cross build
  • Loading branch information
kirillrdy authored Jun 9, 2024
2 parents 41ae060 + 22913c8 commit beb090c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkgs/development/interpreters/python/cpython/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,15 @@ in with passthru; stdenv.mkDerivation (finalAttrs: {
# (since it will do a futile invocation of gcc (!) to find
# libuuid, slowing down program startup a lot).
noldconfigPatch
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.isFreeBSD) [
# Cross compilation only supports a limited number of "known good"
# configurations. If you're reading this and it's been a long time
# since this diff, consider submitting this patch upstream!
./freebsd-cross.patch
] ++ optionals (pythonOlder "3.13") [
# Make sure that the virtualenv activation scripts are
# owner-writable, so venvs can be recreated without permission
# errors.
] ++ optionals (pythonOlder "3.13") [
./virtualenv-permissions.patch
] ++ optionals (pythonAtLeast "3.13") [
./3.13/virtualenv-permissions.patch
Expand Down
22 changes: 22 additions & 0 deletions pkgs/development/interpreters/python/cpython/freebsd-cross.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- 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 @@
*-*-wasi)
ac_sys_system=WASI
;;
+ *-*-freebsd)
+ ac_sys_system=FreeBSD
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
@@ -614,6 +617,9 @@
wasm32-*-* | wasm64-*-*)
_host_cpu=$host_cpu
;;
+ x86_64-*-freebsd)
+ _host_cpu=x86_64
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"

0 comments on commit beb090c

Please sign in to comment.