Install py-mini-racer on a Apple Silicons (M1, M2, M3, ...)¶
If you really want to use CSON parsing and generation in laputa, and you want to run that locally on Apple Silicons, you will need to follow this doc. It is a tutorial on how to install py-mini-racer for those CPUs architectures.
Before everything¶
Note that this way will ensure that you can use Laputa with CSON, but it'll make your computer 20 to 30% slower as we're going to
install a lot of tool using the arch -x86_64 retro-compatibility tool.
We are working on making the "nice" way fully operational so this is not needed anymore.
And now, let's script¶
# load x86 compatible shell (I'm using zsh here but any shell should work)
arch -x86_64 zsh
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install a few packages that Laputa will depend on + python env utilities
brew install autoconf automake libmagic libtool pyenv virtualenvwrapper xmlsec1
# install python X.Y.Z => /!\ replace X.Y.Z by the version mentioned at the top of the Dockerfile:
# https://github.com/ToucanToco/laputa/blob/master/Dockerfile#L1
pyenv install X.Y.Z
# reload your shell (should be the same command as line 1)
arch -x86_64 zsh
# create a virtual env for Laputa
mkvirtualenv -p `pyenv root`/versions/3.8.13/bin/python laputa
# <cd into your laputa directory or make one>
poetry install --all-extras
# You should now be able to run Laputa using the following command line
python ./laputa/manage.py runserver
Don't forget to replace X.Y.Z by the version of python of our Dockerfile.
Note : If you're using zsh you can just copy-paste the whole thing into a .sh file, add #!/bin/zsh at the start of your file and run it