# Building CrossMelv 0.5.1 from source

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

## What you need

- `crossmelv-0.5.1-source.tar.gz`: CrossMelv at commit `589d279e35a3f4faeb6ff7a0e74dbcde2bb1966a`
- `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.5.1-source.tar.gz
tar xzf freeink-sdk-d8c2e84-source.tar.gz
rm -rf crossmelv-0.5.1/freeink-sdk
mv freeink-sdk-d8c2e84 crossmelv-0.5.1/freeink-sdk
cd crossmelv-0.5.1
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.5.1-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
