[Pkg-rust-maintainers] Preliminary version of debcargo published

Josh Triplett josh at joshtriplett.org
Mon Nov 14 21:04:14 UTC 2016


While dh_* helper programs can use any language, as far as I can tell,
debhelper "Buildsystem" addons have to use Perl, in order to hook into
the various debhelper modules that invoke the Buildsystem.

- Josh Triplet

On Mon, Nov 14, 2016 at 09:48:25PM +0100, Willem Mali wrote:
> That's great to hear, and I would like to volunteer on dh-cargo. Can I get
> started on an /bin/sh -eu based dh-cargo, and is it OK to use that language?
> 
> If you want a rough idea of what my scripting currently looks like, this
> would be most representative:
> 
> https://gitlab.com/willemmali/chegit/
> 
> - Willem Mali
> 
> 
> 2016-11-14 19:48 GMT+01:00 Josh Triplett <josh at joshtriplett.org>:
> 
> > I just pushed a preliminary version of debcargo to the debcargo.git
> > repository under pkg-rust on alioth.
> >
> > After building debcargo with "cargo build" and putting it in your $PATH,
> > run "debcargo package cratename" to create a source package for that
> > crate.  That will download the crate if Cargo hasn't already downloaded
> > and cached it.
> >
> > The resulting packaging currently invokes the not-yet-written dh-cargo,
> > via "--buildsystem cargo".  That debhelper build system needs to do a
> > few things:
> >
> > - Depend on an appropriate version of cargo.
> > - Write a temporary .cargo/config file pointing to the directory
> >   registry in /usr/share/rust/cargo, and clean it up in the clean
> >   target.
> > - Run "cargo test" as part of the test target (unless DEB_BUILD_OPTIONS
> >   includes nocheck).
> > - For lib crates, run "cargo package" in the build target, and extract
> >   the resulting .crate file into the package's
> >   /usr/share/rust/cargo/$crate-$version in the binary target, to add it
> >   to the cargo directory registry.  In that same directory, write a
> >   .cargo-checksum.json file containing
> >   `{"package":"$checksum","files":{}}` , where $checksum is the
> >   sha256sum of the .crate file.
> > - For bin crates, run "cargo install --path . --root $tmpdir" in the
> >   binary target, where $tmpdir refers to the directory you package the
> >   .deb from.
> >
> > The .cargo/config file should contain the following:
> >
> > [source.crates-io]
> > replace-with = 'debian-registry'
> > local-registry = "/nonexistent"
> >
> > [source.debian-registry]
> > directory = '/usr/share/rust/cargo'
> >
> > I plan to write dh-cargo at some point, but if someone else wants to
> > start on it, feel free. :)  Happy to help adapt debcargo to make
> > dh-cargo's job easier (such as by pre-determining the list of binary and
> > library crates and providing that to dh-cargo somehow so it doesn't need
> > to parse debian/control).
> >
> > Also, for some reason, debcargo.git doesn't show up on git.debian.org
> > yet.  Do I need to do something to get it to show up there?
> >
> > - Josh Triplett
> >
> > _______________________________________________
> > Pkg-rust-maintainers mailing list
> > Pkg-rust-maintainers at lists.alioth.debian.org
> > https://lists.alioth.debian.org/mailman/listinfo/pkg-rust-maintainers
> >



More information about the Pkg-rust-maintainers mailing list