Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CeDeROM add FreeBSD support 20221014. #1516

Merged
merged 2 commits into from
Oct 21, 2022

Conversation

cederom
Copy link
Contributor

@cederom cederom commented Oct 14, 2022

  1. Initial FreeBSD support using Linux binaries.
  • FreeBSD can emulate Linux ELF binaries [1].
  • Use the same process for FreeBSD as for Linux.
  • Add FreeBSD recognition in checks.

[1] https://docs.freebsd.org/en/articles/linux-emulation/

  1. Fix 64-bit detection based on os.uname.
  • Not every OS uses x86_64 in uname (i.e. FreeBSD uses amd64).
  • Every 64-bit OS will have 64 in uname.
  • Alternatively platform.architecture()[0] will return 64bit.

Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Left a minor suggestion that may help contributors in future.

buildozer/targets/android.py Outdated Show resolved Hide resolved
@cederom cederom force-pushed the cederom-add-freebsd-support-20221014 branch from 3b3b4d3 to 1901fb6 Compare October 17, 2022 14:10
* FreeBSD can emulate Linux ELF binaries [1].
* Use the same process for FreeBSD as for Linux.
* Add FreeBSD recognition in checks.

[1] https://docs.freebsd.org/en/articles/linux-emulation/

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
* Not every OS uses `x86_64` in `uname` (i.e. FreeBSD uses `amd64`).
* Every 64-bit OS will have 64 in `uname`.
* Alternatively `platform.architecture()[0]` will return `64bit`.

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
@cederom cederom force-pushed the cederom-add-freebsd-support-20221014 branch from 1901fb6 to 8913e14 Compare October 17, 2022 14:18
@cederom
Copy link
Contributor Author

cederom commented Oct 17, 2022

Updates:

  1. Provided patches enables download and run of Linux binaries on FreeBSD.
  2. Google NDK also has some Linux only hardcodes, but fixing them enables build on FreeBSD. Problem already reported to NDK Dev Team: [BUG] shell interpreter hardcode #!/bin/bash update to #!/usr/bin/env bash. android/ndk#1780 (comment).
  3. Some Recipes can be built and some not because of Linux only hardcodes, but this is a separate P4A issue, probably will need a dedicated fix to each of the problematic dependency upstream. TODO.
  4. It would be really nice to have this PR included in the upcoming Buildozer release as that would enable further work with P4A fixes :-)

@cederom
Copy link
Contributor Author

cederom commented Oct 17, 2022

Here is my local fork of NDK with several commits that enables build on FreeBSD. Bugs are reported to Google Android NDK team + fixes provided.

https://github.com/cederom/google-android-ndk/tree/cederom-freebsd

Note: Recipes does not build yet.

@cederom
Copy link
Contributor Author

cederom commented Oct 18, 2022

Not sure if its worth the effort to work with a so called "OpenSource" project (Google/Android/NDK) that rejects (as "not planned") even trivial patches to make it work on other platforms than officially supported :-(

android/ndk#1785

@cederom
Copy link
Contributor Author

cederom commented Oct 20, 2022

Allright two of the three patches were accepted :-)

Third one is in progress and under discussion on how to best enable FreeBSD operations without having official support from Google NDK team :-)

Copy link
Member

@misl6 misl6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!
Please keep us posted about FreeBSD support on Android NDK. 😄

@cederom
Copy link
Contributor Author

cederom commented Oct 21, 2022

Thank you @misl6 :-) When is next Buildozer release planned? :-)

@misl6 misl6 merged commit b8575fd into kivy:master Oct 21, 2022
@misl6
Copy link
Member

misl6 commented Oct 21, 2022

Thank you @misl6 :-) When is next Buildozer release planned? :-)

Nothing planned, but considering the current status we are likely going to have a new release in the first week of November.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants