Build Rockpi 4 source code from a local Mac environment

Hi all,
I’m trying to flash android source code into my Rockpi 4, and I’m using a Mac computer for the build. I’ve followed the instructions provided by source.android on how to setup a Mac environment, however I’m failing. The problem I encounter is that after downloading the source following the steps from: https://github.com/radxa/manifests, I can’t run build the u-boot. When I run ./make.sh rk3399, I get: “cannot execute binary file” errors because all the commands in this make-file assume I’m in a linux machine.
Is there a way I can configure the source files for me to be able to build in a Mac (darwin) machine?
I see that the source files have the option of selecting between linux or darwin in the prebuilts, but somehow the configuration assumed it was linux.

Thanks for your support and sorry if it’s a silly fix, I’m new to the android community.
Regards!

I think you can use docker to build under Mac. We have the Dockerfile in the repo, you can setup the docker environment and build in docker.

Thanks, I thought that was gonna be the way to go, but I was hoping for an alternative. It is weird because the files and packages to build using darwin (mac) are available in the source code, however the configuration is not set to use them… :confused:

Couldn’t we just modify the manifest to pull darwin instead of linux and use the google api for repo, instead of the mirror? I mean, this way android for the rockpi 4 will also be available for mac outside of China.

I would think that, as an apple user, you would be used to having to fight against the current to get anything to work as expected. Sorry to say that it is very unlikely to be anyone’s priority to get things working natively under apple environments.

Because who has ever heard of building Linux (Android is a linux distribution) under anything besides Linux?

I think, in addition to docker, you could also run under something like virtualbox. I presume that that runs under apple?

Yes I hear you, mac probably isn’t the right build environment as linux. The option with the Dockerfile is very accessible and straightforward - it creates a container with everything that’s needed to build the android source code in there. My comment of the modification to the manifest, was trying to point out towards accessibility to more users; maybe there are people that want to build android applications, but they have a mac machine. In any case google does support building aosp with mac (https://source.android.com/setup/build/initializing), because of being unix systems.

Some packing tools in the SDK are binary only and Rockchip only provides Linux x86_64 version. We try to reduce the dependence of them but they are the only way to use when upstream is not implemented such as SPI image generation.