[Pkg-rust-maintainers] Packaging software written in Rust

Josh Triplett josh at joshtriplett.org
Sun Jul 24 07:31:49 UTC 2016

On Sat, Jul 23, 2016 at 10:13:27PM -0700, Josh Triplett wrote:
> Once we have a version of Cargo with that pull request included, and we
> have a way to specify the above source replace-with configuration via
> either an environment variable or the Cargo command line, I think we
> have all the pieces necessary to package Rust libraries and binaries
> manually.

Looking into this further, I don't think we even need to wait for a way
to specify this configuration via environment variable or Cargo command
line.  We already want to set CARGO_HOME to avoid picking up any
configuration in $HOME, so we can set it to a temporary directory and
copy /usr/share/cargo/registry.config to .cargo/config in that

> The remaining bits we might want (but don't have to have all at once
> before we start packaging):
> - A common package to build-depend on that includes the script to invoke
>   Cargo with the right parameters and/or environment variables.
> - A script to download a .crate file from crates.io (either the most
>   recent version or a specified version), with checksum verification.
>   Probably easiest to do this as a cargo subcommand.
> - A script to generate a debian/ directory for a library crate.  This
>   should generate debian/control (with the version number, Description,
>   and Depends for all the cargo dependencies), debian/copyright (based
>   on the license and license-file keys in Cargo.toml), debian/rules
>   (minimized dh version), etc.
> - A script to generate a debian/ directory for a binary crate.  This
>   will share a bit with the above (version, Description), but needs to
>   put the dependencies in Build-Depends and emit a completely different
>   debian/rules.
> - A Debian Rust Packaging Policy, defining the approach, the
>   installation directories, the translation from crate name to package
>   name (librust-cratename-dev with s/_/-/ in crate name), etc.

More information about the Pkg-rust-maintainers mailing list