[package]
name = "rtrash"
version = "0.1.0"
edition = "2021"
rust-version = "1.77"
description = "Fast freedesktop.org trash tool with an rm-compatible interface"
license = "MIT"
authors = ["Rohit Goswami <rgoswami@ieee.org>"]
repository = "https://github.com/HaoZeke/rtrash"
categories = ["command-line-utilities", "filesystem"]
keywords = ["trash", "rm", "freedesktop", "xdg"]
readme = "README.md"

# cargo-binstall: resolve prebuilt binaries from GitHub Releases.
# Must stay in lockstep with scripts/package-release.sh tarball naming:
#   {name}-{version}-{arch}-unknown-linux-musl.tar.gz
# containing bin/{bin} (plus multi-call links, completions, man under share/).
# Tags are v{version} (e.g. v0.1.0). After a matching Release asset is published:
#   cargo binstall rtrash
#   # or, from git metadata before crates.io publish:
#   cargo binstall --git https://github.com/HaoZeke/rtrash rtrash
#
# Published Linux assets are *musl static* for x86_64 and aarch64. Map both
# typical glibc hosts (*-linux-gnu) and musl hosts to the matching musl asset
# so bare `cargo binstall rtrash` does not 404 looking for *-linux-gnu*.tar.gz.
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }.tar.gz"
pkg-fmt = "tgz"
bin-dir = "{ name }-{ version }-{ target }/bin/{ bin }{ binary-ext }"

[package.metadata.binstall.overrides."cfg(all(target_os = \"linux\", target_arch = \"x86_64\"))"]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ version }-x86_64-unknown-linux-musl.tar.gz"
pkg-fmt = "tgz"
bin-dir = "{ name }-{ version }-x86_64-unknown-linux-musl/bin/{ bin }{ binary-ext }"

[package.metadata.binstall.overrides."cfg(all(target_os = \"linux\", target_arch = \"aarch64\"))"]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ version }-aarch64-unknown-linux-musl.tar.gz"
pkg-fmt = "tgz"
bin-dir = "{ name }-{ version }-aarch64-unknown-linux-musl/bin/{ bin }{ binary-ext }"

[lib]
name = "rtrash"
path = "src/lib.rs"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "rtrash"
path = "src/main.rs"

[features]
default = []
# Build the PyO3 extension module (maturin --features python).
python = ["dep:pyo3"]

[dependencies]
libc = "0.2"
rayon = "1.10"
pyo3 = { version = "0.25", optional = true, features = ["extension-module"] }

[profile.release]
lto = true
codegen-units = 1
strip = true
panic = "abort"
