Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / library / tilecodec / src / main / rust / Cargo.toml

Cargo.toml51 lines · 2.4 KiBRaw
1# The PMTiles v3, MVT 2.1 and `.mamaps` codecs, shared by the offline tiler and the app.
2#
3# Extracted from `scripts/maps/tile_build`, which is still its older consumer.
4# The Android vector renderer in `:library:map` needs to read exactly the archives
5# that crate writes, and a second implementation of either format would be a
6# second thing to keep in agreement with the published basemap. So there is one.
7#
8# Member of the repo-root workspace (single root Cargo.lock). It is consumed by a
9# host binary AND by an aarch64-linux-android cdylib; workspace membership only
10# unifies version resolution and does not change its targets.
11#
12# `miniz_oxide` is the only dependency and is pure Rust, so this builds for the
13# host and cross-compiles for Android with no C toolchain and nothing to configure.
14# PMTiles gzips both its directories and its tiles, so the DEFLATE side is needed
15# as well as INFLATE.
16#
17# That single-pure-Rust-dependency rule is also what settled `.mamaps` compression.
18# The obvious choice on paper is zstd, but its encoder is C, so adding it would end
19# the property this whole file exists to preserve. `.mamaps` bodies are therefore raw
20# DEFLATE through the same `miniz_oxide`, and the format's `compression` header byte
21# keeps a swap open if a pure-Rust zstd encoder ever becomes worth the dependency.
22
23[package]
24name = "tilecodec"
25version = "0.1.0"
26edition = "2021"
27publish = false
28license = "GPL-2.0-only"
29description = "PMTiles v3, Mapbox Vector Tile 2.1 and .mamaps codecs shared by the Maps tiler and the Android renderer"
30
31[features]
32# The `.mamaps` writer. Off by default: Android reads archives and never writes one,
33# so gating it keeps the interner out of the cdylib and, more usefully, makes it a
34# compile error rather than a review comment if the read path ever grows a dependency
35# on the write path. `scripts/maps` enables it.
36write = ["dep:zstd-rs"]
37
38[lib]
39name = "tilecodec"
40path = "src/lib.rs"
41
42[dependencies]
43miniz_oxide.workspace = true
44# Pure-Rust zstd decoder for v9 bodies (no C toolchain, so the
45# aarch64-linux-android cdylib keeps its single-pure-Rust-dependency
46# property — see the crate docs above). Decode-only here; the host-side
47# encoder arrives with the writer change.
48ruzstd.workspace = true
49# Pure-Rust zstd encoder, host-side only (writer): v9 bodies. Optional so the
50# cdylib never links it — Android reads archives, it never writes one.
51zstd-rs = { workspace = true, optional = true }