stack-chan/stack-chan on arch
stack-chan/stack-chanをarchlinux上で構築するメモ
前準備
moddableのインストール
code:zsh
cd ~/repo/github
mkdir Moddable-OpenSource
cd Moddable-OpenSource
gh repo clone Moddable-OpenSource/moddable
mobbableの依存関係をインストール
code:zsh
sudo pacman -S gcc git wget make ncurses flex bison gperf gtk3
code:zsh
cd moddable
cd build/makefiles/lin
export MODDABLE=~/repo/github/Moddable-OpenSource/moddable
export PATH=$PATH:~/repo/github/Moddable-OpenSource/moddable/build/bin/lin/release # 中間生成物を使うため
make SHELL=/usr/bin/zsh # 自分の使っているシェルに上書く
綺麗に使いたいので ~/.local に置くようにする
必要なディレクトリ掘る
code:zsh
mkdir -p ~/.local/bin
mkdir -p ~/.local/share/applications
mkdir -p ~/.local/share/icons/hicolor/32x32/apps && mkdir -p ~/.local/share/icons/hicolor/48x48/apps && mkdir -p ~/.local/share/icons/hicolor/64x64/apps && mkdir -p ~/.local/share/icons/hicolor/96x96/apps && mkdir -p ~/.local/share/icons/hicolor/128x128/apps && mkdir -p ~/.local/share/icons/hicolor/256x256/apps # ないディレクトリ作ってくれないので
makefile編集する
/repo/github/Moddable-OpenSource/moddable/build/tmp/lin/release/xsbug/makefile
sudo を消す(4箇所)
gtk-update-icon-cache を消す(1箇所)
/repo/github/Moddable-OpenSource/moddable/build/tmp/lin/release/mcsim/makefile
sudo を消す(4箇所)
gtk-update-icon-cache を消す(1箇所)
インストールする
code:zsh
make install INSTALL_BIN_DIR=~/.local/bin INSTALL_DESKTOP_DIR=~/.local/share/applications INSTALL_ICON_DIR=~/.local/share/icons/hicolor
起動確認
code:zsh
xsbug
GUIが起きてくればOK(たぶん)
esp-idfのインストール
aurにあるので入れるだけ
https://aur.archlinux.org/packages/esp-idf
code:zsh
paru -S esp-idf
(2025/01/18)
moddableが対応しているバージョンではないので、古いバージョンを makepkg -si で入れる
そのうちmoddableが対応すると思うので、素直に待ったほうがいい。
これに従う
code:zsh
To use ESP-IDF:
1. Run /opt/esp-idf/install.sh to install ESP-IDF to ~/.espressif.
You only have to do this once after installing or upgrading
the esp-idf package.
2. Run source /opt/esp-idf/export.sh to add idf.py and idf_tools.py
to your current PATH. You will have to do this in every terminal
where you want to use ESP-IDF. Alternatively, you can add
"source /opt/esp-idf/export.sh" to ~/.bashrc or the equivalent for
your shell to load ESP-IDF automatically in all terminals.
環境変数を足す
code:zsh
# moddable
export MODDABLE=~/repo/github/Moddable-OpenSource/moddable
export PATH=$PATH:$MODDABLE/build/bin/lin/release
# esp-idf
source /opt/esp-idf/export.sh
stack-chanのビルド
code:zsh
cd ~/repo/github
mkdir stack-chan
cd stack-chan
gh repo clone stack-chan/stack-chan
設定ができているか確認
code:zsh
% npm run doctor ~/repo/github/stack-chan/stack-chan/firmwaredev/v1.0
stack-chan@0.2.1 doctor
echo stack-chan environment info: && git rev-parse HEAD && git rev-parse --show-toplevel && xs-dev doctor
stack-chan environment info:
8a1e96d81d8a31e46ccb43c3bc6c310c17d84b33
/home/kei/repo/github/stack-chan/stack-chan
xs-dev environment info:
CLI Version 0.36.5
OS Linux
Arch x64
Shell /usr/bin/zsh
NodeJS Version v22.11.0 (/home/kei/.asdf/installs/nodejs/22.11.0/bin/node)
Python Version 3.11.1 (/home/kei/.espressif/python_env/idf5.4_py3.11_env/bin/python)
Moddable SDK Version 5.3.3 (/home/kei/repo/github/Moddable-OpenSource/moddable)
Supported target devices linux, esp32
ESP32 IDF Directory /opt/esp-idf
必要に応じてconfigを変更する
https://github.com/stack-chan/stack-chan/blob/dev/v1.0/firmware/docs/flashing-firmware_ja.md#設定例-スタックチャン-m5bottom-版キットを動かす
ビルド&デプロイ
https://github.com/stack-chan/stack-chan/blob/dev/v1.0/firmware/docs/flashing-firmware_ja.md#基本プログラムホストの書き込み