Skip to content

Commit

Permalink
build our own harfbuzz for broader compat
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Feb 20, 2018
1 parent 7c0536f commit e7d9902
Show file tree
Hide file tree
Showing 9 changed files with 3,494 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "harfbuzz/harfbuzz"]
path = harfbuzz/harfbuzz
url = https://github.com/harfbuzz/harfbuzz.git
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Note that travis has been disabled because the Trusty harfbuzz
# library doesn't have `hb_ft_font_create_referenced` and we require it
language: rust
rust:
# - stable we use a feature flag that precludes this
Expand All @@ -13,4 +11,4 @@ script:
- cargo test --verbose --all
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libxcb-icccm4-dev libxcb-ewmh-dev libxcb-image0-dev libxcb-keysyms1-dev libharfbuzz-dev libfontconfig1-dev libfreetype6-dev
- sudo apt-get install -y libxcb-icccm4-dev libxcb-ewmh-dev libxcb-keysyms1-dev libfontconfig1-dev libfreetype6-dev
14 changes: 9 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ bitflags = "1.0.1"
egli = "0.4.0"
euclid = "0.17.0"
failure = "0.1.1"
freetype = "0.3.0"
gl = "0.10.0"
harfbuzz-sys = "0.1.15"
libc = "0.2.36"
mio = "0.6.12"
palette = "0.2.1"
Expand All @@ -24,17 +22,23 @@ unicode-width = "0.1.4"
default-features = false
version = "0.20.0"

[dependencies.harfbuzz]
path = "harfbuzz"

[dependencies.term]
path = "term"

[dependencies.x11]
[target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies]
freetype = "0.3"

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.x11]
features = ["xlib"]
version = "2.17.2"

[dependencies.xcb]
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.xcb]
version = "0.8.1"

[dependencies.xcb-util]
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies.xcb-util]
features = [
"icccm",
"ewmh",
Expand Down
10 changes: 10 additions & 0 deletions harfbuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
authors = ["Wez Furlong <wez@wezfurlong.org>"]
name = "harfbuzz"
version = "0.1.0"

[build-dependencies]
cmake = "0.1.29"

[target.'cfg(any(target_os = "android", all(unix, not(target_os = "macos"))))'.dependencies]
freetype = "0.3"
16 changes: 16 additions & 0 deletions harfbuzz/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extern crate cmake;
use std::env;

fn main() {
let dst = cmake::Config::new("harfbuzz")
.define("HB_HAVE_FREETYPE", "ON")
.build();
println!("cargo:rustc-link-search=native={}/lib", dst.display());
println!("cargo:rustc-link-lib=static=harfbuzz");

// Dependent crates that need to find hb.h can use DEP_HARFBUZZ_INCLUDE from their build.rs.
println!(
"cargo:include={}",
env::current_dir().unwrap().join("harfbuzz/src").display()
);
}
1 change: 1 addition & 0 deletions harfbuzz/harfbuzz
Submodule harfbuzz added at f0b700
Loading

0 comments on commit e7d9902

Please sign in to comment.