Skip to content

Add workaround for mac external-harfbuzz issues #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/bridge_harfbuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ tectonic_bridge_graphite2 = { path = "../bridge_graphite2", version = "0.0.0-dev
[build-dependencies]
cc = "^1.0.66"
tectonic_dep_support = { path = "../dep_support", version = "0.0.0-dev.0" }
tectonic_cfg_support = { path = "../cfg_support", version = "0.0.0-dev.0" }

[features]
external-harfbuzz = []

[package.metadata.internal_dep_versions]
tectonic_bridge_graphite2 = "2722731f9e32c6963fe8c8566a201b33672c5c5a"
tectonic_dep_support = "5faf4205bdd3d31101b749fc32857dd746f9e5bc"
tectonic_cfg_support = "thiscommit:aeRoo7oa"
11 changes: 11 additions & 0 deletions crates/bridge_harfbuzz/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#[cfg(feature = "external-harfbuzz")]
mod inner {
use std::env;
use tectonic_cfg_support::target_cfg;
use tectonic_dep_support::{Configuration, Dependency, Spec};

struct HarfbuzzSpec;
Expand Down Expand Up @@ -39,7 +41,16 @@ mod inner {

let mut sep = "cargo:include-path=";

let is_macos_external =
target_cfg!(target_os = "macos") && env::var("CARGO_FEATURE_EXTERNAL_HARFBUZZ").is_ok();

dep.foreach_include_path(|p| {
// HACK: On macOS, the default brew harfbuzz for some reason points into the harfbuzz
// folder itself, so we need to go up one level to the includes folder.
if is_macos_external && p.ends_with("harfbuzz") {
print!("{}{}", sep, p.parent().unwrap().to_str().unwrap());
sep = ";";
}
print!("{}{}", sep, p.to_str().unwrap());
sep = ";";
});
Expand Down