From 8a3cea679aa0c6e81e8a6ef13da5b7f7bcc30fba Mon Sep 17 00:00:00 2001 From: Matus Honek Date: Jan 28 2020 03:06:32 +0000 Subject: Issue 50737 - Allow building with rust online without vendoring Bug Description: Building --rust-enable without --rust-enable-offline still requires predownloading the libraries. Fix Description: Setup .cargo/config on ./configure time allowing to subsequently do make that would in a case automatically download necessary libraries (in online mode). Fixes https://pagure.io/389-ds-base/issue/50737 Author: Matus Honek Review by: ??? --- diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index af24cf1..0000000 --- a/.cargo/config +++ /dev/null @@ -1,8 +0,0 @@ - - -[source.crates-io] -replace-with = "vendored-sources" - -[source.vendored-sources] -directory = "./vendor" - diff --git a/.cargo/config.in b/.cargo/config.in new file mode 100644 index 0000000..d7d8ff4 --- /dev/null +++ b/.cargo/config.in @@ -0,0 +1,6 @@ +[source.crates-io] +registry = "https://github.com/rust-lang/crates.io-index" +@rust_vendor_sources@ + +[source.vendored-sources] +directory = "./vendor" diff --git a/configure.ac b/configure.ac index 40fdf35..95772d7 100644 --- a/configure.ac +++ b/configure.ac @@ -105,11 +105,18 @@ if test "$enable_rust" = yes -o "$enable_rust_offline" = yes; then AC_MSG_FAILURE("Rust based plugins cannot be built cargo=$CARGO rustc=$RUSTC") ]) - + if test "$enable_rust_offline" = yes; then + rust_vendor_sources = "replace-with = \"vendored-sources\"" + else + rust_vendor_sources = "" + fi + AC_SUBST([rust_vendor_sources]) + AC_CONFIG_FILES([.cargo/config]) fi AC_SUBST([enable_rust]) AM_CONDITIONAL([RUST_ENABLE],[test "$enable_rust" = yes -o "$enable_rust_offline" = yes]) + AC_MSG_CHECKING(for --enable-debug) AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]), [], [ enable_debug=no ])