Technically, you can build the Darwin kernel from source, since they have it out there, along with some of their other, basic apps.
The rub for me was you needed to compile the kernel on a Mac to start with.
This was all years ago, and a lot could have changed since.