processing-android icon indicating copy to clipboard operation
processing-android copied to clipboard

nix shell w/ npins

Open phanirithvij opened this issue 1 year ago • 3 comments

Add a nix shell script for ease of building.

A simple export NIXPKGS_ALLOW_UNFREE=1; nix-shell and cd processing; ./gradlew dist with only nix as the dependency.

A few minor bugs need to be fixed before testing this pr. ie. depends on #771 (the nonexistent vr/libs dir)

The npins/* is a helper script for nix, generated it via nix-shell -p npins --run "npins init", it can be ignored in review.

phanirithvij avatar Sep 22 '24 14:09 phanirithvij

Hey @phanirithvij, thanks for your contribution! I gave your two PRs a try, but I ran into issues on macOS (M1), so I wasn't able to fully test it. I’m not really knowledgeable about Nix (or processing-android for that matter), but it looks like Nix could make it easier for new contributors to set up a consistent local environment? It’d be great if the nix setup could work across platforms like Windows, macOS (ARM), and Linux, even without expert knowledge of Nix.

SableRaf avatar Oct 24 '24 10:10 SableRaf

On Windows it isn't possible yet (WSL works) but macos and Linux are covered by nix.

phanirithvij avatar Oct 24 '24 10:10 phanirithvij

Thanks for the clarification, @phanirithvij!

I tried running the Nix setup on macOS (ARM), but I ran into issues (log on pastebin)

I tried to set NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1, NIXPKGS_ALLOW_UNFREE=1, dirty patch the shell.nix file with ChatGPT, and run nix-shell --impure to get things moving, but the build still failed with some platform-specific issues. It doesn't help that I have no idea what I'm doing 🙃

Any guidance on how to adjust the Nix shell for macOS with Apple Silicon compatibility would be super helpful! It seems like this setup could be great for easing the environment setup for new contributors, but right now, I’m struggling to get it working on my M1 mac.

Thanks again for your efforts!

SableRaf avatar Oct 24 '24 11:10 SableRaf