# Building CrossMelv 0.7.3 from source

This is the corresponding source for `crossmelv-0.7.3-x4pro.bin`
(SHA-256 `ff676a23e1bd423d14b68e5ecd89a0f4b6ea159cc92410ebe853cf200c9e2b4c`).

## What you need

- `crossmelv-0.7.3-source.tar.gz`: CrossMelv at commit `dfbca5c35fa5180956621f569ae45f45c21d1f66`
- `freeink-sdk-d8c2e84-source.tar.gz`: the `freeink-sdk` submodule at commit `d8c2e843725887c11d6189b75e22b9507bd4962a`
- Python 3.11+ and [PlatformIO Core](https://docs.platformio.org/en/latest/core/installation/index.html)
  (it downloads the pioarduino ESP32 platform, toolchain and the library versions pinned in `platformio.ini`,
  including wolfSSL and NimBLE-Arduino)

## Steps

```sh
tar xzf crossmelv-0.7.3-source.tar.gz
tar xzf freeink-sdk-d8c2e84-source.tar.gz
rm -rf crossmelv-0.7.3/freeink-sdk
mv freeink-sdk-d8c2e84 crossmelv-0.7.3/freeink-sdk
cd crossmelv-0.7.3
pip install -r requirements.txt
pio run -e x4-pro
```

The firmware is written to `.pio/build/x4-pro/firmware.bin`. Rename it to `crossmelv-0.7.3-x4pro.bin` if you like.
A rebuild produces the same program from the same source; the bytes can differ from the release
because the build embeds timestamps and paths.

## Optional: icon sources

`assets/tabler-icons` is a git submodule (Tabler Icons, MIT, commit `8ac7d81b`,
https://github.com/tabler/tabler-icons). It is only needed to regenerate the icon bitmaps with
`scripts/generate_icons.py`; the generated icons are already in the source.

## Licenses

CrossMelv, CrossInk, CrossPoint Reader and the FreeInk SDK are MIT licensed (see `LICENSE` and
`freeink-sdk/NOTICE`). The firmware binary links wolfSSL, which is GPLv3, so the binary as a whole is
distributed under the GNU GPL version 3. Full list: https://crossmelv.melvernmogens.my.id/licenses
