d-cross-compile-install
authorRust Maintainers <pkg-rust-maintainers@lists.alioth.debian.org>
Sun, 15 Oct 2017 21:30:35 +0000 (22:30 +0100)
committerXimin Luo <infinity0@debian.org>
Sun, 15 Oct 2017 21:30:35 +0000 (22:30 +0100)
Gbp-Pq: Name d-cross-compile-install.patch

src/bootstrap/step.rs

index cdb227fff6cef985e040f0a9c76ad212506ce3d9..76cbbbecc7efb91e4252cc68fea9892e6ab3ee92 100644 (file)
@@ -1056,11 +1056,18 @@ pub struct Rules<'a> {
 
 impl<'a> Rules<'a> {
     fn new(build: &'a Build) -> Rules<'a> {
+        let target_env = ::std::env::var("DEB_HOST_RUST_TYPE").unwrap();
+        // rust forces us to do this dance because of lifetimes :/
+        let hosts = &build.hosts;
+        let target = match hosts.iter().position(|x| x == target_env.as_str()) {
+            None => &build.build,
+            Some(tidx) => hosts[tidx].as_str()
+        };
         Rules {
             build: build,
             sbuild: Step {
                 stage: build.flags.stage.unwrap_or(2),
-                target: &build.build,
+                target: target,
                 host: &build.build,
                 name: "",
             },