Makefile.am: Add "cargo vendor" to dist-hook

Thanks to
https://github.com/endlessm/ostree/blob/47a54bf876023b0cb457bc8a4f4264f9b2ed5438/Makefile.am
for the incantations.

This makes it possible to release tarballs with all the Rust
dependencies embedded in them.

Hopefully this paves the way for distros to use Cargo's source
replacement to build librsvg with their own versions of dependencies.
parent d6683eb7
......@@ -100,7 +100,8 @@ RUST_SOURCES = \
rust/src/viewbox.rs
RUST_EXTRA = \
rust/Cargo.lock
rust/Cargo.lock \
rust/cargo-vendor-config
if DEBUG_RELEASE
CARGO_RELEASE_ARGS=
......@@ -118,6 +119,12 @@ clean-local:
cd $(top_srcdir)/rust && \
CARGO_TARGET_DIR=@abs_top_builddir@/rust/target cargo clean
dist-hook:
(cd $(distdir)/rust && \
cargo vendor -q && \
mkdir .cargo && \
cp cargo-vendor-config .cargo/config)
@abs_top_builddir@/rust/target/@RUST_TARGET_SUBDIR@/librsvg_internals.a: $(RUST_SOURCES)
cd $(top_srcdir)/rust && \
CARGO_TARGET_DIR=@abs_top_builddir@/rust/target cargo build --verbose $(CARGO_RELEASE_ARGS)
......
# This is used after `cargo vendor` is run from `make dist`.
#
# In the distributed tarball, this file should end up in
# rust/.cargo/config
[source.crates-io]
registry = 'https://github.com/rust-lang/crates.io-index'
replace-with = 'vendored-sources'
[source.vendored-sources]
directory = './vendor'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment