|
1 | | -// Copyright 2020 the Tectonic Project |
| 1 | +// Copyright 2020-2023 the Tectonic Project |
2 | 2 | // Licensed under the MIT License. |
3 | 3 |
|
4 | 4 | //! Harfbuzz build script. |
|
7 | 7 | mod inner { |
8 | 8 | use tectonic_dep_support::{Configuration, Dependency, Spec}; |
9 | 9 |
|
10 | | - // TODO: ICU not necessary if Harfbuzz >= 2.5. |
11 | 10 | struct HarfbuzzSpec; |
12 | 11 |
|
13 | 12 | impl Spec for HarfbuzzSpec { |
| 13 | + // We require Harfbuzz >= 1.4, but that version is ancient, and |
| 14 | + // specifying the version constraint in this string causes problems with |
| 15 | + // the `pkgconf` implementation of pkg-config on Windows/MSYS2. |
| 16 | + // (Specifically, its `--modversion` mode won't print anything out when |
| 17 | + // given two arguments, causing an unhandled crash inside the pkg_config |
| 18 | + // Rust library.) Likewise, for Harfbuzz < 2.5, the `harfbuzz-icu` |
| 19 | + // pkg-config item is needed, but this may also cause problems for |
| 20 | + // pkgconf. If you really need to compile against very old Harfbuzz, |
| 21 | + // patch this file and don't use pkgconf. |
14 | 22 | fn get_pkgconfig_spec(&self) -> &str { |
15 | | - "harfbuzz >= 1.4 harfbuzz-icu" |
| 23 | + "harfbuzz" |
16 | 24 | } |
17 | 25 |
|
18 | | - // TODO: can we ensure that the ICU and graphite2 options are enabled? |
| 26 | + // TODO: can we ensure that the graphite2 option is enabled? |
19 | 27 | fn get_vcpkg_spec(&self) -> &[&str] { |
20 | 28 | &["harfbuzz"] |
21 | 29 | } |
@@ -75,26 +83,19 @@ mod inner { |
75 | 83 | // Include paths exported by our internal dependencies: |
76 | 84 | let graphite2_include_path = env::var("DEP_GRAPHITE2_INCLUDE_PATH").unwrap(); |
77 | 85 | let graphite2_static = !env::var("DEP_GRAPHITE2_DEFINE_STATIC").unwrap().is_empty(); |
78 | | - let icu_include_path = env::var("DEP_ICUUC_INCLUDE_PATH").unwrap(); |
79 | 86 |
|
80 | 87 | let mut cfg = cc::Build::new(); |
81 | 88 |
|
82 | 89 | cfg.cpp(true) |
83 | 90 | .flag("-std=c++11") |
84 | 91 | .warnings(false) |
85 | 92 | .define("HAVE_GRAPHITE2", "1") |
86 | | - .define("HAVE_ICU", "1") |
87 | | - .file("harfbuzz/src/harfbuzz.cc") |
88 | | - .file("harfbuzz/src/hb-icu.cc"); |
| 93 | + .file("harfbuzz/src/harfbuzz.cc"); |
89 | 94 |
|
90 | 95 | for item in graphite2_include_path.split(';') { |
91 | 96 | cfg.include(item); |
92 | 97 | } |
93 | 98 |
|
94 | | - for item in icu_include_path.split(';') { |
95 | | - cfg.include(item); |
96 | | - } |
97 | | - |
98 | 99 | if graphite2_static { |
99 | 100 | cfg.define("GRAPHITE2_STATIC", "1"); |
100 | 101 | } |
@@ -129,10 +130,6 @@ mod inner { |
129 | 130 | print!(";{}", item); |
130 | 131 | } |
131 | 132 |
|
132 | | - for item in icu_include_path.split(';') { |
133 | | - print!(";{}", item); |
134 | | - } |
135 | | - |
136 | 133 | println!(); |
137 | 134 |
|
138 | 135 | let dest_dir = include_dir.join("harfbuzz"); |
|
0 commit comments