How do I get this crate on docs.rs

How can I get the Docs.rs documentation to build for a crate that depends on a library like Webkit2GTK, which doesn't compile on the Docs.rs system? So far, I've tried this approach:

[features]
docs = []

[package.metadata.docs.rs]
features = [ "docs" ]

[target.'cfg(not(feature = "docs"))'.dependencies]
# {{ GTK Dependencies }}

But due to a bug in Cargo that doesn't work. I also tried convincing Docs.rs to build for macOS instead with default-target = "x86_64-apple-darwin", but it still built the crate for Linux, anyway. Here's the crate I'm trying to get Docs.rs to build.

github.com/quadrupleslap/tether

2 Likes

On Linux, it cross-compiles successfully for x86_64-apple-darwin, so I'm hopeful that the solution to onur/docs.rs#141 will be enough to at least get the documentation from the macOS build. It's really roundabout (I think it works because the Objective-C runtime loads everything dynamically with string identifiers), but it's probably the easiest solution right now.