Skip to content

Instantly share code, notes, and snippets.

@mogenson
Created July 15, 2021 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogenson/e8ab6079e1f53aa66cdba1060b7ce0e4 to your computer and use it in GitHub Desktop.
Save mogenson/e8ab6079e1f53aa66cdba1060b7ce0e4 to your computer and use it in GitHub Desktop.
Nix shell to build CircuitPython on MacOS
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz") { }
, pkgs_x86_64 ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz") { localSystem = "x86_64-darwin"; }
}:
with pkgs.python38Packages;
let
cascadetoml = buildPythonPackage rec {
pname = "cascadetoml";
version = "0.3.0";
src = fetchPypi {
inherit pname version;
sha256 = "1i2n54q80g1kn06a9y1bvi5gsl76mcazjqq93bmy9gpr6sqx13yy";
};
propagatedBuildInputs = [ parse tabulate tomlkit typer ];
doCheck = false;
};
python = pkgs.python38.withPackages (
ps: [ cascadetoml jinja2 ]
);
in
pkgs.mkShell {
buildInputs = with pkgs; [
gettext
git
libffi
pkgconfig
pkgs_x86_64.gcc-arm-embedded
python
];
}
@mogenson
Copy link
Author

mogenson commented Jul 15, 2021

Should be enough to build Cortex-M and Unix ports on x86_64 or aarch64 based Darwin systems.

eg:

$ nix-shell --pure
$ make -C mpy-cross
$ make -C ports/unix
$ make -C ports/atmel-samd BOARD=pyportal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment