Re-add `install --target` functionality, needed by dh-cargo
authorXimin Luo <infinity0@debian.org>
Sun, 12 Aug 2018 07:15:17 +0000 (00:15 -0700)
committerXimin Luo <infinity0@debian.org>
Sun, 12 Aug 2018 07:15:17 +0000 (00:15 -0700)
debian/changelog
debian/patches/0774e97da3894f07ed5b6f7db175027a9bc4718b.patch [new file with mode: 0644]
debian/patches/series

index c201efc72a08a797c2f0d7f14b52a318fe0c2e70..c4c4d19f3e6834f3685f1625d632ae9271547da6 100644 (file)
@@ -1,3 +1,9 @@
+cargo (0.28.0-2) UNRELEASED; urgency=medium
+
+  * Re-add `install --target` functionality, needed by dh-cargo.
+
+ -- Ximin Luo <infinity0@debian.org>  Sun, 12 Aug 2018 00:13:19 -0700
+
 cargo (0.28.0-1) unstable; urgency=medium
 
   * Upload to unstable
diff --git a/debian/patches/0774e97da3894f07ed5b6f7db175027a9bc4718b.patch b/debian/patches/0774e97da3894f07ed5b6f7db175027a9bc4718b.patch
new file mode 100644 (file)
index 0000000..4c96f84
--- /dev/null
@@ -0,0 +1,71 @@
+From 0774e97da3894f07ed5b6f7db175027a9bc4718b Mon Sep 17 00:00:00 2001
+From: Ximin Luo <infinity0@pwned.gg>
+Date: Thu, 28 Jun 2018 18:57:24 -0700
+Subject: [PATCH] Support cross-compile install
+
+---
+ src/bin/cargo/commands/install.rs |  1 +
+ tests/testsuite/install.rs        | 35 +++++++++++++++++++++++++++++++
+ 2 files changed, 36 insertions(+)
+
+--- a/src/bin/cargo/commands/install.rs
++++ b/src/bin/cargo/commands/install.rs
+@@ -32,6 +32,7 @@
+             "Install only the specified example",
+             "Install all examples",
+         )
++        .arg_target_triple("Build for the target triple")
+         .arg(opt("root", "Directory to install packages into").value_name("DIR"))
+         .after_help(
+             "\
+--- a/tests/testsuite/install.rs
++++ b/tests/testsuite/install.rs
+@@ -5,6 +5,7 @@
+ use cargo::util::ProcessBuilder;
+ use cargotest::ChannelChanger;
+ use cargotest::install::{cargo_home, has_installed_exe};
++use cargotest::support::cross_compile;
+ use cargotest::support::git;
+ use cargotest::support::paths;
+ use cargotest::support::registry::Package;
+@@ -1309,6 +1310,40 @@
+ }
+ #[test]
++fn install_target_native() {
++    pkg("foo", "0.1.0");
++
++    assert_that(
++        cargo_process("install")
++            .arg("foo")
++            .arg("--target")
++            .arg(cargotest::rustc_host()),
++        execs()
++            .with_status(0),
++    );
++    assert_that(cargo_home(), has_installed_exe("foo"));
++}
++
++#[test]
++fn install_target_foreign() {
++    if cross_compile::disabled() {
++        return;
++    }
++
++    pkg("foo", "0.1.0");
++
++    assert_that(
++        cargo_process("install")
++            .arg("foo")
++            .arg("--target")
++            .arg(cross_compile::alternate()),
++        execs()
++            .with_status(0),
++    );
++    assert_that(cargo_home(), has_installed_exe("foo"));
++}
++
++#[test]
+ fn vers_precise() {
+     pkg("foo", "0.1.1");
+     pkg("foo", "0.1.2");
index 276c5af3c496c44fbf800e4c3745459401c84e85..0a52b1a4f0afb7504a7e2a2e397b81e26f7290cb 100644 (file)
@@ -1,3 +1,4 @@
+0774e97da3894f07ed5b6f7db175027a9bc4718b.patch
 2007_sparc64_disable_incremental_build.patch
 2004_clean-cargo-deps.patch
 2001_use-system-libgit2.patch