I’m trying to add a specific yabai_4_x to nixpkgs (I couldn’t get 3.x to work on a Monterey M1).
Building a fresh yabai clone manually (in a native mac env) works well, but via nix-build (with an expression based on existing yabai/default.nix) doesn’t.
The steps I took:
try to build the existing yabai from nixpkgs with modified version/ref => xcrun not found
change build input xxd to xcbuild =>
> clang-11: error: invalid arch name '-arch arm64e'
I assume that this is because arm64e is M1 and only supported on newer clang?
In my normal environment I appear to have clang-13, so this probably means stdenv chooses the wrong clang for this case?
Can’t you get make out of gnumake and skip the reliance on CommandLineTools? For me make is /nix/store/zw06h3iqvaxkbbw573n3qwmib82sk1xm-gnumake-4.3/bin/make.
Thanks, I guess that could work, but wouldn’t that keep using clang-11 and just change the Makefile to be compatible with it? I’d guess a better (and more sustainable/“correct”) solution would be to have nix’s build env actually use the clang-13 available on the system? Is there no way to achieve that?
EDIT: spoke too soon, I just saw @azuwis posted overlay workaround is actually not really related to the reference to libredirect also posted, which, glancing at the source, is intended to achieve the above. I have yet to understand how to use that though…
EDIT2: ah, I saw that by setting the PATH in the build step actually the system’s default clang (which on Monterey-M1 is clang-13) is used and the replace’s in the makefile do the rest, so it works as intended!