# TODO:
# 1. The CJK and runes fonts don't load.
# 2. On a button press two characters are read in instead of one.
# 3. Backspace does not work.
# 4. TcpStream.shutdown() is not implemented.

[source]
git = "https://github.com/dcampbell24/hnefatafl"

[build]
template = "custom"
script = """
"${COOKBOOK_CARGO}" build \
    --manifest-path "${COOKBOOK_SOURCE}/${COOKBOOK_CARGO_PATH}/Cargo.toml" \
    --features client \
    --release \
    --no-default-features

mkdir -pv "${COOKBOOK_STAGE}/usr/bin"

cp -v "target/${TARGET}/release/hnefatafl-ai" "${COOKBOOK_STAGE}/usr/bin/hnefatafl-ai"
cp -v "target/${TARGET}/release/hnefatafl-client" "${COOKBOOK_STAGE}/usr/bin/hnefatafl-client"
cp -v "target/${TARGET}/release/hnefatafl-server" "${COOKBOOK_STAGE}/usr/bin/hnefatafl-server"
cp -v "target/${TARGET}/release/hnefatafl-text-protocol" "${COOKBOOK_STAGE}/usr/bin/hnefatafl-text-protocol"

mkdir -pv "${COOKBOOK_STAGE}"/usr/games
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/ui/apps
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/icons/apps
cp -rv "${COOKBOOK_SOURCE}"/src/bin/hnefatafl-client/helmet.png "${COOKBOOK_STAGE}"/usr/share/icons/apps/helmet.png
cp -rv "${COOKBOOK_SOURCE}"/packages/redox/manifest "${COOKBOOK_STAGE}"/usr/share/ui/apps/hnefatafl-client
mv "${COOKBOOK_STAGE}"/usr/bin/hnefatafl-client "${COOKBOOK_STAGE}"/usr/games/hnefatafl-client
"""

[package]
dependencies = [
    "dejavu",
    "freefont",
    "noto-color-emoji",
]
