From df927a84fc665fac32ce7bcf2de97abae0be675b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 23 Mar 2019 11:14:53 -0700 Subject: [PATCH] add zlib dep for windows builds --- .gitmodules | 3 +++ .travis.yml | 4 ++-- deps/fontconfig/build.rs | 1 - deps/freetype/build.rs | 10 ++++++++-- deps/freetype/zlib | 1 + deps/harfbuzz/build.rs | 1 - termwiz/src/color.rs | 2 +- 7 files changed, 15 insertions(+), 7 deletions(-) create mode 160000 deps/freetype/zlib diff --git a/.gitmodules b/.gitmodules index a7e3df633..4cd717ff7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "freetype/libpng"] path = deps/freetype/libpng url = https://github.com/glennrp/libpng.git +[submodule "deps/freetype/zlib"] + path = deps/freetype/zlib + url = https://github.com/madler/zlib.git diff --git a/.travis.yml b/.travis.yml index 2366f3349..677014bbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,8 +25,8 @@ before_script: script: - "if [[ \"$TRAVIS_RUST_VERSION\" == \"stable\" ]] ; then cargo fmt --all -- --check ; else true ; fi" - - cargo build --verbose --all - - cargo test --verbose --all + - cargo build --verbose + - cargo test --verbose -p term -p termwiz -p wezterm -p base91 -p varbincode addons: apt: diff --git a/deps/fontconfig/build.rs b/deps/fontconfig/build.rs index 609d071c9..bf1cbc498 100644 --- a/deps/fontconfig/build.rs +++ b/deps/fontconfig/build.rs @@ -1,5 +1,4 @@ use pkg_config; -use std::env; fn main() { if let Ok(lib) = pkg_config::Config::new() diff --git a/deps/freetype/build.rs b/deps/freetype/build.rs index 386457931..f626a4e6e 100644 --- a/deps/freetype/build.rs +++ b/deps/freetype/build.rs @@ -1,6 +1,13 @@ use cmake::Config; use std::env; +fn zlib() { + let mut config = Config::new("zlib"); + let dst = config.profile("Release").build(); + println!("cargo:rustc-link-search=native={}/lib", dst.display()); + println!("cargo:rustc-link-lib=static=z"); +} + fn libpng() { let mut config = Config::new("libpng"); let dst = config.profile("Release").build(); @@ -18,13 +25,12 @@ fn freetype() { println!("cargo:rustc-link-search=native={}/lib", dst.display()); println!("cargo:rustc-link-lib=static=freetype"); println!("cargo:rustc-link-search=native=/usr/lib"); - // println!("cargo:rustc-link-lib=bz2"); - println!("cargo:rustc-link-lib=z"); println!("cargo:include={}/include/freetype2", dst.display()); println!("cargo:lib={}/lib/libfreetype.a", dst.display()); } fn main() { + zlib(); libpng(); freetype(); let out_dir = env::var("OUT_DIR").unwrap(); diff --git a/deps/freetype/zlib b/deps/freetype/zlib new file mode 160000 index 000000000..cacf7f1d4 --- /dev/null +++ b/deps/freetype/zlib @@ -0,0 +1 @@ +Subproject commit cacf7f1d4e3d44d871b605da3b647f07d718623f diff --git a/deps/harfbuzz/build.rs b/deps/harfbuzz/build.rs index 4fd4594bb..793f1c0da 100644 --- a/deps/harfbuzz/build.rs +++ b/deps/harfbuzz/build.rs @@ -32,7 +32,6 @@ fn harfbuzz() { println!("cargo:rustc-link-search=native={}/lib", dst.display()); println!("cargo:rustc-link-lib=static=harfbuzz"); println!("cargo:rustc-link-search=native=/usr/lib"); - println!("cargo:rustc-link-lib=z"); } fn main() { diff --git a/termwiz/src/color.rs b/termwiz/src/color.rs index 921d37d9f..78ec35ac4 100644 --- a/termwiz/src/color.rs +++ b/termwiz/src/color.rs @@ -244,6 +244,6 @@ mod tests { fn roundtrip_rgbcolor() { let data = bincode::serialize(&RgbColor::from_named("DarkGreen").unwrap()).unwrap(); eprintln!("serialized as {:?}", data); - let decoded: RgbColor = bincode::deserialize(&data).unwrap(); + let _decoded: RgbColor = bincode::deserialize(&data).unwrap(); } }