harvard-web-publishing / mac-dev-playbook

Mac setup and configuration via Ansible.
Other
0 stars 0 forks source link

Support building the theme from DDEV #6

Open benjifisher opened 8 months ago

benjifisher commented 8 months ago

Building the theme requires Chromium binaries. Unfortunately, these are not yet available for Linux on arm64, so we cannot do this from within the DDEV Docker container.

Following the instructions on https://github.com/harvard-web-publishing/hwp-curie/wiki/2.-Local-Development-Setup, we need to do the following on the host (macOS):

  1. brew install nvm
  2. Edit ~/.profile as described in the "caveats" section after Step 1.
  3. nvm install 16.16 and nvm use 16.16.
  4. softwareupdate --install-rosetta --agree-to-license

Step 1 can be done easily with this project: just include nvm in the list of packages installed with Homebrew.

The rest (and perhaps the second part of Step 3) can be done from a script managed by DDEV.

benjifisher commented 8 months ago

From brew info nvm:

==> Caveats
Please note that upstream has asked us to make explicit managing
nvm via Homebrew is unsupported by them and you should check any
problems against the standard nvm install method prior to reporting.

You should create NVM's working directory if it doesn't exist:
  mkdir ~/.nvm

Add the following to your shell profile e.g. ~/.profile or ~/.zshrc:
  export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

You can set $NVM_DIR to any location, but leaving it unchanged from
/opt/homebrew/Cellar/nvm/0.39.7 will destroy any nvm-installed Node installations
upon upgrade/reinstall.

Type `nvm help` for further information.