optipng won't compile on mac silicon (#5581)

- create a Make option 'init-mac' to account for it
- allow run-boostrap.sh to process the new --optipng-fix flag

Open to better ideas (yes, move to linux is valid)
- Determining if you are on Apple silicon from
  run-bootstrap directly appeared to be problematic
  since it is running in a container
- Doing it prior in the make call seemed to make sense
  - change nothing for exisitng processes but add a
    simpler way forward for Mac folk
This commit is contained in:
smith 2024-05-02 17:14:02 -04:00 коммит произвёл GitHub
Родитель 7e771b3d8b
Коммит be21341d9a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -47,6 +47,9 @@ run: start
init: .docker-build init: .docker-build
${DC} run web bin/run-bootstrap.sh ${DC} run web bin/run-bootstrap.sh
init-mac: .docker-build
${DC} run web bin/run-bootstrap.sh --optipng-fix
shell: .docker-build shell: .docker-build
${DC} run web bash ${DC} run web bash

Просмотреть файл

@ -5,6 +5,12 @@ set -ex
# Install and setup localization # Install and setup localization
./scripts/l10n-fetch-lint-compile.sh ./scripts/l10n-fetch-lint-compile.sh
# If flag --optipng-fix is passed
if [[ $* == *--optipng-fix* ]]; then
# Install fix for optipng on mac silicon
export CPPFLAGS=-DPNG_ARM_NEON_OPT=0
fi
# Collect the JavaScript catalog files. # Collect the JavaScript catalog files.
python manage.py compilejsi18n python manage.py compilejsi18n

Просмотреть файл

@ -26,9 +26,21 @@ and follow the following steps.
``` ```
3. Pull base Kitsune Docker images, install node packages and build the Webpack bundle, and create your database. 3. Pull base Kitsune Docker images, install node packages and build the Webpack bundle, and create your database.
On non-Apple silicon:
``` ```
make init make init
```
On Apple silicon (M1, M2):
```
make init-mac
```
Then:
```
make build make build
``` ```