From f3a76e24f1b8e70050e106fa4b68bf582b7bf558 Mon Sep 17 00:00:00 2001 From: OJ Kwon Date: Tue, 16 Oct 2018 21:52:28 -0700 Subject: build(package): acquire latest winpty --- build.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index 5d0dace0..fd9aee37 100644 --- a/build.rs +++ b/build.rs @@ -37,7 +37,7 @@ use std::io; use std::fs::OpenOptions; #[cfg(windows)] -const WINPTY_PACKAGE_URL: &str = "https://www.nuget.org/api/v2/package/winpty.NET/0.4.2"; +const WINPTY_PACKAGE_URL: &str = "https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip"; fn main() { let dest = env::var("OUT_DIR").unwrap(); @@ -68,6 +68,7 @@ fn main() { fn aquire_winpty_agent(out_path: &Path) { let tmp_dir = TempDir::new("alacritty_build").unwrap(); + let mut response = reqwest::get(WINPTY_PACKAGE_URL).unwrap(); let mut file = OpenOptions::new() .read(true) @@ -80,12 +81,12 @@ fn aquire_winpty_agent(out_path: &Path) { let mut archive = zip::ZipArchive::new(file).unwrap(); let target = match env::var("TARGET").unwrap().split("-").next().unwrap() { - "x86_64" => "x86", - "i386" => "x64", + "x86_64" => "x64", + "i386" => "ia32", _ => panic!("architecture has no winpty binary") }; - let mut winpty_agent = archive.by_name(&format!("content/winpty/{}/winpty-agent.exe", target)).unwrap(); + let mut winpty_agent = archive.by_name(&format!("{}/bin/winpty-agent.exe", target)).unwrap(); io::copy(&mut winpty_agent, &mut File::create(out_path).unwrap()).unwrap(); } -- cgit