d-cross-compile-install
authorRust Maintainers <pkg-rust-maintainers@lists.alioth.debian.org>
Wed, 9 Aug 2017 02:49:55 +0000 (03:49 +0100)
committerPeter Michael Green <plugwash@raspbian.org>
Wed, 9 Aug 2017 02:49:55 +0000 (03:49 +0100)
Gbp-Pq: Name d-cross-compile-install.patch

src/bootstrap/step.rs

index a248bfcc9caa0a79875f0a44d6c0c34574f416e9..f6d708ae522d6ab617852b9bfaf9674e7a0bcdbd 100644 (file)
@@ -960,11 +960,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.config.host;
+        let target = match hosts.iter().position(|x| x == target_env.as_str()) {
+            None => &build.config.build,
+            Some(tidx) => hosts[tidx].as_str()
+        };
         Rules {
             build: build,
             sbuild: Step {
                 stage: build.flags.stage.unwrap_or(2),
-                target: &build.config.build,
+                target: target,
                 host: &build.config.build,
                 name: "",
             },