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

Update build-toolchain.sh for mac os #483

Merged
merged 3 commits into from
Jan 12, 2024

Conversation

alexvnesta
Copy link
Contributor

This request will resolve
#461

It also addresses the isl issue - but only for mac os.
#460

My proposed changes:

  1. Add additional homebrew dependencies for mac os
  • they are specified in the libdragon compile from source guide, but it is more foolproof to add them in the configure script.
  1. Require homebrew install of zlib on mac os.
  • The system zlib throws a build error.
  1. Remove the requirement for system zlib if on mac os.
  • I made a platform check that uses system zlib if not on darwin, as I did not want to break other platforms.

I tested this by first removing all homebrew packages:

while [[ `brew list | wc -l` -ne 0 ]]; do
    for EACH in `brew list`; do
        brew uninstall --force --ignore-dependencies $EACH
    done
done

Then I cloned my modified repo and ran build-toolchain.sh on my m2 pro macbook running Mac OS Sonoma 14.2.1. Libdragon was able to successfully build without issue using these modifications.

Previously I would get errors not being able to find certain tools (like zlib, gcc, binutils, etc.). These errors are addressed by adding to the brew install -q command.

Please note, that I did not test other platforms. I am not sure if this will break regular mac os intel builds or non-mac os builds.

Add additional homebrew dependencies for mac os aarch64.

Require homebrew install of zlib on mac os.

Remove the requirement for system zlib if on mac os.
Updated the gcc configure args to an if-else and use os-type instead of platform for detecting os.
@alexvnesta
Copy link
Contributor Author

@rasky I changed to if-else relying on the os-type as you suggested. Hopefully this looks better. Thanks for the suggestion!

@rasky rasky merged commit 3ed61bc into DragonMinded:unstable Jan 12, 2024
6 of 7 checks passed
rasky pushed a commit that referenced this pull request Jan 12, 2024
@rasky
Copy link
Collaborator

rasky commented Jan 12, 2024

Pushed also to stable.

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

Successfully merging this pull request may close these issues.

2 participants