diff --git a/Makefile-libostree.am b/Makefile-libostree.am index 63f0eb7d..d40196d4 100644 --- a/Makefile-libostree.am +++ b/Makefile-libostree.am @@ -25,7 +25,9 @@ noinst_LTLIBRARIES += libostree-kernel-args.la if ENABLE_RUST bupsplitpath = @abs_top_builddir@/target/@RUST_TARGET_SUBDIR@/libbupsplit_rs.a .PHONY: $(bupsplitpath) -$(bupsplitpath): Makefile rust/src/bupsplit.rs +BUPSPLIT_RUST_SOURCES = rust/src/bupsplit.rs +EXTRA_DIST += $(BUPSPLIT_RUST_SOURCES) +$(bupsplitpath): Makefile $(BUPSPLIT_RUST_SOURCES) cd $(top_srcdir)/rust && CARGO_TARGET_DIR=@abs_top_builddir@/target cargo build --verbose $(CARGO_RELEASE_ARGS) else bupsplitpath = libbupsplit.la diff --git a/Makefile.am b/Makefile.am index 4660515a..31c41251 100644 --- a/Makefile.am +++ b/Makefile.am @@ -73,6 +73,15 @@ check-local: clean-local: cd $(srcdir)/rust && CARGO_TARGET_DIR=$(abs_top_builddir)/target cargo clean + +dist-hook: + (cd $(distdir)/rust && \ + cp $(abs_top_srcdir)/rust/Cargo.lock . && \ + cargo vendor -q && \ + mkdir .cargo && \ + cp cargo-vendor-config .cargo/config) + +EXTRA_DIST += $(srcdir)/rust/Cargo.toml $(srcdir)/rust/cargo-vendor-config endif # end ENABLE_RUST libglnx_srcpath := $(srcdir)/libglnx diff --git a/rust/cargo-vendor-config b/rust/cargo-vendor-config new file mode 100644 index 00000000..5407266e --- /dev/null +++ b/rust/cargo-vendor-config @@ -0,0 +1,8 @@ +# This is used after `cargo vendor` is run from `make dist` + +[source.crates-io] +registry = 'https://github.com/rust-lang/crates.io-index' +replace-with = 'vendored-sources' + +[source.vendored-sources] +directory = './vendor'