[Pkg-rust-maintainers] Bug#907629: librsvg: Embedded code copies: assorted Rust libraries

Ximin Luo infinity0 at debian.org
Fri Nov 30 03:46:00 GMT 2018

Ximin Luo:
> Simon McVittie:
>> [..]
>> librsvg runs `cargo build` during its own build: running `make` compiles
>> C code, then calls `cargo build` to compile Rust code that depends on the
>> C, then compiles some more C code that depends on the Rust. I don't think
>> we can avoid that.
>> It might be possible to patch Makefile.am to use dh_auto_build or
>> dh_auto_install instead of `cargo build`, but that's "inside out" compared
>> with a normal Debian package build, so I'd be far from confident about
>> making that change myself.
> [..]

The latest version of the cargo Debian package has a wrapper script that should make this a bit easier. The cargo build itself now uses this wrapper script, see here for an example: https://salsa.debian.org/rust-team/cargo/blob/debian/sid/debian/rules

For librsvg, it should be sufficient to add a build-depends on python3:native, and add something like this to your d/rules:

PATH := /usr/share/cargo/bin:$(PATH)
export PATH

	cargo prepare-debian $(CURDIR)/vendor

Later, when this bug is fixed and you stop depending on vendored libraries, the configure override can be changed to:

	cargo prepare-debian /usr/share/cargo/registry


GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE

More information about the Pkg-rust-maintainers mailing list